Skip to content

Commit

Permalink
💄 style: add support function call for 360AI (lobehub#4099)
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhijie0327 authored Sep 24, 2024
1 parent db1f81c commit 536696b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config/modelProviders/ai360.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const Ai360: ModelProviderCard = {
'360GPT2 Pro 是 360 公司推出的高级自然语言处理模型,具备卓越的文本生成和理解能力,尤其在生成与创作领域表现出色,能够处理复杂的语言转换和角色演绎任务。',
displayName: '360GPT2 Pro',
enabled: true,
functionCall: false,
id: '360gpt2-pro',
maxOutput: 7000,
pricing: {
Expand All @@ -22,6 +21,8 @@ const Ai360: ModelProviderCard = {
description:
'360GPT Pro 作为 360 AI 模型系列的重要成员,以高效的文本处理能力满足多样化的自然语言应用场景,支持长文本理解和多轮对话等功能。',
displayName: '360GPT Pro',
enabled: true,
functionCall: true,
id: '360gpt-pro',
maxOutput: 7000,
pricing: {
Expand Down
8 changes: 8 additions & 0 deletions src/libs/agent-runtime/ai360/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory';

export const LobeAi360AI = LobeOpenAICompatibleFactory({
baseURL: 'https://ai.360.cn/v1',
chatCompletion: {
handlePayload: (payload) => {
return {
...payload,
stream: !payload.tools,
} as any;
},
},
debug: {
chatCompletion: () => process.env.DEBUG_AI360_CHAT_COMPLETION === '1',
},
Expand Down

0 comments on commit 536696b

Please sign in to comment.