write

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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

type DeleteOutput

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

type Goal

type Goal struct {
	Id                          string     `sqlx:"id,primaryKey" validate:"required"`
	ConversationID              *string    `sqlx:"conversation_id" json:",omitempty"`
	Objective                   *string    `sqlx:"objective" json:",omitempty"`
	Status                      *string    `sqlx:"status" json:",omitempty"`
	StatusReason                *string    `sqlx:"status_reason" json:",omitempty"`
	PauseReason                 *string    `sqlx:"pause_reason" json:",omitempty"`
	ControllerSpec              *string    `sqlx:"controller_spec" json:",omitempty"`
	TokenBudget                 *int64     `sqlx:"token_budget" json:",omitempty"`
	TokensUsed                  *int64     `sqlx:"tokens_used" json:",omitempty"`
	TimeUsedSeconds             *int64     `sqlx:"time_used_seconds" json:",omitempty"`
	AutonomousTurnsUsed         *int64     `sqlx:"autonomous_turns_used" json:",omitempty"`
	ConsecutiveNoProgress       *int64     `sqlx:"consecutive_no_progress" json:",omitempty"`
	LastContinuationFingerprint *string    `sqlx:"last_continuation_fingerprint" json:",omitempty"`
	CreatedAt                   *time.Time `sqlx:"created_at" json:",omitempty"`
	UpdatedAt                   *time.Time `sqlx:"updated_at" json:",omitempty"`
	Has                         *GoalHas   `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

func (*Goal) SetAutonomousTurnsUsed

func (g *Goal) SetAutonomousTurnsUsed(v int64)

func (*Goal) SetConsecutiveNoProgress

func (g *Goal) SetConsecutiveNoProgress(v int64)

func (*Goal) SetControllerSpec

func (g *Goal) SetControllerSpec(v string)

func (*Goal) SetConversationID

func (g *Goal) SetConversationID(v string)

func (*Goal) SetCreatedAt

func (g *Goal) SetCreatedAt(v time.Time)

func (*Goal) SetId

func (g *Goal) SetId(v string)

func (*Goal) SetLastContinuationFingerprint

func (g *Goal) SetLastContinuationFingerprint(v string)

func (*Goal) SetObjective

func (g *Goal) SetObjective(v string)

func (*Goal) SetPauseReason

func (g *Goal) SetPauseReason(v string)

func (*Goal) SetStatus

func (g *Goal) SetStatus(v string)

func (*Goal) SetStatusReason

func (g *Goal) SetStatusReason(v string)

func (*Goal) SetTimeUsedSeconds

func (g *Goal) SetTimeUsedSeconds(v int64)

func (*Goal) SetTokenBudget

func (g *Goal) SetTokenBudget(v int64)

func (*Goal) SetTokensUsed

func (g *Goal) SetTokensUsed(v int64)

func (*Goal) SetUpdatedAt

func (g *Goal) SetUpdatedAt(v time.Time)

type GoalHas

type GoalHas struct {
	Id                          bool
	ConversationID              bool
	Objective                   bool
	Status                      bool
	StatusReason                bool
	PauseReason                 bool
	ControllerSpec              bool
	TokenBudget                 bool
	TokensUsed                  bool
	TimeUsedSeconds             bool
	AutonomousTurnsUsed         bool
	ConsecutiveNoProgress       bool
	LastContinuationFingerprint bool
	CreatedAt                   bool
	UpdatedAt                   bool
}

type GoalSlice

type GoalSlice []*Goal

func (GoalSlice) IndexById

func (s GoalSlice) IndexById() IndexedGoal

type Handler

type Handler struct{}

func (*Handler) Exec

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

type IndexedGoal

type IndexedGoal map[string]*Goal

type Input

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

	CurGoalIDs *struct{ Values []string } `parameter:",kind=param,in=Goals,dataType=goal/write.MutableGoalViews" codec:"structql,uri=sql/cur_ids.sql"`

	CurGoals []*Goal `parameter:",kind=view,in=CurGoals" view:"CurGoals" sql:"uri=sql/cur_goal.sql"`

	CurGoalById IndexedGoal
}

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 MutableGoalView

type MutableGoalView = Goal

func NewMutableGoalView

func NewMutableGoalView(opts ...MutableGoalViewOption) *MutableGoalView

type MutableGoalViewOption

type MutableGoalViewOption func(*MutableGoalView)

func WithGoalAutonomousTurnsUsed

func WithGoalAutonomousTurnsUsed(v int64) MutableGoalViewOption

func WithGoalConsecutiveNoProgress

func WithGoalConsecutiveNoProgress(v int64) MutableGoalViewOption

func WithGoalControllerSpec

func WithGoalControllerSpec(v string) MutableGoalViewOption

func WithGoalConversationID

func WithGoalConversationID(v string) MutableGoalViewOption

func WithGoalID

func WithGoalID(v string) MutableGoalViewOption

func WithGoalLastContinuationFingerprint

func WithGoalLastContinuationFingerprint(v string) MutableGoalViewOption

func WithGoalObjective

func WithGoalObjective(v string) MutableGoalViewOption

func WithGoalPauseReason

func WithGoalPauseReason(v string) MutableGoalViewOption

func WithGoalStatus

func WithGoalStatus(v string) MutableGoalViewOption

func WithGoalStatusReason

func WithGoalStatusReason(v string) MutableGoalViewOption

func WithGoalTimeUsedSeconds

func WithGoalTimeUsedSeconds(v int64) MutableGoalViewOption

func WithGoalTokenBudget

func WithGoalTokenBudget(v int64) MutableGoalViewOption

func WithGoalTokensUsed

func WithGoalTokensUsed(v int64) MutableGoalViewOption

type MutableGoalViews

type MutableGoalViews struct {
	Goals []*MutableGoalView
}

func NewMutableGoalViews

func NewMutableGoalViews(rows ...*MutableGoalView) *MutableGoalViews

type Output

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

Jump to

Keyboard shortcuts

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