Removed redundant llama protocol (Use openai)
All checks were successful
Publish Library / Build NPM Project (push) Successful in 44s
Publish Library / Tag Version (push) Successful in 13s

This commit is contained in:
2026-07-11 19:33:02 -04:00
parent 9a39f00f94
commit 2d49c9aa80
4 changed files with 13 additions and 25 deletions

View File

@@ -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;