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

🐛 fix: Partial repair Doubao provider #6046

Closed
wants to merge 6 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ import ProviderDetail from '../[id]';
const providerKey = ModelProvider.Doubao;

const useProviderCard = (): ProviderItem => {

// Get the first model card's deployment name as the check model
const checkModel = useUserStore((s) => {
const chatModelCards = modelProviderSelectors.getModelCardsById(providerKey)(s);

if (chatModelCards.length > 0) {
return chatModelCards[0].deploymentName;
return chatModelCards[0].id.split('->')[1];
}

return 'Doubao-lite-4k';
return 'no-model';
});
return {
...DoubaoProviderCard,
Expand All @@ -32,9 +31,9 @@ const useProviderCard = (): ProviderItem => {
};

const Page = () => {
const card = useProviderCard();
return <ProviderDetail {...card} />;
};
export default Page;
const card = useProviderCard();

return <ProviderDetail {...card} />;
};

export default Page;
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ const ModelConfigModal = memo<ModelConfigModalProps>(({ open, setOpen }) => {
>
<ModelConfigForm
onFormInstanceReady={setFormInstance}
showAzureDeployName={editingProvider === ModelProvider.Azure}
showAzureDeployName={
editingProvider === ModelProvider.Azure || editingProvider === ModelProvider.Doubao
}
/>
</Modal>
);
Expand Down
105 changes: 48 additions & 57 deletions src/config/aiModels/doubao.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,54 @@
import { AIChatModelCard } from '@/types/aiModel';

const doubaoChatModels: AIChatModelCard[] = [
{
contextWindowTokens: 4096,
description:
'拥有极致的响应速度,更好的性价比,为客户不同场景提供更灵活的选择。支持 4k 上下文窗口的推理和精调。',
displayName: 'Doubao Lite 4k',
enabled: true,
id: 'Doubao-lite-4k',
type: 'chat',
},
{
contextWindowTokens: 32_768,
description:
'拥有极致的响应速度,更好的性价比,为客户不同场景提供更灵活的选择。支持 32k 上下文窗口的推理和精调。',
displayName: 'Doubao Lite 32k',
enabled: true,
id: 'Doubao-lite-32k',
type: 'chat',
},
{
contextWindowTokens: 128_000,
description:
'拥有极致的响应速度,更好的性价比,为客户不同场景提供更灵活的选择。支持 128k 上下文窗口的推理和精调。',
displayName: 'Doubao Lite 128k',
enabled: true,
id: 'Doubao-lite-128k',
type: 'chat',
},
{
contextWindowTokens: 4096,
description:
'效果最好的主力模型,适合处理复杂任务,在参考问答、总结摘要、创作、文本分类、角色扮演等场景都有很好的效果。支持 4k 上下文窗口的推理和精调。',
displayName: 'Doubao Pro 4k',
enabled: true,
id: 'Doubao-pro-4k',
type: 'chat',
},
{
config: {
deploymentName: 'Doubao-pro-test',
},
contextWindowTokens: 32_768,
description:
'效果最好的主力模型,适合处理复杂任务,在参考问答、总结摘要、创作、文本分类、角色扮演等场景都有很好的效果。支持 32k 上下文窗口的推理和精调。',
displayName: 'Doubao Pro 32k',
enabled: true,
id: 'Doubao-pro-32k',
type: 'chat',
},
{
contextWindowTokens: 128_000,
description:
'效果最好的主力模型,适合处理复杂任务,在参考问答、总结摘要、创作、文本分类、角色扮演等场景都有很好的效果。支持 128k 上下文窗口的推理和精调。',
displayName: 'Doubao Pro 128k',
enabled: true,
id: 'Doubao-pro-128k',
type: 'chat',
},
// {
// contextWindowTokens: 4096,
// description:
// '拥有极致的响应速度,更好的性价比,为客户不同场景提供更灵活的选择。支持 4k 上下文窗口的推理和精调。',
// displayName: 'Doubao Lite 4k',
// id: 'Doubao-lite-4k',
// type: 'chat',
// },
// {
// contextWindowTokens: 32_768,
// description:
// '拥有极致的响应速度,更好的性价比,为客户不同场景提供更灵活的选择。支持 32k 上下文窗口的推理和精调。',
// displayName: 'Doubao Lite 32k',
// id: 'Doubao-lite-32k',
// type: 'chat',
// },
// {
// contextWindowTokens: 128_000,
// description:
// '拥有极致的响应速度,更好的性价比,为客户不同场景提供更灵活的选择。支持 128k 上下文窗口的推理和精调。',
// displayName: 'Doubao Lite 128k',
// id: 'Doubao-lite-128k',
// type: 'chat',
// },
// {
// contextWindowTokens: 4096,
// description:
// '效果最好的主力模型,适合处理复杂任务,在参考问答、总结摘要、创作、文本分类、角色扮演等场景都有很好的效果。支持 4k 上下文窗口的推理和精调。',
// displayName: 'Doubao Pro 4k',
// id: 'Doubao-pro-4k',
// type: 'chat',
// },
// {
// contextWindowTokens: 32_768,
// description:
// '效果最好的主力模型,适合处理复杂任务,在参考问答、总结摘要、创作、文本分类、角色扮演等场景都有很好的效果。支持 32k 上下文窗口的推理和精调。',
// displayName: 'Doubao Pro 32k',
// id: 'Doubao-pro-32k',
// type: 'chat',
// },
// {
// contextWindowTokens: 128_000,
// description:
// '效果最好的主力模型,适合处理复杂任务,在参考问答、总结摘要、创作、文本分类、角色扮演等场景都有很好的效果。支持 128k 上下文窗口的推理和精调。',
// displayName: 'Doubao Pro 128k',
// id: 'Doubao-pro-128k',
// type: 'chat',
// },
];

export const allModels = [...doubaoChatModels];
Expand Down