feat: agent account add openRouter (#12143)

This commit is contained in:
CityFun
2026-03-11 04:00:55 +00:00
committed by GitHub
parent 432412e596
commit d114933fe9
3 changed files with 30 additions and 4 deletions
+12
View File
@@ -157,6 +157,18 @@ var catalog = map[string]Meta{
{ID: "openai/gpt-5-mini", Name: "GPT-5 Mini"},
},
},
"openrouter": {
Key: "openrouter",
DisplayName: "OpenRouter",
Sort: 56,
DefaultBaseURL: "https://openrouter.ai/api/v1",
EnvKey: "OPENROUTER_API_KEY",
Enabled: true,
Models: []Model{
{ID: "openrouter/free", Name: "openrouter/free"},
{ID: "openrouter/auto", Name: "openrouter/auto"},
},
},
"anthropic": {
Key: "anthropic",
DisplayName: "Anthropic",
+4
View File
@@ -2363,6 +2363,8 @@ func resolveRuntimeParams(provider, apiType string, maxTokens, contextWindow int
resolvedMaxTokens = 8192
case "zai":
resolvedMaxTokens = 131072
case "openrouter":
resolvedMaxTokens = 8192
case "minimax", "kimi-coding", "custom":
resolvedMaxTokens = 8192
default:
@@ -2375,6 +2377,8 @@ func resolveRuntimeParams(provider, apiType string, maxTokens, contextWindow int
resolvedContextWindow = 128000
case "zai":
resolvedContextWindow = 204800
case "openrouter":
resolvedContextWindow = 128000
case "minimax", "kimi-coding":
resolvedContextWindow = 200000
case "custom", "vllm":
+14 -4
View File
@@ -41,10 +41,12 @@
</el-table-column>
<el-table-column :label="$t('aiTools.agents.appVersion')" prop="appVersion" min-width="140">
<template #default="{ row }">
<span>{{ row.appVersion }}</span>
<el-button v-if="row.upgradable" link type="primary" class="ml-1" @click="openUpgrade(row)">
{{ $t('commons.button.upgrade') }}
</el-button>
<div class="version-cell">
<span>{{ row.appVersion }}</span>
<el-button v-if="row.upgradable" link type="primary" @click="openUpgrade(row)">
{{ $t('commons.button.upgrade') }}
</el-button>
</div>
</template>
</el-table-column>
<el-table-column
@@ -363,3 +365,11 @@ onMounted(async () => {
await openCreateFromQuery();
});
</script>
<style scoped>
.version-cell {
display: inline-flex;
align-items: center;
gap: 4px;
}
</style>