mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 15:39:06 +08:00
fix: update schema handling and config for multi-provider support
Co-Authored-By: Han Xiao <han.xiao@jina.ai>
This commit is contained in:
@@ -43,7 +43,7 @@ export const aiConfig: AIConfig = {
|
||||
providers: {
|
||||
gemini: {
|
||||
type: 'gemini',
|
||||
model: 'gemini-pro',
|
||||
model: 'gemini-1.5-pro',
|
||||
temperature: 0
|
||||
},
|
||||
openai: {
|
||||
|
||||
@@ -110,14 +110,8 @@ export function getProviderSchema(provider: ProviderType, schema: z.ZodSchema):
|
||||
case 'gemini':
|
||||
return convertToGeminiSchema(schema);
|
||||
case 'openai':
|
||||
case 'ollama': {
|
||||
const functionSchema = convertToOpenAIFunctionSchema(schema);
|
||||
return {
|
||||
type: 'object',
|
||||
properties: functionSchema.properties,
|
||||
required: functionSchema.required
|
||||
};
|
||||
}
|
||||
case 'ollama':
|
||||
return convertToOpenAIFunctionSchema(schema);
|
||||
default:
|
||||
throw new Error(`Unsupported provider: ${provider}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user