Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💄 style: add function call support for Stepfun #4101

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/config/modelProviders/stepfun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,54 @@ const Stepfun: ModelProviderCard = {
description: '支持大规模上下文交互,适合复杂对话场景。',
displayName: 'Step 2 16K',
enabled: true,
functionCall: true,
id: 'step-2-16k',
tokens: 16_000,
},
{
description: '具备超长上下文处理能力,尤其适合长文档分析。',
displayName: 'Step 1 256K',
functionCall: true,
id: 'step-1-256k',
tokens: 256_000,
},
{
description: '平衡性能与成本,适合一般场景。',
displayName: 'Step 1 128K',
enabled: true,
functionCall: true,
id: 'step-1-128k',
tokens: 128_000,
},
{
description: '支持中等长度的对话,适用于多种应用场景。',
displayName: 'Step 1 32K',
enabled: true,
functionCall: true,
id: 'step-1-32k',
tokens: 32_000,
},
{
description: '小型模型,适合轻量级任务。',
displayName: 'Step 1 8K',
enabled: true,
functionCall: true,
id: 'step-1-8k',
tokens: 8000,
},
{
description: '高速模型,适合实时对话。',
displayName: 'Step 1 Flash',
enabled: true,
functionCall: true,
id: 'step-1-flash',
tokens: 8000,
},
{
description: '支持视觉输入,增强多模态交互体验。',
displayName: 'Step 1V 32K',
enabled: true,
functionCall: true,
id: 'step-1v-32k',
tokens: 32_000,
vision: true,
Expand All @@ -57,6 +64,7 @@ const Stepfun: ModelProviderCard = {
description: '小型视觉模型,适合基本的图文任务。',
displayName: 'Step 1V 8K',
enabled: true,
functionCall: true,
id: 'step-1v-8k',
tokens: 8000,
vision: true,
Expand Down
8 changes: 8 additions & 0 deletions src/libs/agent-runtime/stepfun/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 LobeStepfunAI = LobeOpenAICompatibleFactory({
baseURL: 'https://api.stepfun.com/v1',
chatCompletion: {
handlePayload: (payload) => {
return {
...payload,
stream: !payload.tools,
} as any;
},
},
debug: {
chatCompletion: () => process.env.DEBUG_STEPFUN_CHAT_COMPLETION === '1',
},
Expand Down
Loading