Documentation
¶
Overview ¶
Package dshgo embeds omnix's model, event and tool interfaces in a bounded, cancellable desktop conversation. It starts no process or server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Conversation ¶
type Conversation struct {
// contains filtered or unexported fields
}
Conversation serializes turns and owns bounded in-memory history. API keys belong to the adapter and are never included in History or event logs.
func New ¶
func New(o Options) (*Conversation, error)
New creates a conversation without network traffic or background goroutines.
func (*Conversation) Cancel ¶
func (c *Conversation) Cancel()
Cancel cancels the current turn, if any, without blocking the UI thread.
func (*Conversation) Close ¶
func (c *Conversation) Close() error
Close prevents new turns and cancels current work. Cooperative tools unwind asynchronously; Close never waits for a tool which might need the UI thread.
func (*Conversation) History ¶
func (c *Conversation) History() []llm.Message
History returns an independent JSON-compatible copy of completed turns.
type DeepSeek ¶
type DeepSeek struct {
// contains filtered or unexported fields
}
DeepSeek implements dsh-go's LLMAdapter with native function-call messages.
func NewDeepSeek ¶
func NewDeepSeek(o DeepSeekOptions) (*DeepSeek, error)
NewDeepSeek creates an adapter without making a request. Supplied clients retain their transport and timeout, but redirects are refused to protect keys.
type DeepSeekOptions ¶
DeepSeekOptions configures the Go HTTP/SSE adapter. BaseURL may point to a compatible local model server. HTTPS is required except for loopback hosts.
type Event ¶
Event reports incremental text and tool activity. Emit runs synchronously on Run's caller goroutine: use Window.Update before changing native UI state. Callbacks may call Cancel, but must not reenter Run or History.
type HTTPError ¶
type HTTPError struct{ StatusCode int }
HTTPError reports status without copying provider response bodies or secrets.
type Options ¶
type Options struct {
Adapter llm.LLMAdapter
Model, System string
Tools []Tool
// Approve runs on the turn's worker, before executing a protected tool.
// A nil callback denies protected tools. It must respect cancellation.
Approve func(context.Context, llm.ToolCall) (bool, error)
MaxSteps, MaxToolCalls, MaxTokens, MaxTurnBytes, MaxHistoryBytes, HistoryTurns int
Timeout time.Duration
}
Options is copied by New. The adapter must serialize callbacks within Chat and return only after its callbacks finish; adapters and tools must honor ctx.