mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
feat(core): use claude 4 as default chat model (#12596)
Support [AI-59](https://linear.app/affine-design/issue/AI-59) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated the default AI model for chat prompts to use Claude Sonnet 4. - **Bug Fixes** - Improved model selection logic to better support reasoning features across more AI models. - **Tests** - Enhanced test cases with consistent instructions for response length. - Skipped certain chat-related tests to refine test suite stability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -333,7 +333,7 @@ The term **“CRDT”** was first introduced by Marc Shapiro, Nuno Preguiça, Ca
|
||||
messages: [
|
||||
{
|
||||
role: 'user' as const,
|
||||
content: 'what is ssot',
|
||||
content: 'what is AFFiNE AI?',
|
||||
params: {
|
||||
files: [
|
||||
{
|
||||
|
||||
@@ -1558,7 +1558,7 @@ const imageActions: Prompt[] = [
|
||||
];
|
||||
|
||||
const CHAT_PROMPT: Omit<Prompt, 'name'> = {
|
||||
model: 'gpt-4.1',
|
||||
model: 'claude-sonnet-4@20250514',
|
||||
optionalModels: [
|
||||
'gpt-4.1',
|
||||
'o3',
|
||||
|
||||
@@ -142,7 +142,7 @@ export abstract class AnthropicProvider<T> extends CopilotProvider<T> {
|
||||
}
|
||||
|
||||
private isReasoningModel(model: string) {
|
||||
// only claude 3.7 sonnet supports reasoning config
|
||||
return model.startsWith('claude-3-7-sonnet');
|
||||
// claude 3.5 sonnet doesn't support reasoning config
|
||||
return model.includes('sonnet') && !model.startsWith('claude-3-5-sonnet');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user