write

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 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"`
	AgentName            string           `sqlx:"agent_name" `
	Title                *string          `sqlx:"title" json:",omitempty"`
	Visibility           *string          `sqlx:"visibility" json:",omitempty"`
	CreatedAt            *time.Time       `sqlx:"created_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"`
	Has                  *ConversationHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

func (*Conversation) SetAgentName

func (c *Conversation) SetAgentName(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) SetSummary

func (c *Conversation) SetSummary(value string)

func (*Conversation) SetTitle

func (c *Conversation) SetTitle(value string)

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
	AgentName            bool
	Title                bool
	Visibility           bool
	CreatedAt            bool
	LastActivity         bool
	UsageInputTokens     bool
	UsageOutputTokens    bool
	UsageEmbeddingTokens bool
	CreatedByUserID      bool
	DefaultModelProvider bool
	DefaultModel         bool
	DefaultModelParams   bool
	Metadata             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