write

package
v0.2.59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PackageName = "toolcall/write"
View Source
var PathURI = "/v1/api/agently/toolcall"

Functions

func DefineComponent

func DefineComponent(ctx context.Context, srv *datly.Service) (*repository.Component, error)

Types

type Handler

type Handler struct{}

func (*Handler) Exec

func (h *Handler) Exec(ctx context.Context, sess handler.Session) (interface{}, error)

type Input

type Input struct {
	ToolCalls []*ToolCall `parameter:",kind=body,in=data"`

	CurIDs *struct{ Values []string } `parameter:",kind=param,in=ToolCalls,dataType=toolcall/write.ToolCalls" codec:"structql,uri=sql/cur_ids.sql"`

	Cur []*ToolCall `parameter:",kind=view,in=Cur" view:"Cur" sql:"uri=sql/cur_tool_call.sql"`

	CurByID map[string]*ToolCall
}

func (*Input) EmbedFS

func (i *Input) EmbedFS() (fs *embed.FS)

func (*Input) Init

func (i *Input) Init(ctx context.Context, sess handler.Session, _ *Output) error

func (*Input) Validate

func (i *Input) Validate(ctx context.Context, sess handler.Session, output *Output) error

type Output

type Output struct {
	response.Status `parameter:",kind=output,in=status" anonymous:"true"`
	Data            []*ToolCall            `parameter:",kind=body"`
	Violations      []*validator.Violation `parameter:",kind=transient"`
}

type ToolCall

type ToolCall struct {
	MessageID string  `sqlx:"message_id,primaryKey" validate:"required"`
	TurnID    *string `sqlx:"turn_id" json:",omitempty"`
	OpID      string  `sqlx:"op_id" validate:"required"`
	Attempt   int     `sqlx:"attempt"`
	ToolName  string  `sqlx:"tool_name" validate:"required"`
	ToolKind  string  `sqlx:"tool_kind" validate:"required"`
	// capability_tags and resource_uris removed
	Status string `sqlx:"status" validate:"required"`
	// request_snapshot removed
	RequestHash *string `sqlx:"request_hash" json:",omitempty"`
	// response_snapshot removed
	ErrorCode         *string    `sqlx:"error_code" json:",omitempty"`
	ErrorMessage      *string    `sqlx:"error_message" json:",omitempty"`
	Retriable         *int       `sqlx:"retriable" json:",omitempty"`
	StartedAt         *time.Time `sqlx:"started_at" json:",omitempty"`
	CompletedAt       *time.Time `sqlx:"completed_at" json:",omitempty"`
	LatencyMS         *int       `sqlx:"latency_ms" json:",omitempty"`
	Cost              *float64   `sqlx:"cost" json:",omitempty"`
	TraceID           *string    `sqlx:"trace_id" json:",omitempty"`
	SpanID            *string    `sqlx:"span_id" json:",omitempty"`
	RequestPayloadID  *string    `sqlx:"request_payload_id"`
	ResponsePayloadID *string    `sqlx:"response_payload_id"`
	// ResponseOverflow flags that response content exceeded preview limit.
	ResponseOverflow bool `sqlx:"-" json:",omitempty"`

	Has *ToolCallHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

func (*ToolCall) SetAttempt

func (t *ToolCall) SetAttempt(v int)

func (*ToolCall) SetMessageID

func (t *ToolCall) SetMessageID(v string)

func (*ToolCall) SetOpID

func (t *ToolCall) SetOpID(v string)

func (*ToolCall) SetResponseOverflow added in v0.2.6

func (t *ToolCall) SetResponseOverflow(v bool)

func (*ToolCall) SetStatus

func (t *ToolCall) SetStatus(v string)

func (*ToolCall) SetToolKind

func (t *ToolCall) SetToolKind(v string)

func (*ToolCall) SetToolName

func (t *ToolCall) SetToolName(v string)

type ToolCallHas

type ToolCallHas struct {
	MessageID bool
	TurnID    bool
	OpID      bool
	Attempt   bool
	ToolName  bool
	ToolKind  bool
	// CapabilityTags removed
	// ResourceURIs removed
	Status bool
	// RequestSnapshot removed
	RequestHash bool
	// ResponseSnapshot removed
	ErrorCode         bool
	ErrorMessage      bool
	Retriable         bool
	StartedAt         bool
	CompletedAt       bool
	LatencyMS         bool
	Cost              bool
	TraceID           bool
	SpanID            bool
	RequestPayloadID  bool
	ResponsePayloadID bool
	ResponseOverflow  bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL