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:
@@ -1086,14 +1086,14 @@ Finally, please only send us the content of your continuation in Markdown Format
|
||||
},
|
||||
];
|
||||
|
||||
const chat: Prompt[] = [
|
||||
{
|
||||
name: 'Chat With AFFiNE AI',
|
||||
const CHAT_PROMPT: Omit<Prompt, 'name'> = {
|
||||
model: 'gpt-4.1',
|
||||
optionalModels: [
|
||||
'gpt-4.1',
|
||||
'o3',
|
||||
'o4-mini',
|
||||
'claude-opus-4-20250514',
|
||||
'claude-sonnet-4-20250514',
|
||||
'claude-3-7-sonnet-20250219',
|
||||
'claude-3-5-sonnet-20241022',
|
||||
'gemini-2.5-flash-preview-05-20',
|
||||
@@ -1101,7 +1101,7 @@ const chat: Prompt[] = [
|
||||
'claude-opus-4@20250514',
|
||||
'claude-sonnet-4@20250514',
|
||||
'claude-3-7-sonnet@20250219',
|
||||
'claude-3-5-sonnet@20240620',
|
||||
'claude-3-5-sonnet-v2@20241022',
|
||||
],
|
||||
messages: [
|
||||
{
|
||||
@@ -1234,11 +1234,16 @@ Below is the user's query. Please respond in the user's preferred language witho
|
||||
config: {
|
||||
tools: ['webSearch'],
|
||||
},
|
||||
};
|
||||
|
||||
const chat: Prompt[] = [
|
||||
{
|
||||
name: 'Chat With AFFiNE AI',
|
||||
...CHAT_PROMPT,
|
||||
},
|
||||
{
|
||||
name: 'Search With AFFiNE AI',
|
||||
model: 'sonar-reasoning-pro',
|
||||
messages: [],
|
||||
...CHAT_PROMPT,
|
||||
},
|
||||
// use for believer plan
|
||||
{
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user