conversation

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetConversation(ctx context.Context, id string, options ...Option) (*Conversation, error)
	GetConversations(ctx context.Context) ([]*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) (*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
}

type Conversation

type Conversation agconv.ConversationView

func (*Conversation) GetTranscript

func (c *Conversation) GetTranscript() Transcript

type GetRequest

type GetRequest struct {
	Id               string
	Since            string
	IncludeModelCall bool
	IncludeToolCall  bool
}

GetRequest defines parameters to retrieve a conversation view.

type GetResponse

type GetResponse struct {
	Conversation *Conversation
}

GetResponse wraps the conversation view.

type Input

type Input = agconv.ConversationInput

type Message

type Message agconv.MessageView

func (*Message) IsArchived added in v0.2.1

func (m *Message) IsArchived() bool

func (*Message) IsInterim

func (m *Message) IsInterim() bool

type Messages

type Messages []*Message

func (Messages) SortByCreatedAt

func (m Messages) SortByCreatedAt(asc bool)

SortByCreatedAt sorts the messages in-place by CreatedAt. When asc is true, earlier messages come first; otherwise latest first.

func (Messages) SortedByCreatedAt

func (m Messages) SortedByCreatedAt(asc bool) Messages

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 MutableMessage

type MutableMessage = msgw.Message

func NewMessage

func NewMessage() *MutableMessage

NewMessage allocates a mutable message with Has populated.

type MutableModelCall

type MutableModelCall = mcall.ModelCall

func NewModelCall

func NewModelCall() *MutableModelCall

NewModelCall allocates a mutable model call with Has populated.

type MutablePayload

type MutablePayload = payloadw.Payload

func NewPayload

func NewPayload() *MutablePayload

NewPayload allocates a mutable payload with Has populated.

type MutableToolCall

type MutableToolCall = toolcall.ToolCall

func NewToolCall

func NewToolCall() *MutableToolCall

NewToolCall allocates a mutable tool call with Has populated.

type MutableTurn

type MutableTurn = turnw.Turn

func NewTurn

func NewTurn() *MutableTurn

NewTurn allocates a mutable turn with Has populated.

type Option

type Option func(input *Input)

func WithIncludeModelCall

func WithIncludeModelCall(include bool) Option

func WithIncludeToolCall

func WithIncludeToolCall(include bool) Option

func WithScheduledEq added in v0.2.1

func WithScheduledEq(value int) Option

WithScheduledEq applies coalesce(t.scheduled,0) = value (0 or 1).

func WithScheduledOnly added in v0.2.1

func WithScheduledOnly() Option

WithScheduledOnly is a convenience for WithScheduledEq(1).

func WithSince

func WithSince(since string) Option

WithSince sets the optional since parameter controlling transcript filtering.

func WithToolFeedSpec added in v0.2.1

func WithToolFeedSpec(ext []*tool.FeedSpec) Option

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 Service

type Service struct {
	// contains filtered or unexported fields
}

Service is a thin wrapper around API to support request/response types.

func NewService

func NewService(api Client) *Service

func (*Service) Get

func (s *Service) Get(ctx context.Context, req GetRequest) (*GetResponse, error)

Get fetches a conversation based on the request fields.

type Transcript

type Transcript []*Turn

func (*Transcript) Filter

func (t *Transcript) Filter(f func(v *Message) bool) Messages

func (*Transcript) History

func (t *Transcript) History() []*prompt.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

func (*Turn) Filter

func (t *Turn) Filter(f func(v *Message) bool) Messages

func (*Turn) GetMessages

func (t *Turn) GetMessages() Messages

func (*Turn) ToolCalls

func (t *Turn) ToolCalls() Messages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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