write

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PathURI = "/v1/api/agently/run"

Functions

func DefineComponent

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

func DefineDeleteComponent

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

Types

type DeleteHandler

type DeleteHandler struct{}

func (*DeleteHandler) Exec

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

type DeleteInput

type DeleteInput struct {
	Rows []*MutableRunView `parameter:",kind=body,in=data"`
}

type DeleteOutput

type DeleteOutput struct {
	response.Status `parameter:",kind=output,in=status" json:",omitempty"`
}

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 {
	Runs []*MutableRunView `parameter:",kind=body,in=data"`

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

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

	CurByID map[string]*MutableRunView
}

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 MutableRunView

type MutableRunView struct {
	Id                    string     `sqlx:"id,primaryKey" validate:"required"`
	TurnID                *string    `sqlx:"turn_id" json:",omitempty"`
	ScheduleID            *string    `sqlx:"schedule_id" json:",omitempty"`
	ConversationID        *string    `sqlx:"conversation_id" json:",omitempty"`
	ConversationKind      *string    `sqlx:"conversation_kind" json:",omitempty"`
	Attempt               *int       `sqlx:"attempt" json:",omitempty"`
	ResumedFromRunID      *string    `sqlx:"resumed_from_run_id" json:",omitempty"`
	Status                string     `sqlx:"status" validate:"required"`
	ErrorCode             *string    `sqlx:"error_code" json:",omitempty"`
	ErrorMessage          *string    `sqlx:"error_message" json:",omitempty"`
	Iteration             *int       `sqlx:"iteration" json:",omitempty"`
	MaxIterations         *int       `sqlx:"max_iterations" json:",omitempty"`
	CheckpointResponseID  *string    `sqlx:"checkpoint_response_id" json:",omitempty"`
	CheckpointMessageID   *string    `sqlx:"checkpoint_message_id" json:",omitempty"`
	CheckpointData        *string    `sqlx:"checkpoint_data" json:",omitempty"`
	AgentID               *string    `sqlx:"agent_id" json:",omitempty"`
	ModelProvider         *string    `sqlx:"model_provider" json:",omitempty"`
	Model                 *string    `sqlx:"model" json:",omitempty"`
	WorkerID              *string    `sqlx:"worker_id" json:",omitempty"`
	WorkerPID             *int       `sqlx:"worker_pid" json:",omitempty"`
	WorkerHost            *string    `sqlx:"worker_host" json:",omitempty"`
	LeaseOwner            *string    `sqlx:"lease_owner" json:",omitempty"`
	LeaseUntil            *time.Time `sqlx:"lease_until" json:",omitempty"`
	LastHeartbeatAt       *time.Time `sqlx:"last_heartbeat_at" json:",omitempty"`
	SecurityContext       *string    `sqlx:"security_context" json:",omitempty"`
	UserCredURL           *string    `sqlx:"user_cred_url" json:",omitempty"`
	EffectiveUserID       *string    `sqlx:"effective_user_id" json:",omitempty"`
	AuthAuthority         *string    `sqlx:"auth_authority" json:",omitempty"`
	AuthAudience          *string    `sqlx:"auth_audience" json:",omitempty"`
	HeartbeatIntervalSec  *int       `sqlx:"heartbeat_interval_sec" json:",omitempty"`
	ScheduledFor          *time.Time `sqlx:"scheduled_for" json:",omitempty"`
	PreconditionRanAt     *time.Time `sqlx:"precondition_ran_at" json:",omitempty"`
	PreconditionPassed    *int       `sqlx:"precondition_passed" json:",omitempty"`
	PreconditionResult    *string    `sqlx:"precondition_result" json:",omitempty"`
	UsagePromptTokens     *int       `sqlx:"usage_prompt_tokens" json:",omitempty"`
	UsageCompletionTokens *int       `sqlx:"usage_completion_tokens" json:",omitempty"`
	UsageTotalTokens      *int       `sqlx:"usage_total_tokens" json:",omitempty"`
	UsageCost             *float64   `sqlx:"usage_cost" json:",omitempty"`
	CreatedAt             *time.Time `sqlx:"created_at" json:",omitempty"`
	UpdatedAt             *time.Time `sqlx:"updated_at" json:",omitempty"`
	StartedAt             *time.Time `sqlx:"started_at" json:",omitempty"`
	CompletedAt           *time.Time `sqlx:"completed_at" json:",omitempty"`
	Has                   *RunHas    `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

func NewMutableRunView

func NewMutableRunView(opts ...MutableRunViewOption) *MutableRunView

func (*MutableRunView) SetAgentID

func (r *MutableRunView) SetAgentID(v string)

func (*MutableRunView) SetAttempt

func (r *MutableRunView) SetAttempt(v int)

func (*MutableRunView) SetCheckpointData

func (r *MutableRunView) SetCheckpointData(v string)

func (*MutableRunView) SetCheckpointMessageID

func (r *MutableRunView) SetCheckpointMessageID(v string)

func (*MutableRunView) SetCheckpointResponseID

func (r *MutableRunView) SetCheckpointResponseID(v string)

func (*MutableRunView) SetCompletedAt

func (r *MutableRunView) SetCompletedAt(v time.Time)

func (*MutableRunView) SetConversationID

func (r *MutableRunView) SetConversationID(v string)

func (*MutableRunView) SetConversationKind

func (r *MutableRunView) SetConversationKind(v string)

func (*MutableRunView) SetCreatedAt

func (r *MutableRunView) SetCreatedAt(v time.Time)

func (*MutableRunView) SetEffectiveUserID

func (r *MutableRunView) SetEffectiveUserID(v string)

func (*MutableRunView) SetErrorCode

func (r *MutableRunView) SetErrorCode(v string)

func (*MutableRunView) SetErrorMessage

func (r *MutableRunView) SetErrorMessage(v string)

func (*MutableRunView) SetId

func (r *MutableRunView) SetId(v string)

func (*MutableRunView) SetIteration

func (r *MutableRunView) SetIteration(v int)

func (*MutableRunView) SetLastHeartbeatAt

func (r *MutableRunView) SetLastHeartbeatAt(v time.Time)

func (*MutableRunView) SetLeaseOwner

func (r *MutableRunView) SetLeaseOwner(v string)

func (*MutableRunView) SetLeaseUntil

func (r *MutableRunView) SetLeaseUntil(v time.Time)

func (*MutableRunView) SetMaxIterations

func (r *MutableRunView) SetMaxIterations(v int)

func (*MutableRunView) SetModel

func (r *MutableRunView) SetModel(v string)

func (*MutableRunView) SetModelProvider

func (r *MutableRunView) SetModelProvider(v string)

func (*MutableRunView) SetPreconditionPassed

func (r *MutableRunView) SetPreconditionPassed(v int)

func (*MutableRunView) SetPreconditionRanAt

func (r *MutableRunView) SetPreconditionRanAt(v time.Time)

func (*MutableRunView) SetPreconditionResult

func (r *MutableRunView) SetPreconditionResult(v string)

func (*MutableRunView) SetResumedFromRunID

func (r *MutableRunView) SetResumedFromRunID(v string)

func (*MutableRunView) SetScheduleID

func (r *MutableRunView) SetScheduleID(v string)

func (*MutableRunView) SetScheduledFor

func (r *MutableRunView) SetScheduledFor(v time.Time)

func (*MutableRunView) SetSecurityContext

func (r *MutableRunView) SetSecurityContext(v string)

func (*MutableRunView) SetStartedAt

func (r *MutableRunView) SetStartedAt(v time.Time)

func (*MutableRunView) SetStatus

func (r *MutableRunView) SetStatus(v string)

func (*MutableRunView) SetTurnID

func (r *MutableRunView) SetTurnID(v string)

func (*MutableRunView) SetUpdatedAt

func (r *MutableRunView) SetUpdatedAt(v time.Time)

func (*MutableRunView) SetUsageCompletionTokens

func (r *MutableRunView) SetUsageCompletionTokens(v int)

func (*MutableRunView) SetUsageCost

func (r *MutableRunView) SetUsageCost(v float64)

func (*MutableRunView) SetUsagePromptTokens

func (r *MutableRunView) SetUsagePromptTokens(v int)

func (*MutableRunView) SetUsageTotalTokens

func (r *MutableRunView) SetUsageTotalTokens(v int)

func (*MutableRunView) SetUserCredURL

func (r *MutableRunView) SetUserCredURL(v string)

func (*MutableRunView) SetWorkerHost

func (r *MutableRunView) SetWorkerHost(v string)

func (*MutableRunView) SetWorkerID

func (r *MutableRunView) SetWorkerID(v string)

func (*MutableRunView) SetWorkerPID

func (r *MutableRunView) SetWorkerPID(v int)

type MutableRunViewOption

type MutableRunViewOption func(*MutableRunView)

func WithRunConversationID

func WithRunConversationID(v string) MutableRunViewOption

func WithRunID

func WithRunID(v string) MutableRunViewOption

func WithRunIteration

func WithRunIteration(v int) MutableRunViewOption

func WithRunStatus

func WithRunStatus(v string) MutableRunViewOption

func WithRunTurnID

func WithRunTurnID(v string) MutableRunViewOption

type MutableRunViews

type MutableRunViews struct {
	Runs []*MutableRunView
}

func NewMutableRunViews

func NewMutableRunViews(rows ...*MutableRunView) *MutableRunViews

type Output

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

type RunHas

type RunHas struct {
	Id                    bool
	TurnID                bool
	ScheduleID            bool
	ConversationID        bool
	ConversationKind      bool
	Attempt               bool
	ResumedFromRunID      bool
	Status                bool
	ErrorCode             bool
	ErrorMessage          bool
	Iteration             bool
	MaxIterations         bool
	CheckpointResponseID  bool
	CheckpointMessageID   bool
	CheckpointData        bool
	AgentID               bool
	ModelProvider         bool
	Model                 bool
	WorkerID              bool
	WorkerPID             bool
	WorkerHost            bool
	LeaseOwner            bool
	LeaseUntil            bool
	LastHeartbeatAt       bool
	SecurityContext       bool
	UserCredURL           bool
	EffectiveUserID       bool
	ScheduledFor          bool
	PreconditionRanAt     bool
	PreconditionPassed    bool
	PreconditionResult    bool
	UsagePromptTokens     bool
	UsageCompletionTokens bool
	UsageTotalTokens      bool
	UsageCost             bool
	CreatedAt             bool
	UpdatedAt             bool
	StartedAt             bool
	CompletedAt           bool
}

Jump to

Keyboard shortcuts

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