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

View Source
const (
	VisibilityPrivate = "private"
	VisibilityPublic  = "public"
)

Variables

View Source
var ConversationPostFS embed.FS
View Source
var PackageName = "conversation/write"
View Source
var PathURI = "/v1/api/agently/conversation"

Functions

func DefineComponent

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

Types

type Conversation

type Conversation struct {
	Id                       string     `sqlx:"id,primaryKey" validate:"required"`
	Summary                  *string    `sqlx:"summary" json:",omitempty"`
	AgentId                  string     `sqlx:"agent_id" `
	Title                    *string    `sqlx:"title" json:",omitempty"`
	ConversationParentId     string     `sqlx:"conversation_parent_id" `
	ConversationParentTurnId string     `sqlx:"conversation_parent_turn_id" `
	Visibility               *string    `sqlx:"visibility" json:",omitempty"`
	CreatedAt                *time.Time `sqlx:"created_at" json:",omitempty"`
	UpdatedAt                *time.Time `sqlx:"updated_at" json:",omitempty"`
	LastActivity             *time.Time `sqlx:"last_activity" json:",omitempty"`
	UsageInputTokens         int        `sqlx:"usage_input_tokens" json:",omitempty"`
	UsageOutputTokens        int        `sqlx:"usage_output_tokens" json:",omitempty"`
	UsageEmbeddingTokens     int        `sqlx:"usage_embedding_tokens" json:",omitempty"`
	CreatedByUserID          *string    `sqlx:"created_by_user_id" json:",omitempty"`
	DefaultModelProvider     *string    `sqlx:"default_model_provider" json:",omitempty"`
	DefaultModel             *string    `sqlx:"default_model" json:",omitempty"`
	DefaultModelParams       *string    `sqlx:"default_model_params" json:",omitempty"`
	Metadata                 *string    `sqlx:"metadata" json:",omitempty"`
	// Scheduling annotations for discriminating scheduled conversations
	Scheduled        int              `sqlx:"scheduled" json:",omitempty"`
	ScheduleId       *string          `sqlx:"schedule_id" json:",omitempty"`
	ScheduleRunId    *string          `sqlx:"schedule_run_id" json:",omitempty"`
	ScheduleKind     *string          `sqlx:"schedule_kind" json:",omitempty"`
	ScheduleTimezone *string          `sqlx:"schedule_timezone" json:",omitempty"`
	ScheduleCronExpr *string          `sqlx:"schedule_cron_expr" json:",omitempty"`
	Status           *string          `sqlx:"status" json:",omitempty"`
	Has              *ConversationHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

func NewConversationStatus added in v0.2.2

func NewConversationStatus(id, status string) *Conversation

func (*Conversation) SetAgentId added in v0.2.2

func (c *Conversation) SetAgentId(value string)

func (*Conversation) SetConversationParentId added in v0.2.2

func (c *Conversation) SetConversationParentId(value string)

func (*Conversation) SetConversationParentTurnId added in v0.2.2

func (c *Conversation) SetConversationParentTurnId(value string)

func (*Conversation) SetCreatedAt

func (c *Conversation) SetCreatedAt(value time.Time)

func (*Conversation) SetCreatedByUserID

func (c *Conversation) SetCreatedByUserID(value string)

func (*Conversation) SetDefaultModel

func (c *Conversation) SetDefaultModel(value string)

func (*Conversation) SetDefaultModelParams

func (c *Conversation) SetDefaultModelParams(value string)

func (*Conversation) SetDefaultModelProvider

func (c *Conversation) SetDefaultModelProvider(value string)

func (*Conversation) SetId

func (c *Conversation) SetId(value string)

func (*Conversation) SetLastActivity

func (c *Conversation) SetLastActivity(value time.Time)

func (*Conversation) SetMetadata

func (c *Conversation) SetMetadata(value string)

func (*Conversation) SetScheduleCronExpr added in v0.2.1

func (c *Conversation) SetScheduleCronExpr(value string)

func (*Conversation) SetScheduleId added in v0.2.1

func (c *Conversation) SetScheduleId(value string)

func (*Conversation) SetScheduleKind added in v0.2.1

func (c *Conversation) SetScheduleKind(value string)

func (*Conversation) SetScheduleRunId added in v0.2.1

func (c *Conversation) SetScheduleRunId(value string)

func (*Conversation) SetScheduleTimezone added in v0.2.1

func (c *Conversation) SetScheduleTimezone(value string)

func (*Conversation) SetScheduled added in v0.2.1

func (c *Conversation) SetScheduled(value int)

func (*Conversation) SetStatus added in v0.2.2

func (c *Conversation) SetStatus(value string)

func (*Conversation) SetSummary

func (c *Conversation) SetSummary(value string)

func (*Conversation) SetTitle

func (c *Conversation) SetTitle(value string)

func (*Conversation) SetUpdatedAt added in v0.2.2

func (c *Conversation) SetUpdatedAt(value time.Time)

func (*Conversation) SetUsageEmbeddingTokens

func (c *Conversation) SetUsageEmbeddingTokens(value int)

func (*Conversation) SetUsageInputTokens

func (c *Conversation) SetUsageInputTokens(value int)

func (*Conversation) SetUsageOutputTokens

func (c *Conversation) SetUsageOutputTokens(value int)

func (*Conversation) SetVisibility

func (c *Conversation) SetVisibility(value string)

type ConversationHas

type ConversationHas struct {
	Id                       bool
	Summary                  bool
	AgentId                  bool
	ConversationParentId     bool
	ConversationParentTurnId bool
	Title                    bool
	Visibility               bool
	CreatedAt                bool
	UpdatedAt                bool
	LastActivity             bool
	UsageInputTokens         bool
	UsageOutputTokens        bool
	UsageEmbeddingTokens     bool
	CreatedByUserID          bool
	DefaultModelProvider     bool
	DefaultModel             bool
	DefaultModelParams       bool
	Metadata                 bool
	Scheduled                bool
	ScheduleId               bool
	ScheduleRunId            bool
	ScheduleKind             bool
	ScheduleTimezone         bool
	ScheduleCronExpr         bool
	Status                   bool
}

type ConversationSlice

type ConversationSlice []*Conversation

func (ConversationSlice) IndexById

func (c ConversationSlice) IndexById() IndexedConversation

type Conversations

type Conversations struct {
	Conversations []*Conversation
}

type Handler

type Handler struct{}

func (*Handler) Exec

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

type IndexedConversation

type IndexedConversation map[string]*Conversation

type Input

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

	CurConversationsId *struct{ Values []string } `` /* 126-byte string literal not displayed */

	CurConversation []*Conversation `parameter:",kind=view,in=CurConversation" view:"CurConversation" sql:"uri=sql/cur_conversation.sql"`

	CurConversationById IndexedConversation
}

func (*Input) EmbedFS

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

func (*Input) Init

func (i *Input) Init(ctx context.Context, sess handler.Session, output *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            []*Conversation        `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