mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-14 17:40:44 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
44
openclaw/extensions/cloudflare-ai-gateway/models.ts
Normal file
44
openclaw/extensions/cloudflare-ai-gateway/models.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
|
||||
export const CLOUDFLARE_AI_GATEWAY_PROVIDER_ID = "cloudflare-ai-gateway";
|
||||
export const CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID = "claude-sonnet-4-5";
|
||||
export const CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_REF = `${CLOUDFLARE_AI_GATEWAY_PROVIDER_ID}/${CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID}`;
|
||||
|
||||
const CLOUDFLARE_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW = 200_000;
|
||||
const CLOUDFLARE_AI_GATEWAY_DEFAULT_MAX_TOKENS = 64_000;
|
||||
const CLOUDFLARE_AI_GATEWAY_DEFAULT_COST = {
|
||||
input: 3,
|
||||
output: 15,
|
||||
cacheRead: 0.3,
|
||||
cacheWrite: 3.75,
|
||||
};
|
||||
|
||||
export function buildCloudflareAiGatewayModelDefinition(params?: {
|
||||
id?: string;
|
||||
name?: string;
|
||||
reasoning?: boolean;
|
||||
input?: Array<"text" | "image">;
|
||||
}): ModelDefinitionConfig {
|
||||
const id = params?.id?.trim() || CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID;
|
||||
return {
|
||||
id,
|
||||
name: params?.name ?? "Claude Sonnet 4.5",
|
||||
reasoning: params?.reasoning ?? true,
|
||||
input: params?.input ?? ["text", "image"],
|
||||
cost: CLOUDFLARE_AI_GATEWAY_DEFAULT_COST,
|
||||
contextWindow: CLOUDFLARE_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW,
|
||||
maxTokens: CLOUDFLARE_AI_GATEWAY_DEFAULT_MAX_TOKENS,
|
||||
};
|
||||
}
|
||||
|
||||
export function resolveCloudflareAiGatewayBaseUrl(params: {
|
||||
accountId: string;
|
||||
gatewayId: string;
|
||||
}): string {
|
||||
const accountId = params.accountId.trim();
|
||||
const gatewayId = params.gatewayId.trim();
|
||||
if (!accountId || !gatewayId) {
|
||||
return "";
|
||||
}
|
||||
return `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/anthropic`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue