fix(providers): consume canonical ClawRouter catalog field · openclaw/openclaw@8c8866c
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,7 +17,7 @@ const CATALOG = {
|
17 | 17 | { |
18 | 18 | id: "openai", |
19 | 19 | displayName: "OpenAI", |
20 | | -openAiCompatible: true, |
| 20 | +openaiCompatible: true, |
21 | 21 | nativeBaseUrl: "/v1/native/openai", |
22 | 22 | routes: [ |
23 | 23 | { |
@@ -38,7 +38,7 @@ const CATALOG = {
|
38 | 38 | { |
39 | 39 | id: "anthropic", |
40 | 40 | displayName: "Anthropic", |
41 | | -openAiCompatible: false, |
| 41 | +openaiCompatible: false, |
42 | 42 | nativeBaseUrl: "/v1/native/anthropic", |
43 | 43 | routes: [ |
44 | 44 | { |
@@ -59,7 +59,7 @@ const CATALOG = {
|
59 | 59 | { |
60 | 60 | id: "google-gemini", |
61 | 61 | displayName: "Google Gemini", |
62 | | -openAiCompatible: false, |
| 62 | +openaiCompatible: false, |
63 | 63 | nativeBaseUrl: "/v1/native/google-gemini", |
64 | 64 | routes: [ |
65 | 65 | { |
@@ -80,7 +80,7 @@ const CATALOG = {
|
80 | 80 | { |
81 | 81 | id: "cohere", |
82 | 82 | displayName: "Cohere", |
83 | | -openAiCompatible: false, |
| 83 | +openaiCompatible: false, |
84 | 84 | nativeBaseUrl: "/v1/native/cohere", |
85 | 85 | routes: [ |
86 | 86 | { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -37,7 +37,7 @@ type CatalogModel = {
|
37 | 37 | type CatalogProvider = { |
38 | 38 | id: string; |
39 | 39 | displayName: string; |
40 | | -openAiCompatible: boolean; |
| 40 | +openaiCompatible: boolean; |
41 | 41 | nativeBaseUrl: string; |
42 | 42 | routes: CatalogRoute[]; |
43 | 43 | models: CatalogModel[]; |
@@ -118,7 +118,7 @@ function parseCatalogProvider(value: unknown): CatalogProvider | undefined {
|
118 | 118 | return { |
119 | 119 | id, |
120 | 120 | displayName: readString(row?.displayName) ?? id, |
121 | | -openAiCompatible: row?.openAiCompatible === true, |
| 121 | +openaiCompatible: row?.openaiCompatible === true, |
122 | 122 | nativeBaseUrl, |
123 | 123 | routes: Array.isArray(row?.routes) |
124 | 124 | ? row.routes.map(parseCatalogRoute).filter((route): route is CatalogRoute => Boolean(route)) |
@@ -176,10 +176,10 @@ function buildRoutedModel(
|
176 | 176 | let baseUrl: string; |
177 | 177 | let upstreamModel: string | undefined; |
178 | 178 | |
179 | | -if (provider.openAiCompatible && supportsCapability(model, "llm.responses")) { |
| 179 | +if (provider.openaiCompatible && supportsCapability(model, "llm.responses")) { |
180 | 180 | api = "openai-responses"; |
181 | 181 | baseUrl = `${rootUrl}/v1`; |
182 | | -} else if (provider.openAiCompatible && supportsCapability(model, "llm.chat")) { |
| 182 | +} else if (provider.openaiCompatible && supportsCapability(model, "llm.chat")) { |
183 | 183 | api = "openai-completions"; |
184 | 184 | baseUrl = `${rootUrl}/v1`; |
185 | 185 | } else if ( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。