mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
refactor: extract system prompts and add extended prompt for Opus/Haiku 4.5 (#71)
- Extract system prompts to dedicated lib/system-prompts.ts module - Add extended system prompt (~4000 tokens) for models with higher cache minimums (Opus 4.5, Haiku 4.5) - Clean up debug logs while preserving informational and cache-related logs - Improve code formatting and organization in chat route
This commit is contained in:
@@ -21,6 +21,7 @@ interface ModelConfig {
|
||||
model: any;
|
||||
providerOptions?: any;
|
||||
headers?: Record<string, string>;
|
||||
modelId: string;
|
||||
}
|
||||
|
||||
// Bedrock provider options for Anthropic beta features
|
||||
@@ -91,7 +92,6 @@ export function getAIModel(): ModelConfig {
|
||||
// Validate provider credentials
|
||||
validateProviderCredentials(provider);
|
||||
|
||||
// Log initialization for debugging
|
||||
console.log(`[AI Provider] Initializing ${provider} with model: ${modelId}`);
|
||||
|
||||
let model: any;
|
||||
@@ -191,10 +191,5 @@ export function getAIModel(): ModelConfig {
|
||||
);
|
||||
}
|
||||
|
||||
// Log if provider options or headers are being applied
|
||||
if (providerOptions || headers) {
|
||||
console.log('[AI Provider] Applying provider-specific options/headers');
|
||||
}
|
||||
|
||||
return { model, providerOptions, headers };
|
||||
return { model, providerOptions, headers, modelId };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user