switch system messages to leverage caching a bit better

This commit is contained in:
dal 2025-07-24 10:06:18 -06:00
parent 8104ad33bf
commit 19f7256a27
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
3 changed files with 8 additions and 11 deletions

View File

@ -11,12 +11,9 @@ type MarkdownComponentProps = {
children: React.ReactNode;
className?: string;
style?: React.CSSProperties;
} & Pick<
AnimatedMarkdownProps,
'animation' | 'animationDuration' | 'animationTimingFunction'
> & {
isStreamFinished: boolean;
};
} & Pick<AnimatedMarkdownProps, 'animation' | 'animationDuration' | 'animationTimingFunction'> & {
isStreamFinished: boolean;
};
type NonAnimatedMarkdownComponentProps = Omit<
MarkdownComponentProps,

View File

@ -59,7 +59,7 @@ const outputSchema = z.object({
});
const DEFAULT_CACHE_OPTIONS = {
anthropic: { cacheControl: { type: 'ephemeral' } },
anthropic: { cacheControl: { type: 'ephemeral', ttl: '1hr' } },
};
/**
@ -383,12 +383,12 @@ ${databaseContext}
const systemMessages: CoreMessage[] = [
{
role: 'system',
content: createDatasetSystemMessage(assembledYmlContent),
content: createAnalystInstructionsWithoutDatasets(sqlDialectGuidance),
providerOptions: DEFAULT_CACHE_OPTIONS,
},
{
role: 'system',
content: createAnalystInstructionsWithoutDatasets(sqlDialectGuidance),
content: createDatasetSystemMessage(assembledYmlContent),
providerOptions: DEFAULT_CACHE_OPTIONS,
},
];

View File

@ -254,12 +254,12 @@ ${databaseContext}
const systemMessages: CoreMessage[] = [
{
role: 'system',
content: createDatasetSystemMessage(assembledYmlContent),
content: createThinkAndPrepInstructionsWithoutDatasets(sqlDialectGuidance),
providerOptions: DEFAULT_CACHE_OPTIONS,
},
{
role: 'system',
content: createThinkAndPrepInstructionsWithoutDatasets(sqlDialectGuidance),
content: createDatasetSystemMessage(assembledYmlContent),
providerOptions: DEFAULT_CACHE_OPTIONS,
},
];