Removed redundant llama protocol (Use openai)
This commit is contained in:
@@ -8,7 +8,7 @@ import {convertSchema} from './tools.ts';
|
||||
export class OpenAi extends LLMProvider {
|
||||
client!: openAI;
|
||||
|
||||
constructor(public readonly ai: Ai, public readonly host: string | null, public readonly token: string, public model: string, public llama?: boolean) {
|
||||
constructor(public readonly ai: Ai, public readonly host: string | null, public readonly token: string, public model: string) {
|
||||
super();
|
||||
this.client = new openAI(clean({
|
||||
baseURL: host,
|
||||
@@ -96,22 +96,14 @@ export class OpenAi extends LLMProvider {
|
||||
|
||||
if(options.schema) {
|
||||
const schema = convertSchema(options.schema);
|
||||
if(this.llama) {
|
||||
delete requestParams.tools;
|
||||
requestParams.response_format = {
|
||||
type: 'json_schema',
|
||||
json_schema: {name: 'json', schema}
|
||||
requestParams.response_format = {
|
||||
type: 'json_schema',
|
||||
json_schema: {
|
||||
name: 'response',
|
||||
strict: true,
|
||||
schema
|
||||
}
|
||||
} else {
|
||||
requestParams.response_format = {
|
||||
type: 'json_schema',
|
||||
json_schema: {
|
||||
name: 'response',
|
||||
strict: true,
|
||||
schema
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let resp: any, isFirstMessage = true;
|
||||
|
||||
Reference in New Issue
Block a user