There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
feat: use date fixed model name (#8621)
darkskygitefee4dfd669e
diff --git a/Cargo.lock b/Cargo.lockindex c5138b198f..72369224de 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -475,12 +475,13 @@ dependencies = [[[package]]name = "fancy-regex"-version = "0.12.0"+version = "0.13.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "7493d4c459da9f84325ad297371a6b2b8a162800873a22e3b6b6512e61d18c05"+checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2"dependencies = ["bit-set",- "regex",+ "regex-automata 0.4.7",+ "regex-syntax 0.8.4",][[package]]@@ -2011,9 +2012,9 @@ dependencies = [[[package]]name = "tiktoken-rs"-version = "0.5.9"+version = "0.6.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c314e7ce51440f9e8f5a497394682a57b7c323d0f4d0a6b1b13c429056e0e234"+checksum = "44075987ee2486402f0808505dd65692163d243a337fc54363d49afac41087f6"dependencies = ["anyhow","base64 0.21.7",@@ -2021,6 +2022,7 @@ dependencies = ["fancy-regex","lazy_static","parking_lot",+ "regex","rustc-hash",]diff --git a/Cargo.toml b/Cargo.tomlindex 3d4a873a7b..a211fe3fb8 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -19,7 +19,7 @@ serde = "1"serde_json = "1"sha3 = "0.10"sqlx = { version = "0.8", default-features = false, features = ["chrono", "macros", "migrate", "runtime-tokio", "sqlite", "tls-rustls"] }-tiktoken-rs = "0.5"+tiktoken-rs = "0.6"tokio = "1.37"uuid = "1.8"v_htmlescape = "0.15"diff --git a/packages/backend/server/src/plugins/copilot/prompt/prompts.ts b/packages/backend/server/src/plugins/copilot/prompt/prompts.tsindex d01d965026..0299aa382d 100644--- a/packages/backend/server/src/plugins/copilot/prompt/prompts.ts+++ b/packages/backend/server/src/plugins/copilot/prompt/prompts.ts@@ -29,7 +29,7 @@ const workflows: Prompt[] = [{name: 'workflow:presentation:step1',action: 'workflow:presentation:step1',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',config: { temperature: 0.7 },messages: [{@@ -46,7 +46,7 @@ const workflows: Prompt[] = [{name: 'workflow:presentation:step2',action: 'workflow:presentation:step2',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -65,7 +65,7 @@ const workflows: Prompt[] = [{name: 'workflow:presentation:step4',action: 'workflow:presentation:step4',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -92,7 +92,7 @@ const workflows: Prompt[] = [{name: 'workflow:brainstorm:step1',action: 'workflow:brainstorm:step1',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',config: { temperature: 0.7 },messages: [{@@ -109,7 +109,7 @@ const workflows: Prompt[] = [{name: 'workflow:brainstorm:step2',action: 'workflow:brainstorm:step2',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',config: {frequencyPenalty: 0.5,presencePenalty: 0.5,@@ -142,7 +142,7 @@ const workflows: Prompt[] = [{name: 'workflow:image-sketch:step2',action: 'workflow:image-sketch:step2',- model: 'gpt-4o-mini',+ model: 'gpt-4o-mini-2024-07-18',messages: [{role: 'system',@@ -179,7 +179,7 @@ const workflows: Prompt[] = [{name: 'workflow:image-clay:step2',action: 'workflow:image-clay:step2',- model: 'gpt-4o-mini',+ model: 'gpt-4o-mini-2024-07-18',messages: [{role: 'system',@@ -216,7 +216,7 @@ const workflows: Prompt[] = [{name: 'workflow:image-anime:step2',action: 'workflow:image-anime:step2',- model: 'gpt-4o-mini',+ model: 'gpt-4o-mini-2024-07-18',messages: [{role: 'system',@@ -253,7 +253,7 @@ const workflows: Prompt[] = [{name: 'workflow:image-pixel:step2',action: 'workflow:image-pixel:step2',- model: 'gpt-4o-mini',+ model: 'gpt-4o-mini-2024-07-18',messages: [{role: 'system',@@ -320,7 +320,7 @@ const actions: Prompt[] = [{name: 'Generate a caption',action: 'Generate a caption',- model: 'gpt-4o-mini',+ model: 'gpt-4o-mini-2024-07-18',messages: [{role: 'user',@@ -332,7 +332,7 @@ const actions: Prompt[] = [{name: 'Summary',action: 'Summary',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -349,7 +349,7 @@ const actions: Prompt[] = [{name: 'Summary the webpage',action: 'Summary the webpage',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'user',@@ -361,7 +361,7 @@ const actions: Prompt[] = [{name: 'Explain this',action: 'Explain this',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -377,7 +377,7 @@ const actions: Prompt[] = [{name: 'Explain this image',action: 'Explain this image',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -394,7 +394,7 @@ const actions: Prompt[] = [{name: 'Explain this code',action: 'Explain this code',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -411,7 +411,7 @@ const actions: Prompt[] = [{name: 'Translate to',action: 'Translate',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -456,7 +456,7 @@ const actions: Prompt[] = [{name: 'Write an article about this',action: 'Write an article about this',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -484,7 +484,7 @@ Rules to follow:{name: 'Write a twitter about this',action: 'Write a twitter about this',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -501,7 +501,7 @@ Rules to follow:{name: 'Write a poem about this',action: 'Write a poem about this',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -518,7 +518,7 @@ Rules to follow:{name: 'Write a blog post about this',action: 'Write a blog post about this',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -534,7 +534,7 @@ Rules to follow:{name: 'Write outline',action: 'Write outline',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -551,7 +551,7 @@ Rules to follow:{name: 'Change tone to',action: 'Change tone',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -586,7 +586,7 @@ Rules to follow:{name: 'Brainstorm ideas about this',action: 'Brainstorm ideas about this',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -612,7 +612,7 @@ Rules to follow:{name: 'Brainstorm mindmap',action: 'Brainstorm mindmap',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -629,7 +629,7 @@ Rules to follow:{name: 'Expand mind map',action: 'Expand mind map',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -650,7 +650,7 @@ Rules to follow:{name: 'Improve writing for it',action: 'Improve writing for it',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -666,7 +666,7 @@ Rules to follow:{name: 'Improve grammar for it',action: 'Improve grammar for it',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -682,7 +682,7 @@ Rules to follow:{name: 'Fix spelling for it',action: 'Fix spelling for it',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -698,7 +698,7 @@ Rules to follow:{name: 'Find action items from it',action: 'Find action items from it',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -722,7 +722,7 @@ If there are items in the content that can be used as to-do tasks, please refer{name: 'Check code error',action: 'Check code error',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -739,7 +739,7 @@ If there are items in the content that can be used as to-do tasks, please refer{name: 'Create a presentation',action: 'Create a presentation',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -756,7 +756,7 @@ If there are items in the content that can be used as to-do tasks, please refer{name: 'Create headings',action: 'Create headings',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -772,7 +772,7 @@ If there are items in the content that can be used as to-do tasks, please refer{name: 'Make it real',action: 'Make it real',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -813,7 +813,7 @@ When sent new wireframes, respond ONLY with the contents of the html file.`,{name: 'Make it real with text',action: 'Make it real with text',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -848,7 +848,7 @@ When sent new notes, respond ONLY with the contents of the html file.`,{name: 'Make it longer',action: 'Make it longer',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -876,7 +876,7 @@ Output: Generate a new version of the provided content that is longer in length{name: 'Make it shorter',action: 'Make it shorter',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -903,7 +903,7 @@ Finally, you should present the final, shortened content as your response. Make{name: 'Continue writing',action: 'Continue writing',- model: 'gpt-4o',+ model: 'gpt-4o-2024-08-06',messages: [{role: 'system',@@ -952,6 +952,18 @@ const chat: Prompt[] = [},],},+ // use for believer plan+ {+ name: 'Chat With AFFiNE AI - Believer',+ model: 'gpt-o1',+ messages: [+ {+ role: 'system',+ content:+ "You are AFFiNE AI, a professional and humorous copilot within AFFiNE. You are powered by latest GPT model from OpenAI and AFFiNE. AFFiNE is an open source general purposed productivity tool that contains unified building blocks that users can use on any interfaces, including block-based docs editor, infinite canvas based edgeless graphic mode, or multi-dimensional table with multiple transformable views. Your mission is always to try your very best to assist users to use AFFiNE to write docs, draw diagrams or plan things with these abilities. You always think step-by-step and describe your plan for what to build, using well-structured and clear markdown, written out in great detail. Unless otherwise specified, where list, JSON, or code blocks are required for giving the output. Minimize any other prose so that your responses can be directly used and inserted into the docs. You are able to access to API of AFFiNE to finish your job. You always respect the users' privacy and would not leak their info to anyone else. AFFiNE is made by Toeverything .Pte .Ltd, a company registered in Singapore with a diverse and international team. The company also open sourced blocksuite and octobase for building tools similar to Affine. The name AFFiNE comes from the idea of AFFiNE transform, as blocks in affine can all transform in page, edgeless or database mode. AFFiNE team is now having 25 members, an open source company driven by engineers.",+ },+ ],+ },];export const prompts: Prompt[] = [...actions, ...chat, ...workflows];diff --git a/packages/backend/server/src/plugins/copilot/providers/openai.ts b/packages/backend/server/src/plugins/copilot/providers/openai.tsindex a71c0f7c31..72500921bf 100644--- a/packages/backend/server/src/plugins/copilot/providers/openai.ts+++ b/packages/backend/server/src/plugins/copilot/providers/openai.ts@@ -43,7 +43,9 @@ export class OpenAIProviderreadonly availableModels = [// text to text'gpt-4o',+ 'gpt-4o-2024-08-06','gpt-4o-mini',+ 'gpt-4o-mini-2024-07-18',// embeddings'text-embedding-3-large','text-embedding-3-small',diff --git a/packages/backend/server/src/plugins/copilot/types.ts b/packages/backend/server/src/plugins/copilot/types.tsindex 0c9c5b94ce..679377f16a 100644--- a/packages/backend/server/src/plugins/copilot/types.ts+++ b/packages/backend/server/src/plugins/copilot/types.ts@@ -8,7 +8,9 @@ import type { ChatPrompt } from './prompt';export enum AvailableModels {// text to textGpt4Omni = 'gpt-4o',+ Gpt4Omni0806 = 'gpt-4o-2024-08-06',Gpt4OmniMini = 'gpt-4o-mini',+ Gpt4OmniMini0718 = 'gpt-4o-mini-2024-07-18',// embeddingsTextEmbedding3Large = 'text-embedding-3-large',TextEmbedding3Small = 'text-embedding-3-small',diff --git a/packages/backend/server/src/schema.gql b/packages/backend/server/src/schema.gqlindex 88234d6839..5d129eb89e 100644--- a/packages/backend/server/src/schema.gql+++ b/packages/backend/server/src/schema.gql@@ -56,7 +56,9 @@ type CopilotMessageNotFoundDataType {enum CopilotModels {DallE3Gpt4Omni+ Gpt4Omni0806Gpt4OmniMini+ Gpt4OmniMini0718TextEmbedding3LargeTextEmbedding3SmallTextEmbeddingAda002diff --git a/packages/backend/server/tests/copilot.spec.ts b/packages/backend/server/tests/copilot.spec.tsindex 6d999ded9c..1d02b7b628 100644--- a/packages/backend/server/tests/copilot.spec.ts+++ b/packages/backend/server/tests/copilot.spec.ts@@ -669,7 +669,7 @@ test('should be able to get provider', async t => {{const p = await provider.getProviderByCapability(CopilotCapability.ImageToText,- 'gpt-4o'+ 'gpt-4o-2024-08-06');t.is(p?.type.toString(),diff --git a/packages/backend/server/tests/utils/copilot.ts b/packages/backend/server/tests/utils/copilot.tsindex 4b1f7e4783..ea85b451e2 100644--- a/packages/backend/server/tests/utils/copilot.ts+++ b/packages/backend/server/tests/utils/copilot.ts@@ -43,6 +43,7 @@ export class MockCopilotTestProvideroverride readonly availableModels = ['test','gpt-4o',+ 'gpt-4o-2024-08-06','fast-sdxl/image-to-image','lcm-sd15-i2i','clarity-upscaler',