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