kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
old-agentic-v1^2
rodzic
49043941ca
commit
6c43838782
|
@ -64,6 +64,37 @@ export class Agentic {
|
|||
})
|
||||
}
|
||||
|
||||
gpt3(
|
||||
promptOrChatCompletionParams:
|
||||
| string
|
||||
| Omit<types.openai.ChatCompletionParams, 'model'>
|
||||
) {
|
||||
let options: Omit<types.openai.ChatCompletionParams, 'model'>
|
||||
|
||||
if (typeof promptOrChatCompletionParams === 'string') {
|
||||
options = {
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
content: promptOrChatCompletionParams
|
||||
}
|
||||
]
|
||||
}
|
||||
} else {
|
||||
options = promptOrChatCompletionParams
|
||||
|
||||
if (!options.messages) {
|
||||
throw new Error('messages must be provided')
|
||||
}
|
||||
}
|
||||
|
||||
return new OpenAIChatModelBuilder(this._client, {
|
||||
...(this._defaults as any), // TODO
|
||||
model: 'gpt-3.5-turbo',
|
||||
...options
|
||||
})
|
||||
}
|
||||
|
||||
gpt4(
|
||||
promptOrChatCompletionParams:
|
||||
| string
|
||||
|
|
|
@ -15,8 +15,8 @@ export type MetaphorSearchToolInput = z.infer<
|
|||
export const MetaphorSearchToolOutputSchema = z.object({
|
||||
results: z.array(
|
||||
z.object({
|
||||
author: z.string().optional(),
|
||||
dateCreated: z.string().optional(),
|
||||
author: z.string().nullable(),
|
||||
dateCreated: z.string().nullable(),
|
||||
score: z.number(),
|
||||
title: z.string(),
|
||||
url: z.string()
|
||||
|
|
Ładowanie…
Reference in New Issue