feat(core): use the same prompt for Search With AFFiNE AI (#12496)

Support [AI-59](https://linear.app/affine-design/issue/AI-59)

Deprecated use of the perplexity model. Makes chat and search use the same prompt content.

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

- **New Features**
  - Added support for two new AI models: Claude Opus 4 and Claude Sonnet 4, enabling enhanced text and image input capabilities.
  - Introduced a new chat prompt with detailed instructions for specialized AI interactions within AFFiNE.

- **Refactor**
  - Improved prompt management for AI chat and search features by centralizing shared settings for better consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
akumatus
2025-05-26 10:20:19 +00:00
committed by Yue Wu
parent 5fcdad46eb
commit 8b76644fc1
3 changed files with 56 additions and 33 deletions
@@ -15,13 +15,30 @@ export class AnthropicOfficialProvider extends AnthropicProvider<AnthropicOffici
override readonly type = CopilotProviderType.Anthropic;
override readonly models = [
{
id: 'claude-opus-4-20250514',
capabilities: [
{
input: [ModelInputType.Text, ModelInputType.Image],
output: [ModelOutputType.Text],
},
],
},
{
id: 'claude-sonnet-4-20250514',
capabilities: [
{
input: [ModelInputType.Text, ModelInputType.Image],
output: [ModelOutputType.Text],
},
],
},
{
id: 'claude-3-7-sonnet-20250219',
capabilities: [
{
input: [ModelInputType.Text, ModelInputType.Image],
output: [ModelOutputType.Text],
defaultForOutputType: true,
},
],
},
@@ -31,6 +48,7 @@ export class AnthropicOfficialProvider extends AnthropicProvider<AnthropicOffici
{
input: [ModelInputType.Text, ModelInputType.Image],
output: [ModelOutputType.Text],
defaultForOutputType: true,
},
],
},
@@ -41,7 +41,7 @@ export class AnthropicVertexProvider extends AnthropicProvider<AnthropicVertexCo
],
},
{
id: 'claude-3-5-sonnet@20240620',
id: 'claude-3-5-sonnet-v2@20241022',
capabilities: [
{
input: [ModelInputType.Text, ModelInputType.Image],