chathistory

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChatHistory

func NewChatHistory(cfg ChatHistoryConfig, deps ChatHistoryDeps) (agentkit.Tool, error)

NewChatHistory registers tool/chat-history: read transport chat history on demand.

Types

type ChatHistoryConfig

type ChatHistoryConfig struct {
	DefaultLimit int `json:"defaultLimit"`
	MaxLimit     int `json:"maxLimit"`
}

type ChatHistoryDeps

type ChatHistoryDeps struct {
	// History is typically platform.default; adapted to chathistory.Router at init.
	History agentkit.Platform `json:"history"`
}

type ChatHistoryInput

type ChatHistoryInput struct {
	SessionID string `json:"sessionId,omitempty" jsonschema:"Optional delivery target; defaults to the current inbox"`
	UserID    string `json:"userId,omitempty" jsonschema:"Optional user target when sessionId is omitted"`
	Limit     int    `json:"limit,omitempty" jsonschema:"Maximum messages to return"`
	Before    string `json:"before,omitempty" jsonschema:"Pagination cursor from a previous response"`
	After     string `json:"after,omitempty" jsonschema:"Only messages after this unix timestamp (seconds)"`
	Order     string `json:"order,omitempty" jsonschema:"Sort order: asc or desc (default desc)"`
	Query     string `json:"query,omitempty" jsonschema:"Optional keyword filter applied to message content"`
	Thread    *bool  `json:"thread,omitempty" jsonschema:"When true, scope to the current thread when available (default true)"`
}

type ChatHistoryOutput

type ChatHistoryOutput struct {
	Messages []chathistory.Message `json:"messages"`
	HasMore  bool                  `json:"hasMore"`
	Cursor   string                `json:"cursor,omitempty"`
	Source   string                `json:"source,omitempty"`
	Count    int                   `json:"count"`
}

func Dispatch

func Dispatch(ctx context.Context, deps runtimeDeps, cfg ChatHistoryConfig, input ChatHistoryInput) (ChatHistoryOutput, error)

Jump to

Keyboard shortcuts

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