mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-09 19:06:51 +08:00
feat: add jina embedding (#1647)
Co-authored-by: takatost <takatost@gmail.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import localai from './localai'
|
||||
import zhipuai from './zhipuai'
|
||||
import baichuan from './baichuan'
|
||||
import cohere from './cohere'
|
||||
import jina from './jina'
|
||||
|
||||
export default {
|
||||
openai,
|
||||
@@ -32,4 +33,5 @@ export default {
|
||||
zhipuai,
|
||||
baichuan,
|
||||
cohere,
|
||||
jina,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import { ProviderEnum } from '../declarations'
|
||||
import type { ProviderConfig } from '../declarations'
|
||||
import { Jina, JinaText } from '@/app/components/base/icons/src/public/llm'
|
||||
|
||||
const config: ProviderConfig = {
|
||||
selector: {
|
||||
name: {
|
||||
'en': 'Jina',
|
||||
'zh-Hans': 'Jina',
|
||||
},
|
||||
icon: <Jina className='w-full h-full' />,
|
||||
},
|
||||
item: {
|
||||
key: ProviderEnum.jina,
|
||||
titleIcon: {
|
||||
'en': <JinaText className='w-[58px] h-6' />,
|
||||
'zh-Hans': <JinaText className='w-[58px] h-6' />,
|
||||
},
|
||||
hit: {
|
||||
'en': 'Embedding Model Supported',
|
||||
'zh-Hans': '支持 Embedding 模型',
|
||||
},
|
||||
},
|
||||
modal: {
|
||||
key: ProviderEnum.jina,
|
||||
title: {
|
||||
'en': 'Embedding Model',
|
||||
'zh-Hans': 'Embedding 模型',
|
||||
},
|
||||
icon: <Jina className='w-6 h-6' />,
|
||||
link: {
|
||||
href: 'https://jina.ai/embeddings/',
|
||||
label: {
|
||||
'en': 'Get your API key from Jina',
|
||||
'zh-Hans': '从 Jina 获取 API Key',
|
||||
},
|
||||
},
|
||||
validateKeys: ['api_key'],
|
||||
fields: [
|
||||
{
|
||||
type: 'text',
|
||||
key: 'api_key',
|
||||
required: true,
|
||||
label: {
|
||||
'en': 'API Key',
|
||||
'zh-Hans': 'API Key',
|
||||
},
|
||||
placeholder: {
|
||||
'en': 'Enter your API key here',
|
||||
'zh-Hans': '在此输入您的 API Key',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
export default config
|
||||
@@ -46,6 +46,7 @@ export enum ProviderEnum {
|
||||
'zhipuai' = 'zhipuai',
|
||||
'baichuan' = 'baichuan',
|
||||
'cohere' = 'cohere',
|
||||
'jina' = 'jina',
|
||||
}
|
||||
|
||||
export type ProviderConfigItem = {
|
||||
|
||||
@@ -71,6 +71,7 @@ const ModelPage = () => {
|
||||
config.minimax,
|
||||
config.tongyi,
|
||||
config.wenxin,
|
||||
config.jina,
|
||||
config.chatglm,
|
||||
config.xinference,
|
||||
config.openllm,
|
||||
@@ -89,6 +90,7 @@ const ModelPage = () => {
|
||||
config.replicate,
|
||||
config.tongyi,
|
||||
config.wenxin,
|
||||
config.jina,
|
||||
config.chatglm,
|
||||
config.xinference,
|
||||
config.openllm,
|
||||
|
||||
Reference in New Issue
Block a user