feat: add jina embedding (#1647)

Co-authored-by: takatost <takatost@gmail.com>
This commit is contained in:
zxhlyh
2023-11-29 14:58:11 +08:00
committed by GitHub
parent 454577c6b1
commit 451af66be0
22 changed files with 662 additions and 4 deletions

View File

@@ -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,
}

View File

@@ -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

View File

@@ -46,6 +46,7 @@ export enum ProviderEnum {
'zhipuai' = 'zhipuai',
'baichuan' = 'baichuan',
'cohere' = 'cohere',
'jina' = 'jina',
}
export type ProviderConfigItem = {

View File

@@ -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,