generate chat title to haiku

This commit is contained in:
dal 2025-09-25 12:37:19 -06:00
parent abc8b7ed8a
commit afe66b43d9
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
2 changed files with 5 additions and 6 deletions

View File

@ -6,7 +6,6 @@ export const DEFAULT_ANTHROPIC_OPTIONS = {
gateway: {
order: ['bedrock', 'anthropic', 'vertex'],
},
headers: {},
anthropic: { cacheControl: { type: 'ephemeral' } },
};
@ -15,7 +14,7 @@ export const DEFAULT_OPENAI_OPTIONS = {
order: ['openai'],
},
openai: {
parallelToolCalls: false,
// parallelToolCalls: false,
reasoningEffort: 'minimal',
verbosity: 'low',
},

View File

@ -3,8 +3,8 @@ import { generateObject } from 'ai';
import type { ModelMessage } from 'ai';
import { wrapTraced } from 'braintrust';
import { z } from 'zod';
import { GPT5Nano } from '../../../llm';
import { DEFAULT_OPENAI_OPTIONS } from '../../../llm/providers/gateway';
import { Haiku35 } from '../../../llm';
import { DEFAULT_ANTHROPIC_OPTIONS } from '../../../llm/providers/gateway';
// Zod-first: define input/output schemas and export inferred types
export const generateChatTitleParamsSchema = z.object({
@ -56,10 +56,10 @@ async function generateTitleWithLLM(messages: ModelMessage[]): Promise<string> {
const tracedChatTitle = wrapTraced(
async () => {
const { object } = await generateObject({
model: GPT5Nano,
model: Haiku35,
schema: llmOutputSchema,
messages: titleMessages,
providerOptions: DEFAULT_OPENAI_OPTIONS,
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
});
return object;