feat: support Ollama (#168)

This commit is contained in:
Buer
2024-04-24 16:59:58 +08:00
committed by GitHub
parent b9c9035f2a
commit 763c8883da
14 changed files with 481 additions and 29 deletions

View File

@@ -144,27 +144,34 @@ export const CHANNEL_OPTIONS = {
text: 'Cloudflare AI',
value: 35,
color: 'orange',
url: ''
url: 'https://ai.cloudflare.com/'
},
36: {
key: 36,
text: 'Cohere',
value: 36,
color: 'default',
url: ''
url: 'https://cohere.com/'
},
37: {
key: 37,
text: 'Stability AI',
value: 37,
color: 'default',
url: ''
url: 'https://platform.stability.ai/account/credits'
},
38: {
key: 38,
text: 'Coze',
value: 38,
color: 'primary',
url: 'https://www.coze.com/open/docs/chat?_lang=zh'
},
39: {
key: 39,
text: 'Ollama',
value: 39,
color: 'orange',
url: ''
},
24: {

View File

@@ -636,6 +636,7 @@ const EditModal = ({ open, channelId, onCancel, onOk, groupOptions }) => {
<>
<Divider sx={{ ...theme.typography.otherInput }} />
<Typography variant="h3">{plugin.name}</Typography>
<Typography variant="caption">{plugin.description}</Typography>
{Object.keys(plugin.params).map((paramId) => {
const param = plugin.params[paramId];
const name = `plugin.${pluginId}.${paramId}`;

View File

@@ -315,6 +315,15 @@ const typeConfig = {
'模型名称映射, 你可以取一个容易记忆的名字来代替coze-{bot_id},例如:{"coze-translate": "coze-xxxxx"},注意如果使用了模型映射那么上面的模型名称必须使用映射前的名称上述例子中你应该在模型中填入coze-translate(如果已经使用了coze-*,可以忽略)。'
},
modelGroup: 'Coze'
},
39: {
input: {
models: ['phi3', 'llama3']
},
prompt: {
base_url: '请输入你部署的Ollama地址例如http://127.0.0.1:11434如果你使用了cloudflare Zero Trust可以在下方插件填入授权信息',
key: '请随意填写'
}
}
};

View File

@@ -88,5 +88,25 @@
}
}
}
},
"39": {
"headers": {
"name": "Header 配置",
"description": "本配置主要是用于使用cloudflare Zero Trust将端口暴露到公网时需要配置的header",
"params": {
"CF-Access-Client-Id": {
"name": "CF-Access-Client-Id",
"description": "CF-Access-Client-Id",
"type": "string",
"required": true
},
"CF-Access-Client-Secret": {
"name": "CF-Access-Client-Secret",
"description": "CF-Access-Client-Secret",
"type": "string",
"required": true
}
}
}
}
}