message

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const Name = "message"

Variables

This section is empty.

Functions

This section is empty.

Types

type AskUserInput

type AskUserInput struct {
	Message string                 `json:"message" description:"The question or prompt to display to the user."`
	Schema  map[string]interface{} `json:"schema,omitempty" description:"Optional JSON Schema for the expected user response."`
}

AskUserInput is the tool input for message-askUser.

type AskUserOutput

type AskUserOutput struct {
	Action  string                 `json:"action"`
	Payload map[string]interface{} `json:"payload,omitempty"`
}

AskUserOutput is the tool result for message-askUser.

type Candidate

type Candidate struct {
	MessageID string `json:"messageId"`
	Type      string `json:"type"`
	Role      string `json:"role,omitempty"`
	ToolName  string `json:"toolName,omitempty"`
	Preview   string `json:"preview"`
	ByteSize  int    `json:"byteSize"`
	TokenSize int    `json:"tokenSize"`
}

type CompactInput

type CompactInput struct {
	MaxTokens      int    `json:"maxTokens" description:"Target total token budget for retained messages."`
	Strategy       string `` /* 146-byte string literal not displayed */
	PreservePinned bool   `json:"preservePinned,omitempty" description:"Reserved for future use (no effect in v1)."`
}

type CompactOutput

type CompactOutput struct {
	RemovedCount int `json:"removedCount"`
	FreedTokens  int `json:"freedTokens"`
	KeptTokens   int `json:"keptTokens"`
}

type DebugInfo

type DebugInfo struct {
	Source     string `json:"source,omitempty"`
	RawLen     int    `json:"rawLen,omitempty"`
	RawPreview string `json:"rawPreview,omitempty"`
}

type Elicitor

type Elicitor interface {
	Elicit(ctx context.Context, turn *memory.TurnMeta, role string, req *plan.Elicitation) (messageID string, status string, payload map[string]interface{}, err error)
}

Elicitor abstracts the elicitation service to avoid a direct import cycle.

type ListCandidatesInput

type ListCandidatesInput struct {
	// Max number of candidates to return (default: 50)
	Limit int `json:"limit,omitempty" description:"Max number of candidates to return (default 50)."`
	// Types filter (user, assistant, tool). Empty = all
	Types []string `json:"types,omitempty" description:"Optional types to include: user, assistant, tool."`
}

type ListCandidatesOutput

type ListCandidatesOutput struct {
	Candidates []Candidate `json:"candidates"`
}

type MatchFragment

type MatchFragment struct {
	Offset  int     `json:"offset"`
	Limit   int     `json:"limit"`
	Score   float64 `json:"score"`
	Content string  `json:"content"`
}

type MatchInput

type MatchInput struct {
	MessageID string `json:"messageId"`
	Query     string `json:"query"`
	TopK      int    `json:"topK,omitempty"`
}

type MatchOutput

type MatchOutput struct {
	Size      int             `json:"size"`
	Fragments []MatchFragment `json:"fragments"`
}

type Option

type Option func(*Service)

Option configures optional dependencies on the message service.

func WithElicitor

func WithElicitor(e Elicitor) Option

WithElicitor sets the elicitation dependency for the askUser tool.

type RemoveInput

type RemoveInput struct {
	Tuples []RemoveTuple `json:"tuples"`
}

type RemoveOutput

type RemoveOutput struct {
	CreatedSummaryMessageIds []string `json:"createdSummaryMessageIds"`
	ArchivedMessages         int      `json:"archivedMessages"`
}

type RemoveTuple

type RemoveTuple struct {
	Summary    string   `json:"summary" description:"summary to associate with removed messages"`
	MessageIds []string `json:"messageIds"`
	Role       string   `json:"role,omitempty"`
}

type Service

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

Service provides message utilities exposed to agents.

func New

func New(conv apiconv.Client) *Service

New creates a basic service; summarization/match require dependencies set via options or NewWithDeps.

func NewWithDeps

func NewWithDeps(conv apiconv.Client, core coreGen, emb embedder.Finder, summarizeChunk, matchChunk int, summaryModel, summaryPrompt, defaultModel, embedModel string, opts ...Option) *Service

NewWithDeps provides full dependencies for summarize/match operations.

func (*Service) Method

func (s *Service) Method(name string) (svc.Executable, error)

func (*Service) Methods

func (s *Service) Methods() svc.Signatures

func (*Service) Name

func (s *Service) Name() string

type ShowInput

type ShowInput struct {
	MessageID string             `json:"messageId"`
	ByteRange *textutil.IntRange `json:"byteRange,omitempty" description:"Optional byte range [from,to) over the selected content."`
	Sed       []string           `json:"sed,omitempty" description:"List of sed programs applied in order to the selected content."`
	Transform *TransformSpec     `json:"transform,omitempty" description:"Transform with selector+fields or queryLanguage+query, then format as csv or ndjson."`
}

type ShowOutput

type ShowOutput struct {
	Content string `json:"content"`
	Offset  int    `json:"offset"`
	Limit   int    `json:"limit"`
	Size    int    `json:"size"`
	// Continuation carries paging/truncation hints when only part of the message is returned.
	Continuation *extension.Continuation `json:"continuation,omitempty"`
}

type SummarizeChunk

type SummarizeChunk struct {
	Offset  int    `json:"offset"`
	Limit   int    `json:"limit"`
	Summary string `json:"summary"`
}

type SummarizeInput

type SummarizeInput struct {
	Body      string `json:"body" internal:"true"`
	MessageID string `json:"messageId"`
	Chunk     int    `json:"chunk,omitempty"`
	Page      int    `json:"page,omitempty"`
	PerPage   int    `json:"perPage,omitempty"`
}

type SummarizeOutput

type SummarizeOutput struct {
	Size        int              `json:"size"`
	Chunks      []SummarizeChunk `json:"chunks"`
	Summary     string           `json:"summary"`
	TotalChunks int              `json:"totalChunks"`
	TotalPages  int              `json:"totalPages"`
	Page        int              `json:"page"`
	PerPage     int              `json:"perPage"`
}

type TransformSpec

type TransformSpec struct {
	Selector string   `json:"selector,omitempty" description:"Simple dot-path (e.g., data or data.items). No wildcards or object construction."`
	Format   string   `json:"format,omitempty" description:"Output format" choices:"csv,ndjson"`
	Fields   []string `json:"fields,omitempty" description:"CSV column order; derived when empty."`
	MaxRows  int      `json:"maxRows,omitempty" description:"Row cap (0 = no cap)."`
}

Jump to

Keyboard shortcuts

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