Remove json tags from internal structs
JSON marshaling uses field names directly; explicit tags are unnecessary at this level. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -29,8 +29,8 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
ApprovalResult struct {
|
ApprovalResult struct {
|
||||||
Approved bool `json:"approved"`
|
Approved bool
|
||||||
Message string `json:"message"`
|
Message string
|
||||||
}
|
}
|
||||||
|
|
||||||
ResumeInput struct {
|
ResumeInput struct {
|
||||||
|
|||||||
@@ -21,40 +21,38 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
CheckpointStatus string
|
AgentStatus string
|
||||||
|
|
||||||
Checkpoint struct {
|
Checkpoint struct {
|
||||||
Version int `json:"version"`
|
Status AgentStatus
|
||||||
Status CheckpointStatus `json:"status"`
|
AgentName string
|
||||||
AgentName string `json:"agent_name"`
|
Messages []llm.Message
|
||||||
Messages []llm.Message `json:"messages"`
|
Usage llm.Usage
|
||||||
Usage llm.Usage `json:"usage"`
|
Turns int
|
||||||
Turns int `json:"turns"`
|
ToolUsedInRun bool
|
||||||
ToolUsedInRun bool `json:"tool_used_in_run"`
|
|
||||||
|
|
||||||
// Approval-interrupted checkpoints carry pending tool calls.
|
// Approval-interrupted checkpoints carry pending tool calls.
|
||||||
PendingToolCalls []llm.ToolCall `json:"pending_tool_calls,omitempty"`
|
PendingToolCalls []llm.ToolCall
|
||||||
PendingApprovals []llm.ToolCall `json:"pending_approvals,omitempty"`
|
PendingApprovals []llm.ToolCall
|
||||||
ApprovalInput map[string]ApprovalResult `json:"approval_input,omitempty"` // keyed by tool call ID
|
ApprovalInput map[string]ApprovalResult // keyed by tool call ID
|
||||||
|
|
||||||
// Nested agent-as-tool suspension: one entry per suspended inner agent.
|
// Nested agent-as-tool suspension: one entry per suspended inner agent.
|
||||||
AllToolCalls []llm.ToolCall `json:"all_tool_calls,omitempty"`
|
AllToolCalls []llm.ToolCall
|
||||||
InnerCheckpoints map[string]*Checkpoint `json:"inner_checkpoints,omitempty"`
|
InnerCheckpoints map[string]*Checkpoint
|
||||||
CompletedCalls []CompletedCall `json:"completed_calls,omitempty"`
|
CompletedCalls []CompletedCall
|
||||||
}
|
}
|
||||||
|
|
||||||
CompletedCall struct {
|
CompletedCall struct {
|
||||||
ToolCallID string `json:"tool_call_id"`
|
ToolCallID string
|
||||||
Result ToolResult `json:"result"`
|
Result ToolResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// CheckpointStore is supervisor-internal. Implementations may use raw
|
// Checkpointer is supervisor-internal. Implementations may use raw
|
||||||
// run IDs because public API/service methods perform tenant scoping and
|
// run IDs because public API/service methods perform tenant scoping and
|
||||||
// authorization before a run reaches the supervisor.
|
// authorization before a run reaches the supervisor.
|
||||||
CheckpointStore interface {
|
Checkpointer interface {
|
||||||
Save(ctx context.Context, runID string, cp *Checkpoint) error
|
Save(ctx context.Context, runID string, cp *Checkpoint) error
|
||||||
Load(ctx context.Context, runID string) (*Checkpoint, error)
|
Load(ctx context.Context, runID string) (*Checkpoint, error)
|
||||||
Delete(ctx context.Context, runID string) error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AgentRegistry interface {
|
AgentRegistry interface {
|
||||||
@@ -68,11 +66,10 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CheckpointVersion = 1
|
|
||||||
MaxCheckpointBytes = 10 * 1024 * 1024
|
MaxCheckpointBytes = 10 * 1024 * 1024
|
||||||
|
|
||||||
CheckpointStatusSuspended CheckpointStatus = "suspended"
|
AgentStatusSuspended AgentStatus = "suspended"
|
||||||
CheckpointStatusAwaitingApproval CheckpointStatus = "awaiting_approval"
|
AgentStatusAwaitingApproval AgentStatus = "awaiting_approval"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (e *SuspendedError) Error() string {
|
func (e *SuspendedError) Error() string {
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import (
|
|||||||
|
|
||||||
type (
|
type (
|
||||||
ToolResult struct {
|
ToolResult struct {
|
||||||
Content string `json:"content"`
|
Content string
|
||||||
IsError bool `json:"is_error"`
|
IsError bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ToolDescriptor describes a tool's name and LLM definition.
|
// ToolDescriptor describes a tool's name and LLM definition.
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
ToolCall struct {
|
ToolCall struct {
|
||||||
ID string `json:"id"`
|
ID string
|
||||||
Function FunctionCall `json:"function"`
|
Function FunctionCall
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionCall struct {
|
FunctionCall struct {
|
||||||
Name string `json:"name"`
|
Name string
|
||||||
Arguments string `json:"arguments"`
|
Arguments string
|
||||||
}
|
}
|
||||||
|
|
||||||
Tool struct {
|
Tool struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user