Skip to content

Releases: ktsoator/or

v0.5.3

Choose a tag to compare

@ktsoator ktsoator released this 29 Jun 01:45
8d6a424

Maintenance: internal refactors and dependency updates

A patch release with no public API changes. The llm and agent APIs are unchanged, so applications need no code changes to upgrade.

Internal structure

  • JSON recovery helpers — string repair and truncation completion — moved into an internal llm/internal/jsonx package. The public tool-argument API (ParseToolArguments, ParseToolArgumentsMode, ArgumentsMode) is unchanged.
  • The model-catalog generator moved from internal/genmodels to llm/internal/genmodels, colocating it with the package it generates, with its go:generate path and docs corrected.
  • Tidied internal source comments.

Dependencies

  • Bumped github.com/anthropics/anthropic-sdk-go to v1.52.0.
  • Bumped CI actions (actions/checkout, actions/setup-python).

Documentation

  • The agent getting-started guide now prints the final answer.

Verified with go build ./... and go test ./....

v0.5.2

Choose a tag to compare

@ktsoator ktsoator released this 28 Jun 11:32
a5210c2

Importable provider packages and expanded docs

One packaging refactor plus documentation expansion. Existing llm APIs remain in place, but applications now import the provider packages they want to register.

or/llm — import only the providers you use

The LLM core is now a public llm package, while provider adapters live in importable packages:

  • github.com/ktsoator/or/llm/openai
  • github.com/ktsoator/or/llm/anthropic
  • github.com/ktsoator/or/llm/all

Import a provider, often as a blank import, to register its protocol. This lets binaries link only the vendor SDKs for the providers they actually use.

or/agent — custom message projection helper

Adds agent.ToLLM, the inverse of agent.FromLLM, for custom ConvertToLLM implementations that need to pass standard llm messages through while projecting UI-only message types.

Documentation

The docs site is now much more complete:

  • Expanded LLM guides with runnable examples.
  • New Agent guide pages for tools, events, steering, hooks, messages, configuration, and RunLoop.
  • New internals docs for models, messages, adapters, streaming, and model switching.
  • English and Simplified Chinese pages kept in sync across the new docs.

Verified with go test ./.... Local mkdocs build --strict was skipped because mkdocs is not installed in this environment.

v0.5.1

Choose a tag to compare

@ktsoator ktsoator released this 25 Jun 03:13
11c0b0c

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 a Context from text
  • UserText / AssistantText — single-text messages
  • UserImage(data, mime) — single-image user message
  • ToolResult(callID, name, text) — tool result message
  • NewContext(messages...) — assemble a Context

New accessors on AssistantMessage:

  • Text() — all text blocks joined
  • ToolCalls() — 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.

v0.5.0

Choose a tag to compare

@ktsoator ktsoator released this 23 Jun 06:07
1e7369f

Runtime reconfiguration and request rewriting

Two additive features. No breaking changes.

or/agent — reconfigure between runs

The stateful Agent can now be reconfigured without building a new one. New setters take effect on the next run and do not disturb a run already in progress:

  • SetSystemPrompt(string)
  • SetModel(llm.Model)
  • SetThinkingLevel(llm.ModelThinkingLevel)
  • SetTools([]AgentTool) (the slice is copied)
  • SetToolExecution(ExecutionMode)

This covers switching models, enabling/disabling tools, or editing the system prompt between prompts — previously those were fixed at New().

or/llm — rewrite the request body

New StreamOptions.RewriteRequest hook:

RewriteRequest func(method, url string, body []byte) []byte

It transforms the serialized request body before it is sent (returning nil leaves it unchanged) — the mutating counterpart to the observe-only OnRequest, and an escape hatch for provider-specific fields the typed API does not expose. It fires once per attempt and always rewrites the original body, so retries stay consistent. Available on the Agent too via Options.StreamOptions.

Both features are wired across the anthropic and openai providers and covered by tests.

v0.4.0

Choose a tag to compare

@ktsoator ktsoator released this 23 Jun 05:20
efe7796

or/agent — agent-core complete

This release rounds out the or/agent package: the stateful Agent now exposes live run state, accepts more per-request options, and resumes more flexibly, plus hardening for misbehaving hooks and tools. The or/llm package is unchanged and backward compatible.

Highlights

  • Live run stateSnapshot() now reports StreamingMessage and PendingToolCalls, and the transcript grows incrementally during a run, so a concurrent reader sees progress without replaying events.
  • Flexible resume — when the transcript ends with an assistant message, Continue falls back to queued messages: it drains the steering queue first, then the follow-up queue, instead of erroring.
  • Request tuningOptions.StreamOptions passes Temperature, MaxTokens, Headers, and the OnRequest / OnResponse observers through to every turn.
  • Multimodal prompts — new agent.UserMessage(text, images...) builds a user message from text and images for Prompt, Steer, or FollowUp.
  • Robustness — a panic in a hook or tool is now recovered into an error result / terminal error event instead of crashing the process; a cancelled run stops executing between sequential tools.

Behavior change

  • The default steering and follow-up queue mode is now QueueOneAtATime (previously QueueAll). Each drain point injects only the oldest queued message; set SteeringMode / FollowUpMode to QueueAll for the previous behavior.

v0.3.0

Choose a tag to compare

@ktsoator ktsoator released this 22 Jun 08:32
3a6e190

or/agent — a new package

This release adds or/agent, a provider-neutral orchestration layer built on or/llm.

Highlights

  • Stateless RunLoop engine plus a stateful Agent (Prompt, Continue, Subscribe, Steer, FollowUp, Abort, Snapshot, Reset).
  • Tool loop with concurrent execution (per-tool / sequential override) and a terminate hint.
  • Hooks: BeforeToolCall, AfterToolCall, ShouldStopAfterTurn, PrepareNextTurn (including model switching across wire protocols), TransformContext, ConvertToLLM, GetAPIKey.
  • Steering and follow-up queues with QueueAll / QueueOneAtATime modes.
  • Typed tools with optional Label and PrepareArguments.
  • Three runnable examples (basic, tool, hooks) and a package README.

The or/llm package is unchanged and backward compatible.

v0.2.0

Choose a tag to compare

@ktsoator ktsoator released this 20 Jun 13:27

Overview

v0.2.0 is the first feature-complete public release of or. It establishes the core APIs for unified model access, streaming, tool calling, reasoning, request observability, and protocol extensibility. While the project remains pre-1.0, this release is the recommended baseline for new integrations.

Highlights

  • Added protocol-specific stream options and native tool-choice support for OpenAI and Anthropic.
  • Added public APIs for registering custom protocol adapters.
  • Added retry, timeout, request, and response observability options.
  • Improved reasoning persistence across multi-turn tool calls.

Reliability

  • Hardened stream lifecycle handling with exactly one terminal event.
  • Improved cancellation, panic recovery, SSE handling, and tool-argument parsing.
  • Added diagnostics for recovered tool-call arguments.

Upgrade Notes

Provider-neutral settings remain at the top level of StreamOptions. Protocol-specific settings should be supplied through ProtocolOptions.

go get github.com/ktsoator/or@v0.2.0

Full Changelog: v0.1.0...v0.2.0