Documentation
¶
Overview ¶
Package llm provides the LLM client abstraction that wraps a provider with common functionality and event bus integration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a provider with common functionality. It provides a higher-level interface for LLM interactions with automatic event bus integration for streaming responses.
func (*Client) Chat ¶
func (c *Client) Chat(ctx context.Context, req provider.ChatRequest) (*provider.ChatResponse, error)
Chat sends a non-streaming request to the LLM provider.
func (*Client) Stream ¶
func (c *Client) Stream(ctx context.Context, sessionID string, req provider.ChatRequest) (*provider.ChatResponse, error)
Stream sends a streaming request to the LLM and publishes events to the event bus. It returns the full accumulated response when the stream completes.
Event types published:
- EventMessageDelta: for each text_delta and thinking_delta chunk
- EventError: if the provider returns an error
- EventDone: when the stream completes (always published, even on error)
Click to show internal directories.
Click to hide internal directories.