mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 23:56:36 +08:00
chore: cleanup outdated model & upgrade model (#7739)
This commit is contained in:
@@ -278,18 +278,6 @@ const workflows: Prompt[] = [
|
||||
];
|
||||
|
||||
const actions: Prompt[] = [
|
||||
{
|
||||
name: 'debug:action:gpt4',
|
||||
action: 'text',
|
||||
model: 'gpt-4o',
|
||||
messages: [],
|
||||
},
|
||||
{
|
||||
name: 'debug:action:vision4',
|
||||
action: 'text',
|
||||
model: 'gpt-4o',
|
||||
messages: [],
|
||||
},
|
||||
{
|
||||
name: 'debug:action:dalle3',
|
||||
action: 'image',
|
||||
@@ -302,12 +290,6 @@ const actions: Prompt[] = [
|
||||
model: 'lcm-sd15-i2i',
|
||||
messages: [],
|
||||
},
|
||||
{
|
||||
name: 'debug:action:fal-sdturbo',
|
||||
action: 'image',
|
||||
model: 'fast-turbo-diffusion',
|
||||
messages: [],
|
||||
},
|
||||
{
|
||||
name: 'debug:action:fal-upscaler',
|
||||
action: 'Clearer',
|
||||
@@ -332,14 +314,14 @@ const actions: Prompt[] = [
|
||||
messages: [],
|
||||
},
|
||||
{
|
||||
name: 'debug:action:fal-summary-caption',
|
||||
name: 'Generate a caption',
|
||||
action: 'Generate a caption',
|
||||
model: 'llava-next',
|
||||
model: 'gpt-4o-mini',
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
content:
|
||||
'Please understand this image and generate a short caption. Limit it to 20 words. {{content}}',
|
||||
'Please understand this image and generate a short caption that can summarize the content of the image. Limit it to up 20 words. {{content}}',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -393,7 +375,7 @@ content: {{content}}`,
|
||||
{
|
||||
name: 'Explain this image',
|
||||
action: 'Explain this image',
|
||||
model: 'gpt-4-vision-preview',
|
||||
model: 'gpt-4o',
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
@@ -692,7 +674,7 @@ content: {{content}}`,
|
||||
{
|
||||
name: 'Make it real',
|
||||
action: 'Make it real',
|
||||
model: 'gpt-4-vision-preview',
|
||||
model: 'gpt-4o',
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
@@ -731,7 +713,7 @@ content: {{content}}`,
|
||||
{
|
||||
name: 'Make it real with text',
|
||||
action: 'Make it real with text',
|
||||
model: 'gpt-4-vision-preview',
|
||||
model: 'gpt-4o',
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
|
||||
@@ -43,9 +43,6 @@ export class OpenAIProvider
|
||||
// text to text
|
||||
'gpt-4o',
|
||||
'gpt-4o-mini',
|
||||
'gpt-4-vision-preview',
|
||||
'gpt-4-turbo-preview',
|
||||
'gpt-3.5-turbo',
|
||||
// embeddings
|
||||
'text-embedding-3-large',
|
||||
'text-embedding-3-small',
|
||||
@@ -203,7 +200,7 @@ export class OpenAIProvider
|
||||
// ====== text to text ======
|
||||
async generateText(
|
||||
messages: PromptMessage[],
|
||||
model: string = 'gpt-3.5-turbo',
|
||||
model: string = 'gpt-4o-mini',
|
||||
options: CopilotChatOptions = {}
|
||||
): Promise<string> {
|
||||
this.checkParams({ messages, model, options });
|
||||
@@ -232,7 +229,7 @@ export class OpenAIProvider
|
||||
|
||||
async *generateTextStream(
|
||||
messages: PromptMessage[],
|
||||
model: string = 'gpt-3.5-turbo',
|
||||
model: string = 'gpt-4o-mini',
|
||||
options: CopilotChatOptions = {}
|
||||
): AsyncIterable<string> {
|
||||
this.checkParams({ messages, model, options });
|
||||
|
||||
@@ -8,9 +8,7 @@ import type { ChatPrompt } from './prompt';
|
||||
export enum AvailableModels {
|
||||
// text to text
|
||||
Gpt4Omni = 'gpt-4o',
|
||||
Gpt4VisionPreview = 'gpt-4-vision-preview',
|
||||
Gpt4TurboPreview = 'gpt-4-turbo-preview',
|
||||
Gpt35Turbo = 'gpt-3.5-turbo',
|
||||
Gpt4OmniMini = 'gpt-4o-mini',
|
||||
// embeddings
|
||||
TextEmbedding3Large = 'text-embedding-3-large',
|
||||
TextEmbedding3Small = 'text-embedding-3-small',
|
||||
@@ -34,7 +32,8 @@ export function getTokenEncoder(model?: string | null): Tokenizer | null {
|
||||
// dalle don't need to calc the token
|
||||
return null;
|
||||
} else {
|
||||
return fromModelName('gpt-4-turbo-preview');
|
||||
// c100k based model
|
||||
return fromModelName('gpt-4');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,9 +52,7 @@ type CopilotMessageNotFoundDataType {
|
||||
enum CopilotModels {
|
||||
DallE3
|
||||
Gpt4Omni
|
||||
Gpt4TurboPreview
|
||||
Gpt4VisionPreview
|
||||
Gpt35Turbo
|
||||
Gpt4OmniMini
|
||||
TextEmbedding3Large
|
||||
TextEmbedding3Small
|
||||
TextEmbeddingAda002
|
||||
|
||||
@@ -91,7 +91,7 @@ export class MockCopilotTestProvider
|
||||
|
||||
override async *generateTextStream(
|
||||
messages: PromptMessage[],
|
||||
model: string = 'gpt-3.5-turbo',
|
||||
model: string = 'gpt-4o-mini',
|
||||
options: CopilotChatOptions = {}
|
||||
): AsyncIterable<string> {
|
||||
this.checkParams({ messages, model, options });
|
||||
|
||||
@@ -2,16 +2,14 @@
|
||||
// TODO(@Peng): automate this
|
||||
export const promptKeys = [
|
||||
'debug:chat:gpt4',
|
||||
'debug:action:gpt4',
|
||||
'debug:action:vision4',
|
||||
'debug:action:dalle3',
|
||||
'debug:action:fal-sd15',
|
||||
'debug:action:fal-upscaler',
|
||||
'debug:action:fal-remove-bg',
|
||||
'debug:action:fal-face-to-sticker',
|
||||
'debug:action:fal-summary-caption',
|
||||
'chat:gpt4',
|
||||
'Summary',
|
||||
'Generate a caption',
|
||||
'Summary the webpage',
|
||||
'Explain this',
|
||||
'Explain this image',
|
||||
|
||||
+1
-1
@@ -382,7 +382,7 @@ Could you make a new website based on these notes and send back just the html fi
|
||||
return textToText({
|
||||
...options,
|
||||
content: options.input,
|
||||
promptName: 'debug:action:fal-summary-caption',
|
||||
promptName: 'Generate a caption',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -95,9 +95,7 @@ export interface CopilotMessageNotFoundDataType {
|
||||
export enum CopilotModels {
|
||||
DallE3 = 'DallE3',
|
||||
Gpt4Omni = 'Gpt4Omni',
|
||||
Gpt4TurboPreview = 'Gpt4TurboPreview',
|
||||
Gpt4VisionPreview = 'Gpt4VisionPreview',
|
||||
Gpt35Turbo = 'Gpt35Turbo',
|
||||
Gpt4OmniMini = 'Gpt4OmniMini',
|
||||
TextEmbedding3Large = 'TextEmbedding3Large',
|
||||
TextEmbedding3Small = 'TextEmbedding3Small',
|
||||
TextEmbeddingAda002 = 'TextEmbeddingAda002',
|
||||
|
||||
Reference in New Issue
Block a user