Skip to content

Commit 90da60e

Browse files
authored
docs: clarify stable subpackages + deprecate client-level continuation (#31)
Two related eyrie doc improvements: 1. **runtime package doc** — the previous text said 'Import eyrie/runtime — not catalog/setup/config directly', but hawk (and other consumers) actually import a wider set of subpackages. The stable surface is cooperating subpackages, not just runtime. List them explicitly so contributors don't get confused. hawk imports 8 distinct subpackages of eyrie: - runtime (bootstrap facade: Load, ChatProvider, etc.) - client (Provider interface, message/response types) - catalog (model catalog: pricing, capabilities) - catalog/registry (ProviderSpec catalog: 16 registered providers) - catalog/xiaomi (Xiaomi-specific catalog helpers) - config (provider config + env var resolution) - credentials (OS keyring + OIDC keyless CI auth) - setup (CLI/setup wiring, RoutingPreviewJSON) - storage (conversation DAG persistence, embedded server) All are part of the public API; changes are gated by semver. Anything under internal/ is implementation detail and may change without notice. 2. **deprecate StreamChatWithContinuation** — there are now three continuation mechanisms in the eyrie/hawk ecosystem and the client-level one is the least attractive: a. Engine-level (eyrie/conversation) — uses OutputGroupID to collapse continuation chunks; no synthetic 'Continue.' user turn. Cleanest conversation shape. b. Hawk Session loop (hawk/internal/engine/stream.go) — its own max_tokens recovery (the recoveryCount loop) that only kicks in for no-tool-call continuations. Also clean. c. Client-level (this function) — appends 'Continue.' user turn and emits 'continuation' event markers. Works but pollutes the conversation with synthetic user messages. Mark (c) deprecated in favor of (a) and (b). Behaviour unchanged; will be removed in eyrie v0.3.0.
1 parent c9769ec commit 90da60e

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

client/continuation.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,20 @@ func ChatWithContinuation(ctx context.Context, p Provider, messages []EyrieMessa
9898
// the response stops with "max_tokens" and contains only text (no tool calls).
9999
// It returns a StreamResult whose Events channel transparently continues across
100100
// multiple LLM calls, emitting a "continuation" event at each boundary.
101+
//
102+
// DEPRECATION NOTE: hawk's Session loop has its own max_tokens recovery
103+
// (internal/engine/stream.go around the `recoveryCount` loop) that doesn't
104+
// add a synthetic "Continue." user message, and the eyrie conversation
105+
// engine (eyrie/conversation.Engine) has its own OutputGroupID-based
106+
// engine-level continuation. The two engine-level paths produce cleaner
107+
// conversation shapes (no synthetic user turns) and are the recommended
108+
// pattern for new code. This client-level helper remains for
109+
// backwards-compatibility with the embedded eyrie HTTP server and
110+
// non-hawk consumers; new code should implement continuation at the
111+
// engine or call-site level instead.
112+
//
113+
// Will be removed in eyrie v0.3.0. See eyrie/CHANGELOG.md for the
114+
// deprecation timeline.
101115
func StreamChatWithContinuation(ctx context.Context, p Provider, messages []EyrieMessage, opts ChatOptions, cfg ContinuationConfig) (*StreamResult, error) {
102116
if cfg.MaxContinuations <= 0 {
103117
cfg.MaxContinuations = 3

runtime/runtime.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
// Package runtime is the only stable API surface for host applications (e.g. hawk).
2-
// Import github.com/GrayCodeAI/eyrie/runtime — not catalog/setup/config directly.
1+
// Package runtime is the **recommended entry point** for host applications
2+
// (e.g. hawk). Start by calling runtime.Load to get a *Runtime, then
3+
// rt.ChatProvider to obtain a client.Provider that you can hand to your
4+
// agent loop.
5+
//
6+
// Note: the "stable" surface of eyrie is actually a set of cooperating
7+
// subpackages, not just this one. The full list hawk (and other host
8+
// applications) actually import is:
9+
//
10+
// github.com/GrayCodeAI/eyrie/runtime (this package — bootstrap facade)
11+
// github.com/GrayCodeAI/eyrie/client (Provider interface, message/response types)
12+
// github.com/GrayCodeAI/eyrie/catalog (model catalog: pricing, capabilities, registry)
13+
// github.com/GrayCodeAI/eyrie/catalog/registry (ProviderSpec catalog: 16 registered providers)
14+
// github.com/GrayCodeAI/eyrie/catalog/xiaomi (Xiaomi-specific catalog helpers)
15+
// github.com/GrayCodeAI/eyrie/config (provider config + env var resolution)
16+
// github.com/GrayCodeAI/eyrie/credentials (OS keyring + OIDC keyless CI auth)
17+
// github.com/GrayCodeAI/eyrie/setup (CLI/setup wiring, RoutingPreviewJSON)
18+
// github.com/GrayCodeAI/eyrie/storage (conversation DAG persistence)
19+
//
20+
// They are all considered part of the public API; changes to exported
21+
// names are gated by semver. Anything under internal/ is implementation
22+
// detail and may change without notice.
323
package runtime
424

525
import (

0 commit comments

Comments
 (0)