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 PackageName = "turn/write"
View Source
var PathURI = "/v1/api/agently/turn"

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 []*MutableTurnView `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 IndexedTurn

type IndexedTurn map[string]*Turn

type Input

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

	CurTurnsId *struct{ Values []string } `parameter:",kind=param,in=Turns,dataType=turn/write.Turns" codec:"structql,uri=sql/cur_turns_id.sql"`

	CurTurn []*Turn `parameter:",kind=view,in=CurTurn" view:"CurTurn" sql:"uri=sql/cur_turn.sql"`

	CurTurnById IndexedTurn
}

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 MutableTurnView

type MutableTurnView = Turn

func NewMutableTurnView

func NewMutableTurnView(opts ...MutableTurnViewOption) *MutableTurnView

type MutableTurnViewOption

type MutableTurnViewOption func(*MutableTurnView)

func WithTurnConversationID

func WithTurnConversationID(v string) MutableTurnViewOption

func WithTurnID

func WithTurnID(v string) MutableTurnViewOption

func WithTurnRunID

func WithTurnRunID(v string) MutableTurnViewOption

func WithTurnStatus

func WithTurnStatus(v string) MutableTurnViewOption

type MutableTurnViews

type MutableTurnViews struct {
	Turns []*MutableTurnView
}

func NewMutableTurnViews

func NewMutableTurnViews(rows ...*MutableTurnView) *MutableTurnViews

type Output

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

type Turn

type Turn struct {
	Id                    string     `sqlx:"id,primaryKey" validate:"required"`
	ConversationID        string     `sqlx:"conversation_id" validate:"required"`
	CreatedAt             *time.Time `sqlx:"created_at" json:",omitempty"`
	QueueSeq              *int64     `sqlx:"queue_seq" json:",omitempty"`
	Status                string     `sqlx:"status" validate:"required"`
	StartedByMessageID    *string    `sqlx:"started_by_message_id" json:",omitempty"`
	RetryOf               *string    `sqlx:"retry_of" json:",omitempty"`
	AgentIDUsed           *string    `sqlx:"agent_id_used" json:",omitempty"`
	AgentConfigUsedID     *string    `sqlx:"agent_config_used_id" json:",omitempty"`
	ModelOverrideProvider *string    `sqlx:"model_override_provider" json:",omitempty"`
	ModelOverride         *string    `sqlx:"model_override" json:",omitempty"`
	ModelParamsOverride   *string    `sqlx:"model_params_override" json:",omitempty"`
	RunID                 *string    `sqlx:"run_id" json:",omitempty"`
	ErrorMessage          *string    `sqlx:"error_message" json:",omitempty"`
	Has                   *TurnHas   `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

Turn mirrors the turn table for upsert operations.

func (*Turn) SetAgentConfigUsedID

func (t *Turn) SetAgentConfigUsedID(v string)

func (*Turn) SetAgentIDUsed

func (t *Turn) SetAgentIDUsed(v string)

func (*Turn) SetConversationID

func (t *Turn) SetConversationID(v string)

func (*Turn) SetCreatedAt

func (t *Turn) SetCreatedAt(v time.Time)

func (*Turn) SetErrorMessage

func (t *Turn) SetErrorMessage(v string)

func (*Turn) SetId

func (t *Turn) SetId(v string)

func (*Turn) SetModelOverride

func (t *Turn) SetModelOverride(v string)

func (*Turn) SetModelOverrideProvider

func (t *Turn) SetModelOverrideProvider(v string)

func (*Turn) SetModelParamsOverride

func (t *Turn) SetModelParamsOverride(v string)

func (*Turn) SetQueueSeq

func (t *Turn) SetQueueSeq(v int64)

func (*Turn) SetRetryOf

func (t *Turn) SetRetryOf(v string)

func (*Turn) SetRunID

func (t *Turn) SetRunID(v string)

func (*Turn) SetStartedByMessageID

func (t *Turn) SetStartedByMessageID(v string)

func (*Turn) SetStatus

func (t *Turn) SetStatus(v string)

type TurnHas

type TurnHas struct {
	Id                    bool
	ConversationID        bool
	CreatedAt             bool
	QueueSeq              bool
	Status                bool
	StartedByMessageID    bool
	RetryOf               bool
	AgentIDUsed           bool
	AgentConfigUsedID     bool
	ModelOverrideProvider bool
	ModelOverride         bool
	ModelParamsOverride   bool
	RunID                 bool
	ErrorMessage          bool
}

type TurnSlice

type TurnSlice []*Turn

func (TurnSlice) IndexById

func (s TurnSlice) IndexById() IndexedTurn

Jump to

Keyboard shortcuts

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