write

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 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)

Types

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 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"`
	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"`
	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) SetRetryOf

func (t *Turn) SetRetryOf(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
	Status                bool
	StartedByMessageID    bool
	RetryOf               bool
	AgentIDUsed           bool
	AgentConfigUsedID     bool
	ModelOverrideProvider bool
	ModelOverride         bool
	ModelParamsOverride   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