mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-07 10:34:44 +00:00
fix(foundry): label Anthropic Messages onboarding
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
} from "./onboard.js";
|
||||
import {
|
||||
buildFoundryAuthResult,
|
||||
formatFoundryApiLabel,
|
||||
type FoundryProviderApi,
|
||||
isFoundryMaiImageModel,
|
||||
listConfiguredFoundryProfileIds,
|
||||
@@ -154,7 +155,7 @@ export const entraIdAuthMethod: ProviderAuthMethod = {
|
||||
`Endpoint: ${endpoint}`,
|
||||
`Deployment: ${modelId}`,
|
||||
selectedDeployment.modelName ? `Model: ${selectedDeployment.modelName}` : undefined,
|
||||
`API: ${api === "openai-responses" ? "Responses" : "Chat Completions"}`,
|
||||
`API: ${formatFoundryApiLabel(api)}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join("\n"),
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
COGNITIVE_SERVICES_RESOURCE,
|
||||
FOUNDRY_ANTHROPIC_SCOPE,
|
||||
buildFoundryAuthResult,
|
||||
formatFoundryApiLabel,
|
||||
isAnthropicFoundryDeployment,
|
||||
isFoundryMaiImageModel,
|
||||
normalizeFoundryEndpoint,
|
||||
@@ -841,6 +842,12 @@ describe("microsoft-foundry plugin", () => {
|
||||
expect(isFoundryMaiImageModel("MAI-DS-R1")).toBe(false);
|
||||
});
|
||||
|
||||
it("labels all Foundry API surfaces for onboarding summaries", () => {
|
||||
expect(formatFoundryApiLabel("openai-completions")).toBe("Chat Completions");
|
||||
expect(formatFoundryApiLabel("openai-responses")).toBe("Responses");
|
||||
expect(formatFoundryApiLabel("anthropic-messages")).toBe("Anthropic Messages");
|
||||
});
|
||||
|
||||
it("records MAI chat deployments with reasoning-content token limits", () => {
|
||||
const result = buildFoundryAuthResult({
|
||||
profileId: "microsoft-foundry:entra",
|
||||
|
||||
@@ -332,6 +332,17 @@ export function isFoundryProviderApi(value?: string | null): value is FoundryPro
|
||||
return value === DEFAULT_API || value === DEFAULT_GPT5_API || value === ANTHROPIC_MESSAGES_API;
|
||||
}
|
||||
|
||||
export function formatFoundryApiLabel(api: FoundryProviderApi): string {
|
||||
switch (api) {
|
||||
case DEFAULT_GPT5_API:
|
||||
return "Responses";
|
||||
case ANTHROPIC_MESSAGES_API:
|
||||
return "Anthropic Messages";
|
||||
case DEFAULT_API:
|
||||
return "Chat Completions";
|
||||
}
|
||||
}
|
||||
|
||||
export function normalizeFoundryEndpoint(endpoint: string): string {
|
||||
const trimmed = normalizeOptionalString(endpoint) ?? "";
|
||||
if (!trimmed) {
|
||||
|
||||
Reference in New Issue
Block a user