Skip to content
Open
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
1 change: 1 addition & 0 deletions client-next/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
"cacheReadCost": "Cache Read Cost",
"cacheWriteCost": "Cache Write Cost",
"attachment": "Attachments",
"imageInput": "Vision (image input)",
"reasoning": "Reasoning",
"temperature": "Temperature",
"toolCall": "Tool Calls",
Expand Down
1 change: 1 addition & 0 deletions client-next/messages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
"cacheReadCost": "캐시 읽기 비용",
"cacheWriteCost": "캐시 쓰기 비용",
"attachment": "첨부 파일",
"imageInput": "비전(이미지 입력)",
"reasoning": "추론",
"temperature": "온도(Temperature)",
"toolCall": "도구 호출",
Expand Down
1 change: 1 addition & 0 deletions client-next/messages/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
"cacheReadCost": "\u7f13\u5b58\u8bfb\u53d6\u6210\u672c",
"cacheWriteCost": "\u7f13\u5b58\u5199\u5165\u6210\u672c",
"attachment": "\u9644\u4ef6",
"imageInput": "\u89c6\u89c9\uff08\u56fe\u50cf\u8f93\u5165\uff09",
"reasoning": "\u63a8\u7406",
"temperature": "\u6e29\u5ea6",
"toolCall": "\u5de5\u5177\u8c03\u7528",
Expand Down
43 changes: 40 additions & 3 deletions client-next/src/components/custom-provider-model-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface ModelDraft {
cacheReadCost: string;
cacheWriteCost: string;
attachment: boolean;
imageInput: boolean;
reasoning: boolean;
temperature: boolean;
toolCall: boolean;
Expand Down Expand Up @@ -65,6 +66,7 @@ function emptyModel(key = "model-id"): ModelDraft {
cacheReadCost: "",
cacheWriteCost: "",
attachment: false,
imageInput: false,
reasoning: false,
temperature: false,
toolCall: true,
Expand Down Expand Up @@ -112,7 +114,8 @@ function modelDraftsFromProvider(provider: ProviderConfig): ModelDraft[] {
outputCost: toNumberText(model.cost?.output),
cacheReadCost: toNumberText(model.cost?.cache_read),
cacheWriteCost: toNumberText(model.cost?.cache_write),
attachment: model.attachment === true,
attachment: model.attachment === true || model.modalities?.input?.includes("image") === true,
imageInput: model.modalities?.input?.includes("image") === true,
reasoning: model.reasoning === true,
temperature: model.temperature === true,
toolCall: model.tool_call !== false,
Expand Down Expand Up @@ -203,8 +206,25 @@ function buildModelConfig(model: ModelDraft) {
delete next.cost;
}

if (model.attachment) next.attachment = true;
if (model.attachment || model.imageInput) next.attachment = true;
else delete next.attachment;

if (model.source?.modalities || model.imageInput) {
const inputModalities = new Set(model.source?.modalities?.input || []);
const outputModalities = new Set(model.source?.modalities?.output || []);
if (model.imageInput) {
inputModalities.add("text");
inputModalities.add("image");
} else {
inputModalities.delete("image");
}
next.modalities = {
input: Array.from(inputModalities),
output: model.imageInput ? ["text"] : Array.from(outputModalities),
};
} else {
delete next.modalities;
}
Comment thread
cyb3r-meow marked this conversation as resolved.
if (model.reasoning) next.reasoning = true;
else delete next.reasoning;
if (model.temperature) next.temperature = true;
Expand Down Expand Up @@ -717,10 +737,27 @@ export function CustomProviderModelEditor({ config, onSave }: CustomProviderMode
<label className="flex items-center gap-2 text-sm">
<Switch
checked={model.attachment}
onCheckedChange={(checked) => updateModel(providerIndex, modelIndex, { attachment: checked })}
onCheckedChange={(checked) =>
updateModel(providerIndex, modelIndex, {
attachment: checked,
imageInput: checked ? model.imageInput : false,
})
}
/>
{t("attachment")}
</label>
<label className="flex items-center gap-2 text-sm">
<Switch
checked={model.imageInput}
onCheckedChange={(checked) =>
updateModel(providerIndex, modelIndex, {
imageInput: checked,
attachment: checked ? true : model.attachment,
})
}
/>
{t("imageInput")}
</label>
<label className="flex items-center gap-2 text-sm">
<Switch
checked={model.reasoning}
Expand Down