kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
rodzic
a2b20ad8b5
commit
e25eab97eb
22
package.json
22
package.json
|
@ -9,9 +9,6 @@
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
},
|
},
|
||||||
"workspaces": [
|
|
||||||
"packages/*"
|
|
||||||
],
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "run-s build:*",
|
"build": "run-s build:*",
|
||||||
"build:tsup": "lerna run build --no-private",
|
"build:tsup": "lerna run build --no-private",
|
||||||
|
@ -25,6 +22,15 @@
|
||||||
"test": "run-p test:*",
|
"test": "run-p test:*",
|
||||||
"test:prettier": "prettier '**/*.{js,jsx,ts,tsx}' --check"
|
"test:prettier": "prettier '**/*.{js,jsx,ts,tsx}' --check"
|
||||||
},
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@dqbd/tiktoken": "^1.0.7",
|
||||||
|
"dotenv-safe": "^8.2.0",
|
||||||
|
"openai-fetch": "^1.2.0",
|
||||||
|
"p-map": "^6.0.0",
|
||||||
|
"parse-json": "^7.0.0",
|
||||||
|
"zod": "^3.21.4",
|
||||||
|
"zod-validation-error": "^1.3.0"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
||||||
"@types/node": "^18.15.13",
|
"@types/node": "^18.15.13",
|
||||||
|
@ -54,13 +60,5 @@
|
||||||
"openapi",
|
"openapi",
|
||||||
"guardrails",
|
"guardrails",
|
||||||
"plugins"
|
"plugins"
|
||||||
],
|
]
|
||||||
"dependencies": {
|
|
||||||
"dotenv-safe": "^8.2.0",
|
|
||||||
"openai-fetch": "^1.2.0",
|
|
||||||
"p-map": "^6.0.0",
|
|
||||||
"parse-json": "^7.0.0",
|
|
||||||
"zod": "^3.21.4",
|
|
||||||
"zod-validation-error": "^1.3.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
lockfileVersion: '6.0'
|
lockfileVersion: '6.0'
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@dqbd/tiktoken':
|
||||||
|
specifier: ^1.0.7
|
||||||
|
version: 1.0.7
|
||||||
dotenv-safe:
|
dotenv-safe:
|
||||||
specifier: ^8.2.0
|
specifier: ^8.2.0
|
||||||
version: 8.2.0
|
version: 8.2.0
|
||||||
|
@ -165,6 +168,10 @@ packages:
|
||||||
to-fast-properties: 2.0.0
|
to-fast-properties: 2.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@dqbd/tiktoken@1.0.7:
|
||||||
|
resolution: {integrity: sha512-bhR5k5W+8GLzysjk8zTMVygQZsgvf7W1F0IlL4ZQ5ugjo5rCyiwGM5d8DYriXspytfu98tv59niang3/T+FoDw==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@esbuild-kit/cjs-loader@2.4.2:
|
/@esbuild-kit/cjs-loader@2.4.2:
|
||||||
resolution: {integrity: sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==}
|
resolution: {integrity: sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
|
@ -15,9 +15,9 @@ async function main() {
|
||||||
// given an output as a boolean.
|
// given an output as a boolean.
|
||||||
// true/false
|
// true/false
|
||||||
|
|
||||||
const ex1 = await $.gpt4(
|
const ex1 = await $.gpt4('give me a list of character names from star wars')
|
||||||
'give me a list of character names from star wars'
|
.output(z.array(z.string().nonempty()))
|
||||||
).output(z.array(z.string().nonempty()))
|
.stream()
|
||||||
|
|
||||||
const ex2 = await $.gpt4(`Summarize the following text: {{text}}`)
|
const ex2 = await $.gpt4(`Summarize the following text: {{text}}`)
|
||||||
.output(z.string().nonempty())
|
.output(z.string().nonempty())
|
||||||
|
|
|
@ -94,6 +94,14 @@ export abstract class BaseLLMCallBuilder<TInput, TOutput, TModelParams> {
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract call(input?: TInput): Promise<TOutput>
|
abstract call(input?: TInput): Promise<TOutput>
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// abstract stream(
|
||||||
|
// input: TInput,
|
||||||
|
// onProgress: types.ProgressFunction
|
||||||
|
// ): Promise<TOutput>
|
||||||
|
|
||||||
|
// abstract stream(onProgress: types.ProgressFunction): Promise<TOutput>
|
||||||
}
|
}
|
||||||
|
|
||||||
export abstract class ChatModelBuilder<
|
export abstract class ChatModelBuilder<
|
||||||
|
|
Ładowanie…
Reference in New Issue