Skip to content

Commit

Permalink
support bytedance api start with "bot-" (with internet ability)
Browse files Browse the repository at this point in the history
  • Loading branch information
bestsanmao committed Feb 14, 2025
1 parent c15dbf5 commit e2429d4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/client/platforms/bytedance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class DoubaoApi implements LLMApi {
options.onController?.(controller);

try {
const chatPath = this.path(ByteDance.ChatPath);
const chatPath = this.path(ByteDance.ChatPath(modelConfig.model));
const chatPayload = {
method: "POST",
body: JSON.stringify(requestPayload),
Expand Down
6 changes: 5 additions & 1 deletion app/components/emoji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ export function Avatar(props: { model?: ModelType; avatar?: string }) {
LlmIcon = BotIconGrok;
} else if (modelName.startsWith("hunyuan")) {
LlmIcon = BotIconHunyuan;
} else if (modelName.startsWith("doubao") || modelName.startsWith("ep-")) {
} else if (
modelName.startsWith("doubao") ||
modelName.startsWith("ep-") ||
modelName.startsWith("bot-")
) {
LlmIcon = BotIconDoubao;
} else if (
modelName.toLowerCase().includes("glm") ||
Expand Down
8 changes: 7 additions & 1 deletion app/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,13 @@ export const Baidu = {

export const ByteDance = {
ExampleEndpoint: "https://ark.cn-beijing.volces.com/api/",
ChatPath: "api/v3/chat/completions",
ChatPath: (modelName: string) => {
if (modelName.startsWith("bot-")) {
return "api/v3/bots/chat/completions";
} else {
return "api/v3/chat/completions";
}
},
};

export const Alibaba = {
Expand Down
4 changes: 3 additions & 1 deletion app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ export function getTimeoutMSByModel(model: string) {
model.startsWith("o1") ||
model.startsWith("o3") ||
model.includes("deepseek-r") ||
model.includes("-thinking")
model.includes("-thinking") ||
model.startsWith("ep-") ||
model.startsWith("bot-")
)
return REQUEST_TIMEOUT_MS_FOR_THINKING;
return REQUEST_TIMEOUT_MS;
Expand Down

0 comments on commit e2429d4

Please sign in to comment.