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:
akumatus
2025-06-03 06:32:27 +00:00
parent a88dcc0951
commit cce756365a
7 changed files with 55 additions and 44 deletions

View File

@@ -82,7 +82,7 @@ export function setupAIProvider(
//#region actions
AIProvider.provide('chat', async options => {
const { input, contexts, webSearch, reasoning } = options;
const { input, contexts, webSearch } = options;
const sessionId = await createSession({
promptName: 'Chat With AFFiNE AI',
@@ -90,7 +90,7 @@ export function setupAIProvider(
});
return textToText({
...options,
modelId: options.modelId ?? (reasoning ? 'o4-mini' : undefined),
modelId: options.modelId,
client,
sessionId,
content: input,