Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Compact(ctx context.Context, req adapters.CompactRequest) (adapters.CompactResponse, error)
- func (c *Client) Decide(ctx context.Context, req adapters.DecideRequest) (adapters.DecideResponse, error)
- func (c *Client) Extract(ctx context.Context, req adapters.ExtractRequest) (adapters.ExtractResponse, error)
- type Config
Constants ¶
View Source
const ( OperationExtract = "extract" OperationDecide = "decide" OperationCompact = "compact" )
Operation names reported to Config.OnUsage.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements adapters.LLM using the Twilight AI SDK.
func (*Client) Compact ¶
func (c *Client) Compact(ctx context.Context, req adapters.CompactRequest) (adapters.CompactResponse, error)
func (*Client) Decide ¶
func (c *Client) Decide(ctx context.Context, req adapters.DecideRequest) (adapters.DecideResponse, error)
func (*Client) Extract ¶
func (c *Client) Extract(ctx context.Context, req adapters.ExtractRequest) (adapters.ExtractResponse, error)
type Config ¶
type Config struct {
ModelID string
BaseURL string
APIKey string `json:"-"`
ClientType string
ChatCompletionsCompat string
Timeout time.Duration
PromptCacheTTL string
// Logger, when set, records the failed calls that are made again.
Logger *slog.Logger
// OnUsage, when set, receives the token usage of every successful call.
// Memory calls never produce a chat message, so this is the only place
// their cost becomes visible.
OnUsage func(ctx context.Context, operation string, usage sdk.Usage)
}
Config holds model resolution details for the memory LLM.
Click to show internal directories.
Click to hide internal directories.