Documentation
¶
Index ¶
- Variables
- func DebugEnabled() bool
- type Client
- type Conversation
- type GeneratedFile
- type GeneratedFileClient
- type GetRequest
- type GetResponse
- type IndexedMessages
- type Input
- type Message
- type MessageOption
- func WithArchived(v int) MessageOption
- func WithAttachmentPayloadID(id string) MessageOption
- func WithContent(content string) MessageOption
- func WithContextSummary(s string) MessageOption
- func WithConversationID(id string) MessageOption
- func WithCreatedAt(t time.Time) MessageOption
- func WithCreatedByUserID(id string) MessageOption
- func WithElicitationID(id string) MessageOption
- func WithElicitationPayloadID(id string) MessageOption
- func WithId(id string) MessageOption
- func WithInterim(v int) MessageOption
- func WithLinkedConversationID(id string) MessageOption
- func WithMode(mode string) MessageOption
- func WithParentMessageID(id string) MessageOption
- func WithRawContent(content string) MessageOption
- func WithRole(role string) MessageOption
- func WithSequence(v int) MessageOption
- func WithStatus(status string) MessageOption
- func WithSupersededBy(id string) MessageOption
- func WithTags(s string) MessageOption
- func WithToolName(name string) MessageOption
- func WithTurnID(id string) MessageOption
- func WithType(typ string) MessageOption
- func WithUpdatedAt(t time.Time) MessageOption
- type Messages
- type MutableConversation
- type MutableGeneratedFile
- type MutableMessage
- type MutableModelCall
- type MutablePayload
- type MutableToolCall
- type MutableTurn
- type Option
- type Payload
- type ResponsePayloadView
- type Service
- type ToolCallView
- type Transcript
- func (t *Transcript) Filter(f func(v *Message) bool) Messages
- func (t *Transcript) History(minimal bool) []*prompt.Message
- func (t Transcript) Last() Transcript
- func (t *Transcript) LastAssistantMessage() *Message
- func (t *Transcript) LastAssistantMessageWithModelCall() *Message
- func (t *Transcript) LastElicitationMessage() *Message
- func (t Transcript) UniqueToolNames() []string
- type Turn
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidInput = errInvalidInput{}
ErrInvalidInput is returned when required inputs are missing.
Functions ¶
func DebugEnabled ¶ added in v0.2.53
func DebugEnabled() bool
DebugEnabled reports whether conversation debug logging is enabled. Enable with AGENTLY_SCHEDULER_DEBUG=1 (or true/yes/on). Legacy env (deprecated): AGENTLY_CONVERSATION_DEBUG.
Types ¶
type Client ¶
type Client interface {
GetConversation(ctx context.Context, id string, options ...Option) (*Conversation, error)
GetConversations(ctx context.Context, input *Input) ([]*Conversation, error)
PatchConversations(ctx context.Context, conversations *MutableConversation) error
GetPayload(ctx context.Context, id string) (*Payload, error)
PatchPayload(ctx context.Context, payload *MutablePayload) error
PatchMessage(ctx context.Context, message *MutableMessage) error
GetMessage(ctx context.Context, id string, options ...Option) (*Message, error)
GetMessageByElicitation(ctx context.Context, conversationID, elicitationID string) (*Message, error)
PatchModelCall(ctx context.Context, modelCall *MutableModelCall) error
PatchToolCall(ctx context.Context, toolCall *MutableToolCall) error
PatchTurn(ctx context.Context, turn *MutableTurn) error
DeleteConversation(ctx context.Context, id string) error
// DeleteMessage removes a message from the conversation and internal indexes.
DeleteMessage(ctx context.Context, conversationID, messageID string) error
}
type Conversation ¶
type Conversation agconv.ConversationView
func (*Conversation) GetTranscript ¶
func (c *Conversation) GetTranscript() Transcript
func (*Conversation) HasConversationParent ¶ added in v0.2.2
func (c *Conversation) HasConversationParent() bool
type GeneratedFile ¶ added in v0.2.59
type GeneratedFile = gfread.GeneratedFileView
type GeneratedFileClient ¶ added in v0.2.59
type GeneratedFileClient interface {
GetGeneratedFiles(ctx context.Context, input *gfread.Input) ([]*gfread.GeneratedFileView, error)
PatchGeneratedFile(ctx context.Context, generatedFile *gfwrite.GeneratedFile) error
}
GeneratedFileClient is an optional extension implemented by concrete conversation clients that support generated-file persistence.
type GetRequest ¶
GetRequest defines parameters to retrieve a conversation view.
type GetResponse ¶
type GetResponse struct {
Conversation *Conversation
}
GetResponse wraps the conversation view.
type IndexedMessages ¶ added in v0.2.18
func (IndexedMessages) BuildMatchIndex ¶ added in v0.2.18
BuildMatchIndex returns a set of tool-call opIds that should be included for a continuation anchored at anchorID/anchorTime.
type Input ¶
type Input = agconv.ConversationInput
type Message ¶
type Message agconv.MessageView
func (*Message) GetContent ¶ added in v0.2.6
GetContent returns the printable content for this message. - For tool-call messages, it prefers the response payload inline body. - For user/assistant messages, it returns the message content field.
func (*Message) GetContentPreferContent ¶ added in v0.2.28
func (*Message) IsArchived ¶ added in v0.2.1
func (*Message) NewMutable ¶ added in v0.2.2
func (m *Message) NewMutable() *MutableMessage
func (*Message) ToolCallArguments ¶ added in v0.2.6
ToolCallArguments returns parsed arguments for a tool-call message. It prefers the request payload inline JSON body when present. When parsing fails or no payload is present, it returns an empty map.
type MessageOption ¶ added in v0.2.2
type MessageOption func(m *MutableMessage)
MessageOption configures a MutableMessage prior to persistence.
func WithArchived ¶ added in v0.2.2
func WithArchived(v int) MessageOption
func WithAttachmentPayloadID ¶ added in v0.2.2
func WithAttachmentPayloadID(id string) MessageOption
func WithContent ¶ added in v0.2.2
func WithContent(content string) MessageOption
func WithContextSummary ¶ added in v0.2.2
func WithContextSummary(s string) MessageOption
Optional summaries/tags (set via raw fields when no setter exists)
func WithConversationID ¶ added in v0.2.2
func WithConversationID(id string) MessageOption
func WithCreatedAt ¶ added in v0.2.2
func WithCreatedAt(t time.Time) MessageOption
Metadata and attribution
func WithCreatedByUserID ¶ added in v0.2.2
func WithCreatedByUserID(id string) MessageOption
func WithElicitationID ¶ added in v0.2.2
func WithElicitationID(id string) MessageOption
func WithElicitationPayloadID ¶ added in v0.2.2
func WithElicitationPayloadID(id string) MessageOption
func WithInterim ¶ added in v0.2.2
func WithInterim(v int) MessageOption
func WithLinkedConversationID ¶ added in v0.2.2
func WithLinkedConversationID(id string) MessageOption
func WithMode ¶ added in v0.2.2
func WithMode(mode string) MessageOption
func WithParentMessageID ¶ added in v0.2.2
func WithParentMessageID(id string) MessageOption
func WithRawContent ¶ added in v0.2.25
func WithRawContent(content string) MessageOption
func WithRole ¶ added in v0.2.2
func WithRole(role string) MessageOption
Message content and semantics
func WithSequence ¶ added in v0.2.2
func WithSequence(v int) MessageOption
func WithStatus ¶ added in v0.2.2
func WithStatus(status string) MessageOption
func WithSupersededBy ¶ added in v0.2.2
func WithSupersededBy(id string) MessageOption
func WithTags ¶ added in v0.2.2
func WithTags(s string) MessageOption
func WithToolName ¶ added in v0.2.2
func WithToolName(name string) MessageOption
func WithTurnID ¶ added in v0.2.2
func WithTurnID(id string) MessageOption
func WithType ¶ added in v0.2.2
func WithType(typ string) MessageOption
func WithUpdatedAt ¶ added in v0.2.2
func WithUpdatedAt(t time.Time) MessageOption
type Messages ¶
type Messages []*Message
func (Messages) LatestByCreatedAt ¶ added in v0.2.18
LatestByCreatedAt returns the last non-nil message by CreatedAt timestamp. When messages are empty or all nil, it returns nil.
func (Messages) SortByCreatedAt ¶
SortByCreatedAt sorts the messages in-place by CreatedAt. When asc is true, earlier messages come first; otherwise latest first.
func (Messages) SortedByCreatedAt ¶
SortedByCreatedAt returns a new slice with messages ordered by CreatedAt. When asc is true, earlier messages come first; otherwise latest first.
type MutableConversation ¶
type MutableConversation = convw.Conversation
func NewConversation ¶
func NewConversation() *MutableConversation
NewConversation allocates a mutable conversation with Has populated.
type MutableGeneratedFile ¶ added in v0.2.59
type MutableGeneratedFile = gfwrite.GeneratedFile
func NewGeneratedFile ¶ added in v0.2.59
func NewGeneratedFile() *MutableGeneratedFile
NewGeneratedFile allocates a mutable generated file with Has populated.
type MutableMessage ¶
func AddMessage ¶ added in v0.2.2
func AddMessage(ctx context.Context, cl Client, turn *memory.TurnMeta, opts ...MessageOption) (*MutableMessage, error)
AddMessage creates and persists a message attached to the given turn using the provided options. It sets sensible defaults: id (uuid), conversation/turn/parent ids from turn, and type "text" unless overridden. Returns the message id.
func NewMessage ¶
func NewMessage() *MutableMessage
NewMessage allocates a mutable message with Has populated.
type MutableModelCall ¶
func NewModelCall ¶
func NewModelCall() *MutableModelCall
NewModelCall allocates a mutable model call with Has populated.
type MutablePayload ¶
func NewPayload ¶
func NewPayload() *MutablePayload
NewPayload allocates a mutable payload with Has populated.
type MutableToolCall ¶
func NewToolCall ¶
func NewToolCall() *MutableToolCall
NewToolCall allocates a mutable tool call with Has populated.
type MutableTurn ¶
type Option ¶
type Option func(input *Input)
func WithIncludeModelCall ¶
func WithIncludeToolCall ¶
func WithToolFeedSpec ¶ added in v0.2.1
WithToolFeedSpec populates the transient FeedSpec list on the input so that OnRelation hooks can compute tool executions based on metadata.
type Payload ¶
type Payload = payloadread.PayloadView
type ResponsePayloadView ¶ added in v0.2.25
type ResponsePayloadView = agconv.ResponsePayloadView
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a thin wrapper around API to support request/response types.
func NewService ¶
func (*Service) Get ¶
func (s *Service) Get(ctx context.Context, req GetRequest) (*GetResponse, error)
Get fetches a conversation based on the request fields.
type ToolCallView ¶ added in v0.2.25
type ToolCallView = agconv.ToolCallView
type Transcript ¶
type Transcript []*Turn
func (Transcript) Last ¶ added in v0.2.2
func (t Transcript) Last() Transcript
func (*Transcript) LastAssistantMessage ¶ added in v0.2.18
func (t *Transcript) LastAssistantMessage() *Message
LastAssistantMessage returns the last assistant text message in this transcript. It scans turns from the end and messages from the end to preserve chronology.
func (*Transcript) LastAssistantMessageWithModelCall ¶ added in v0.2.21
func (t *Transcript) LastAssistantMessageWithModelCall() *Message
LastAssistantMessageWithModelCall returns the last assistant text message in this transcript that has a model call. It scans turns from the end and messages from the end to preserve chronology.
func (*Transcript) LastElicitationMessage ¶ added in v0.2.21
func (t *Transcript) LastElicitationMessage() *Message
func (Transcript) UniqueToolNames ¶ added in v0.2.1
func (t Transcript) UniqueToolNames() []string
UniqueToolNames returns a de-duplicated list of tool names (service/method) observed across all messages in the transcript, preserving encounter order.
type Turn ¶
type Turn agconv.TranscriptView