mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 05:09:09 +08:00
feat: add jina provider
This commit is contained in:
parent
5d2efbd62b
commit
dc1dbc7bb6
@ -152,7 +152,7 @@ export const VISION_REGEX = new RegExp(
|
|||||||
)
|
)
|
||||||
|
|
||||||
export const TEXT_TO_IMAGE_REGEX = /flux|diffusion|stabilityai|sd-|dall|cogview/i
|
export const TEXT_TO_IMAGE_REGEX = /flux|diffusion|stabilityai|sd-|dall|cogview/i
|
||||||
export const EMBEDDING_REGEX = /(?:^text-|embed|rerank|davinci|babbage|bge-|e5-|LLM2Vec|retrieval|uae-|gte-)/i
|
export const EMBEDDING_REGEX = /(?:^text-|embed|rerank|davinci|babbage|bge-|e5-|LLM2Vec|retrieval|uae-|gte-|jina)/i
|
||||||
export const NOT_SUPPORTED_REGEX = /(?:^tts|rerank|whisper|speech)/i
|
export const NOT_SUPPORTED_REGEX = /(?:^tts|rerank|whisper|speech)/i
|
||||||
|
|
||||||
export function getModelLogo(modelId: string) {
|
export function getModelLogo(modelId: string) {
|
||||||
@ -700,7 +700,56 @@ export const SYSTEM_MODELS: Record<string, Model[]> = {
|
|||||||
group: 'Mistral'
|
group: 'Mistral'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
jina: [],
|
jina: [
|
||||||
|
{
|
||||||
|
id: 'jina-clip-v1',
|
||||||
|
provider: 'jina',
|
||||||
|
name: 'jina-clip-v1',
|
||||||
|
group: 'Jina Clip'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'jina-clip-v2',
|
||||||
|
provider: 'jina',
|
||||||
|
name: 'jina-clip-v2',
|
||||||
|
group: 'Jina Clip'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'jina-embeddings-v2-base-en',
|
||||||
|
provider: 'jina',
|
||||||
|
name: 'jina-embeddings-v2-base-en',
|
||||||
|
group: 'Jina Embeddings V2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'jina-embeddings-v2-base-es',
|
||||||
|
provider: 'jina',
|
||||||
|
name: 'jina-embeddings-v2-base-es',
|
||||||
|
group: 'Jina Embeddings V2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'jina-embeddings-v2-base-de',
|
||||||
|
provider: 'jina',
|
||||||
|
name: 'jina-embeddings-v2-base-de',
|
||||||
|
group: 'Jina Embeddings V2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'jina-embeddings-v2-base-zh',
|
||||||
|
provider: 'jina',
|
||||||
|
name: 'jina-embeddings-v2-base-zh',
|
||||||
|
group: 'Jina Embeddings V2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'jina-embeddings-v2-base-code',
|
||||||
|
provider: 'jina',
|
||||||
|
name: 'jina-embeddings-v2-base-code',
|
||||||
|
group: 'Jina Embeddings V2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'jina-embeddings-v3',
|
||||||
|
provider: 'jina',
|
||||||
|
name: 'jina-embeddings-v3',
|
||||||
|
group: 'Jina Embeddings V3'
|
||||||
|
}
|
||||||
|
],
|
||||||
aihubmix: [
|
aihubmix: [
|
||||||
{
|
{
|
||||||
id: 'gpt-4o-mini',
|
id: 'gpt-4o-mini',
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export default class OpenAIProvider extends BaseProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private get isNotSupportFiles() {
|
private get isNotSupportFiles() {
|
||||||
const providers = ['deepseek', 'baichuan', 'minimax', 'doubao']
|
const providers = ['deepseek', 'baichuan', 'minimax']
|
||||||
return providers.includes(this.provider.id)
|
return providers.includes(this.provider.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ const persistedReducer = persistReducer(
|
|||||||
{
|
{
|
||||||
key: 'cherry-studio',
|
key: 'cherry-studio',
|
||||||
storage,
|
storage,
|
||||||
version: 49,
|
version: 50,
|
||||||
blacklist: ['runtime'],
|
blacklist: ['runtime'],
|
||||||
migrate
|
migrate
|
||||||
},
|
},
|
||||||
|
|||||||
@ -304,15 +304,16 @@ const initialState: LlmState = {
|
|||||||
isSystem: true,
|
isSystem: true,
|
||||||
enabled: false
|
enabled: false
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// id: 'jina',
|
id: 'jina',
|
||||||
// name: 'Jina',
|
name: 'Jina',
|
||||||
// apiKey: '',
|
type: 'openai',
|
||||||
// apiHost: 'https://api.jina.ai',
|
apiKey: '',
|
||||||
// models: SYSTEM_MODELS.jina,
|
apiHost: 'https://api.jina.ai',
|
||||||
// isSystem: true,
|
models: SYSTEM_MODELS.jina,
|
||||||
// enabled: false
|
isSystem: true,
|
||||||
// },
|
enabled: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'aihubmix',
|
id: 'aihubmix',
|
||||||
name: 'AiHubMix',
|
name: 'AiHubMix',
|
||||||
|
|||||||
@ -659,15 +659,6 @@ const migrateConfig = {
|
|||||||
isSystem: true,
|
isSystem: true,
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
// {
|
|
||||||
// id: 'jina',
|
|
||||||
// name: 'Jina',
|
|
||||||
// apiKey: '',
|
|
||||||
// apiHost: 'https://api.jina.ai',
|
|
||||||
// models: SYSTEM_MODELS.jina,
|
|
||||||
// isSystem: true,
|
|
||||||
// enabled: false
|
|
||||||
// }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -767,6 +758,19 @@ const migrateConfig = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
return state
|
return state
|
||||||
|
},
|
||||||
|
'50': (state: RootState) => {
|
||||||
|
state.llm.providers.push({
|
||||||
|
id: 'jina',
|
||||||
|
name: 'Jina',
|
||||||
|
type: 'openai',
|
||||||
|
apiKey: '',
|
||||||
|
apiHost: 'https://api.jina.ai',
|
||||||
|
models: SYSTEM_MODELS.jina,
|
||||||
|
isSystem: true,
|
||||||
|
enabled: false
|
||||||
|
})
|
||||||
|
return state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user