feat(core): add o4-mini model (#12175)

Close [AI-85](https://linear.app/affine-design/issue/AI-85)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
	- Enhanced AI chat experience with improved web search integration, including a new "AUTO" mode that allows the AI to search the web only when needed.
	- Updated AI model for chat to "o4-mini" for improved performance.
- **Improvements**
	- Refined instructions to reduce hallucinations and ensure the AI admits uncertainty when unsure.
	- Enhanced streaming responses to display web search queries and results more clearly.
	- Updated web search tool modes for more accurate and flexible search behavior.
	- Centralized AI provider options and improved tool selection logic for better response quality.
- **Bug Fixes**
	- Improved handling of tool calls and reasoning steps in AI chat responses.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
akumatus
2025-05-07 13:36:41 +00:00
parent b4f56c0a78
commit 32db367298
7 changed files with 105 additions and 32 deletions

View File

@@ -893,7 +893,7 @@ __metadata:
"@affine/server-native": "workspace:*"
"@ai-sdk/anthropic": "npm:^1.2.10"
"@ai-sdk/google": "npm:^1.2.10"
"@ai-sdk/openai": "npm:^1.3.18"
"@ai-sdk/openai": "npm:^1.3.21"
"@ai-sdk/perplexity": "npm:^1.1.6"
"@apollo/server": "npm:^4.11.3"
"@aws-sdk/client-s3": "npm:^3.779.0"
@@ -1080,7 +1080,7 @@ __metadata:
languageName: node
linkType: hard
"@ai-sdk/openai@npm:^1.3.18":
"@ai-sdk/openai@npm:^1.3.21":
version: 1.3.21
resolution: "@ai-sdk/openai@npm:1.3.21"
dependencies: