adding support for generic AI provider (OpenAI compatible)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { openai } from '../agent.js';
|
||||
import { openai, defaultModel, serviceOptions, supportsWebSearch } from '../agent.js';
|
||||
import type { InterpreterOutput, RankingOutput, CuratorOutput, MediaType } from '../types/agents.js';
|
||||
import { z } from 'zod';
|
||||
import { zodTextFormat } from 'openai/helpers/zod';
|
||||
@@ -32,11 +32,12 @@ export async function runCurator(
|
||||
.map((s) => `- "${s.title}" (${s.category})`)
|
||||
.join('\n');
|
||||
|
||||
const canSearch = useWebSearch && supportsWebSearch;
|
||||
const response = await openai.responses.parse({
|
||||
model: 'gpt-5.4',
|
||||
model: defaultModel,
|
||||
temperature: 0.5,
|
||||
service_tier: 'flex',
|
||||
...(useWebSearch ? { tools: [{ type: 'web_search' as const }] } : {}),
|
||||
...serviceOptions,
|
||||
...(canSearch ? { tools: [{ type: 'web_search' as const }] } : {}),
|
||||
text: { format: zodTextFormat(CuratorSchema, "shows") },
|
||||
instructions: `You are a ${mediaLabel} recommendation curator. For each ${mediaLabel}, write a concise 1-2 sentence explanation of why it was assigned to its category based on the user's preferences.${useWebSearch ? '\n\nUse web search to verify details and enrich explanations with accurate information.' : ''}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user