Skip to content

Commit

Permalink
feat: use date fixed model name (#8621)
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Oct 29, 2024
1 parent 835fdc3 commit efee4df
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 44 deletions.
12 changes: 7 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
86 changes: 49 additions & 37 deletions packages/backend/server/src/plugins/copilot/prompt/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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: [
{
Expand All @@ -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,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -332,7 +332,7 @@ const actions: Prompt[] = [
{
name: 'Summary',
action: 'Summary',
model: 'gpt-4o',
model: 'gpt-4o-2024-08-06',
messages: [
{
role: 'system',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -411,7 +411,7 @@ const actions: Prompt[] = [
{
name: 'Translate to',
action: 'Translate',
model: 'gpt-4o',
model: 'gpt-4o-2024-08-06',
messages: [
{
role: 'system',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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];
Expand Down
Loading

0 comments on commit efee4df

Please sign in to comment.