v0.5.1
Conversation convenience helpers
One additive feature plus internal refactors. No breaking changes.
or/llm — build and read conversations with less boilerplate
The common "send some text" path no longer needs nested struct literals. The underlying Context, Message, and content types are unchanged and remain fully general.
New constructors:
Prompt(text)/PromptWithSystem(system, user)— build aContextfrom textUserText/AssistantText— single-text messagesUserImage(data, mime)— single-image user messageToolResult(callID, name, text)— tool result messageNewContext(messages...)— assemble aContext
New accessors on AssistantMessage:
Text()— all text blocks joinedToolCalls()— every tool call, in order
A minimal completion drops from ~14 lines to 3:
resp, err := llm.Complete(ctx, model, llm.Prompt("Explain Go channels briefly."), llm.StreamOptions{})
if err != nil { log.Fatal(err) }
fmt.Println(resp.Text())Internal
- Conversation types now live in their own file, separate from
Model - Model catalog is stored as a flat array
- Expanded adapter/agent documentation
Examples and docs use the new helpers; longhand remains valid for mixed content such as text plus images.