mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 00:21:59 +00:00
feat(agents): add provider-owned system prompt contributions
This commit is contained in:
@@ -13,6 +13,8 @@ import type {
|
||||
import type { ModelCatalogEntry } from "../agents/model-catalog.js";
|
||||
import type { FailoverReason } from "../agents/pi-embedded-helpers/types.js";
|
||||
import type { ProviderRequestTransportOverrides } from "../agents/provider-request-config.js";
|
||||
import type { ProviderSystemPromptContribution } from "../agents/system-prompt-contribution.js";
|
||||
import type { PromptMode } from "../agents/system-prompt.js";
|
||||
import type { AnyAgentTool } from "../agents/tools/common.js";
|
||||
import type { ThinkLevel } from "../auto-reply/thinking.js";
|
||||
import type { ReplyPayload } from "../auto-reply/types.js";
|
||||
@@ -1044,6 +1046,18 @@ export type ProviderDeferSyntheticProfileAuthContext = {
|
||||
resolvedApiKey?: string;
|
||||
};
|
||||
|
||||
export type ProviderSystemPromptContributionContext = {
|
||||
config?: OpenClawConfig;
|
||||
agentDir?: string;
|
||||
workspaceDir?: string;
|
||||
provider: string;
|
||||
modelId: string;
|
||||
promptMode: PromptMode;
|
||||
runtimeChannel?: string;
|
||||
runtimeCapabilities?: string[];
|
||||
agentId?: string;
|
||||
};
|
||||
|
||||
/** Text-inference provider capability registered by a plugin. */
|
||||
export type ProviderPlugin = {
|
||||
id: string;
|
||||
@@ -1401,6 +1415,15 @@ export type ProviderPlugin = {
|
||||
resolveDefaultThinkingLevel?: (
|
||||
ctx: ProviderDefaultThinkingPolicyContext,
|
||||
) => "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "adaptive" | null | undefined;
|
||||
/**
|
||||
* Provider-owned system-prompt contribution.
|
||||
*
|
||||
* Use this when a provider/model family needs cache-aware prompt tuning
|
||||
* without replacing the full OpenClaw-owned system prompt.
|
||||
*/
|
||||
resolveSystemPromptContribution?: (
|
||||
ctx: ProviderSystemPromptContributionContext,
|
||||
) => ProviderSystemPromptContribution | null | undefined;
|
||||
/**
|
||||
* Provider-owned global config defaults.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user