feat(agent): add structured prompt layering

This commit is contained in:
Hoshina
2026-04-24 18:14:28 +08:00
parent 293477b02a
commit 2e65b1be83
13 changed files with 1184 additions and 74 deletions
+13
View File
@@ -61,6 +61,13 @@ type ContentBlock struct {
Type string `json:"type"` // "text"
Text string `json:"text"`
CacheControl *CacheControl `json:"cache_control,omitempty"`
// Prompt metadata is internal to the agent runtime. It records which
// structured prompt segment produced this block without changing provider
// JSON.
PromptLayer string `json:"-"`
PromptSlot string `json:"-"`
PromptSource string `json:"-"`
}
type Attachment struct {
@@ -80,6 +87,12 @@ type Message struct {
SystemParts []ContentBlock `json:"system_parts,omitempty"` // structured system blocks for cache-aware adapters
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
// Prompt metadata is internal to the agent runtime. It records where a
// message or system part came from without changing provider/session JSON.
PromptLayer string `json:"-"`
PromptSlot string `json:"-"`
PromptSource string `json:"-"`
}
type ToolDefinition struct {