fixing api calls
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { openai, defaultModel, serviceOptions } from '../agent.js';
|
||||
import { openai, defaultModel, serviceOptions, parseWithRetry } from '../agent.js';
|
||||
import type { InterpreterOutput, MediaType } from '../types/agents.js';
|
||||
import { z } from 'zod';
|
||||
import { zodTextFormat } from 'openai/helpers/zod';
|
||||
@@ -28,7 +28,7 @@ export async function runInterpreter(input: InterpreterInput): Promise<Interpret
|
||||
? `\n\nUser Feedback Context (incorporate into preferences):\n${input.feedback_context}`
|
||||
: '';
|
||||
|
||||
const response = await openai.responses.parse({
|
||||
const response = await parseWithRetry(() => openai.responses.parse({
|
||||
model: defaultModel,
|
||||
temperature: 0.2,
|
||||
...serviceOptions,
|
||||
@@ -46,7 +46,7 @@ Rules:
|
||||
Liked ${mediaLabel}s: ${input.liked_shows || '(none)'}
|
||||
Disliked ${mediaLabel}s: ${input.disliked_shows || '(none)'}
|
||||
Themes and requirements: ${input.themes || '(none)'}${feedbackSection}`,
|
||||
});
|
||||
}));
|
||||
|
||||
return (response.output_parsed as InterpreterOutput) ?? {
|
||||
liked: [], disliked: [], themes: [], character_preferences: [], tone: [], avoid: [], requirements: []
|
||||
|
||||
Reference in New Issue
Block a user