Documentation
¶
Index ¶
- func ConfigureThread(ctx *lmcli.Context, thread *conversation.Thread) error
- func ConsumeEvents(ctx *lmcli.Context, events <-chan api.Event, ...) error
- func FormatForExternalPrompt(messages []conversation.Message, system bool) string
- func LookupConversation(ctx *lmcli.Context, shortName string) *conversation.Conversation
- func LookupConversationE(ctx *lmcli.Context, shortName string) (*conversation.Conversation, error)
- func NewSandboxConfig(ctx *lmcli.Context, conv *conversation.Conversation) (*sandbox.ToolSandboxConfig, error)
- func RenderConversation(ctx *lmcli.Context, messages []conversation.Message, spaceForResponse bool)
- func RenderMessage(ctx *lmcli.Context, m *conversation.Message)
- func StartThread(cmd *cobra.Command, ctx *lmcli.Context, thread *conversation.Thread)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureThread ¶
func ConfigureThread(ctx *lmcli.Context, thread *conversation.Thread) error
ConfigureThread sets the thread's Agent, Model, and Effort from the application context.
func ConsumeEvents ¶
func ConsumeEvents(ctx *lmcli.Context, events <-chan api.Event, approval chan<- []api.ToolConfirmation, thread *conversation.Thread, showThinking bool) error
ConsumeEvents iterates events from Thread.Run, streaming output to stdout with a wait animation and auto-approving tool calls. Tool calls and their results are rendered inline as they occur. If thread.Persistent is true, produced messages are appended to the thread and persisted after each round.
func FormatForExternalPrompt ¶
func FormatForExternalPrompt(messages []conversation.Message, system bool) string
func LookupConversation ¶
func LookupConversation(ctx *lmcli.Context, shortName string) *conversation.Conversation
lookupConversation either returns the conversation found by the short name or exits the program
func LookupConversationE ¶
func LookupConversationE(ctx *lmcli.Context, shortName string) (*conversation.Conversation, error)
func NewSandboxConfig ¶
func NewSandboxConfig(ctx *lmcli.Context, conv *conversation.Conversation) (*sandbox.ToolSandboxConfig, error)
NewSandboxConfig builds a ToolSandboxConfig from the application context and an optional conversation. The workspace is resolved from the conversation's Workspace field or the current working directory.
func RenderConversation ¶
func RenderConversation(ctx *lmcli.Context, messages []conversation.Message, spaceForResponse bool)
RenderConversation renders the given messages to TTY, with optional space for a subsequent message. spaceForResponse controls how many '\n' characters are printed immediately after the final message (1 if false, 2 if true). Message blocks are built in parallel for faster rendering.
func RenderMessage ¶
func RenderMessage(ctx *lmcli.Context, m *conversation.Message)
func StartThread ¶
StartThread configures the thread from the application context, renders existing messages, runs the completion loop (streaming output to stdout with auto-approved tool calls), and persists all produced messages.
Types ¶
This section is empty.