Documentation
¶
Overview ¶
Package types contains stable protocol values shared across the model, memory, security, and engine layers.
Domain-specific configuration and result types belong to their owning packages rather than this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithRunContext ¶
func WithRunContext(parent context.Context, runContext *RunContext) context.Context
Types ¶
type ErrorCode ¶
type ErrorCode string
const ( ErrModelTimeout ErrorCode = "MODEL_TIMEOUT" ErrToolError ErrorCode = "TOOL_ERROR" ErrInvalidInput ErrorCode = "INVALID_INPUT" ErrInvalidConfig ErrorCode = "INVALID_CONFIG" ErrAPIError ErrorCode = "API_ERROR" ErrRateLimit ErrorCode = "RATE_LIMIT" ErrRunCancelled ErrorCode = "RUN_CANCELLED" ErrSecurityViolation ErrorCode = "SECURITY_VIOLATION" ErrMaxLoopsExceeded ErrorCode = "MAX_LOOPS_EXCEEDED" ErrCircuitOpen ErrorCode = "CIRCUIT_OPEN" ErrEventDelivery ErrorCode = "EVENT_DELIVERY_FAILED" ErrTurnNotFound ErrorCode = "TURN_NOT_FOUND" ErrInteractionNotFound ErrorCode = "INTERACTION_NOT_FOUND" ErrRunInterrupted ErrorCode = "RUN_INTERRUPTED" ErrSummaryFailed ErrorCode = "SUMMARY_FAILED" )
type HarnessError ¶
type HarnessError struct {
Code ErrorCode `json:"code"`
Message string `json:"message"`
Err error `json:"-"`
}
func NewError ¶
func NewError(code ErrorCode, msg string) *HarnessError
func (*HarnessError) Error ¶
func (e *HarnessError) Error() string
func (*HarnessError) Unwrap ¶
func (e *HarnessError) Unwrap() error
type Message ¶
type Message struct {
Role Role `json:"role"`
Content string `json:"content"`
Reasoning string `json:"reasoning,omitempty"`
ReasoningState []json.RawMessage `json:"reasoning_state,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
Name string `json:"name,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type RunContext ¶
type RunContext struct {
RunID string
SessionID string
UserID string
AgentID string
TeamID string
WorkflowID string
ParentRunID string
Metadata map[string]any
}
func RunContextFrom ¶ added in v0.2.0
func RunContextFrom(ctx context.Context) (*RunContext, bool)
type ToolCall ¶
type ToolCall struct {
ID string `json:"id"`
Type string `json:"type"`
Function ToolCallFunction `json:"function"`
}
type ToolCallFunction ¶
Click to show internal directories.
Click to hide internal directories.