|
| 1 | +--- |
| 2 | +date: 2026-08-02 |
| 3 | +version: v0.17.0 |
| 4 | +feature: Example/README Model Refresh (latest provider models) |
| 5 | +product: iris |
| 6 | +change_type: docs |
| 7 | +affected_components: [README.md, examples/batch/basic/main.go, examples/chat/basic/main.go, examples/chat/conversation/main.go, examples/chat/conversation-streaming/main.go, examples/chat/streaming/main.go, examples/chat/structured-output/main.go, examples/chat/system-message/main.go, examples/chat/xai-basic/main.go, examples/chat/zai-basic/main.go, examples/chat/zai-streaming/main.go, examples/image/gemini/main.go, examples/testing/mock-provider/main.go, examples/tools/weather/main.go] |
| 8 | +related_frds: [] |
| 9 | +--- |
| 10 | + |
| 11 | +## Summary |
| 12 | + |
| 13 | +Updated the model identifiers used throughout `README.md`'s code snippets and the `examples/` programs so they demonstrate Iris against each provider's current latest models instead of older/deprecated ones. This is a documentation/example-only change: no `core/` or `providers/` production code was modified (provider `models.go` files were only read, to confirm target constant names exist). The refresh replaces the generic OpenAI small/flagship model strings (`gpt-4o-mini`, `gpt-4o`) and two typed provider constants (`xai.ModelGrok41FastNonReasoning`, `zai.ModelGLM47Flash`) with their current equivalents, and swaps the Gemini image example onto the newest image-generation constant. The xAI reasoning example intentionally stays on `grok-3-mini` (see below). |
| 14 | + |
| 15 | +## Motivation |
| 16 | + |
| 17 | +Examples are the first code a new Iris user copies and runs. Several had drifted behind the provider model catalogs (already kept current in the README's own "Supported Models" tables and in `providers/*/models.go`), so a user following the README or `go run`-ing an example would unknowingly reach for an older/soon-to-be-legacy model. This change brings example code back in line with the catalog without touching the catalog itself or the reference tables, which were already current. |
| 18 | + |
| 19 | +## What Changed |
| 20 | + |
| 21 | +### New Additions |
| 22 | + |
| 23 | +N/A — no new files, types, or exported symbols were added. This change only edits existing example programs and README code fences. |
| 24 | + |
| 25 | +### Modifications |
| 26 | + |
| 27 | +- **`"gpt-4o-mini"` → `"gpt-5.4-mini"`** (string literal, OpenAI small model) in: |
| 28 | + - `examples/batch/basic/main.go` (3 occurrences — three batch request entries) |
| 29 | + - `examples/chat/basic/main.go` (1) |
| 30 | + - `examples/chat/conversation/main.go` (1) |
| 31 | + - `examples/chat/conversation-streaming/main.go` (1) |
| 32 | + - `examples/chat/streaming/main.go` (1) |
| 33 | + - `examples/chat/structured-output/main.go` (2) |
| 34 | + - `examples/chat/system-message/main.go` (3) |
| 35 | + - `examples/testing/mock-provider/main.go` (2 — both the `RecordingProvider` fallback mock response's declared `Model` field and the live `client.Chat(...)` call in `demonstrateRecordingProvider`/`demonstrateRecordingWithProvider`, so the two stay consistent with each other) |
| 36 | + - `examples/tools/weather/main.go` (1) |
| 37 | +- **`"gpt-4o"` → `"gpt-5.6"`** (string literal, OpenAI flagship model, used generically) in `README.md`, 13 occurrences across the Quick Start example, the Timeouts/Streaming/Tools/Tool-Middleware/Structured-Output/Conversation-Management/Batch-API sections, and three `iris chat --model gpt-4o ...` CLI examples. |
| 38 | +- **`xai.ModelGrok41FastNonReasoning` → `xai.ModelGrok45`** in `examples/chat/xai-basic/main.go`. The stale inline comment ("Using grok-4-1-fast-non-reasoning for quick responses") was updated to reference grok-4.5. |
| 39 | +- **`examples/chat/xai-reasoning/main.go` deliberately keeps `xai.ModelGrok3Mini`.** Per the provider catalog, `grok-3-mini` is the model that exposes `reasoning_content` in responses; newer models like `grok-4.5` support reasoning but do not surface the reasoning trace via `resp.Reasoning`. Since this example prints `resp.Reasoning.Summary`, bumping it to a "latest" model would make the demo produce no reasoning output. It is left on `grok-3-mini` with its explanatory comments intact. |
| 40 | +- **`zai.ModelGLM47Flash` → `zai.ModelGLM52`** in `examples/chat/zai-basic/main.go` and `examples/chat/zai-streaming/main.go`. |
| 41 | +- **`gemini.ModelGemini25FlashImage` → `gemini.ModelGemini31FlashImagePreview`** in `examples/image/gemini/main.go`. |
| 42 | + |
| 43 | +### Removals |
| 44 | + |
| 45 | +N/A — nothing was deleted; only model references and the comments describing them were updated. |
| 46 | + |
| 47 | +## Technical Specification |
| 48 | + |
| 49 | +### Data Schemas / Types |
| 50 | + |
| 51 | +N/A — no schema or type changes. All edits are string-literal or constant-reference swaps in example `main()` functions, plus corresponding comment updates. |
| 52 | + |
| 53 | +### CLI Interface |
| 54 | + |
| 55 | +README's `iris chat` invocation examples now use `gpt-5.6` in place of `gpt-4o` for the three flagship-model illustrations (basic chat, `--stream`, `--json`). The CLI itself is unchanged; these are documentation examples only. |
| 56 | + |
| 57 | +### Go Package API |
| 58 | + |
| 59 | +No exported Go API changed. Example programs now reference: |
| 60 | +- `xai.ModelGrok45` (`core.ModelID = "grok-4.5"`) instead of `xai.ModelGrok41FastNonReasoning` (in `xai-basic`). `xai-reasoning` keeps `xai.ModelGrok3Mini` (the model that exposes `reasoning_content`). |
| 61 | +- `zai.ModelGLM52` (`core.ModelID = "glm-5.2"`) instead of `zai.ModelGLM47Flash`. |
| 62 | +- `gemini.ModelGemini31FlashImagePreview` (`core.ModelID = "gemini-3.1-flash-image-preview"`) instead of `gemini.ModelGemini25FlashImage`. |
| 63 | + |
| 64 | +All three constants were confirmed to already exist in the corresponding `providers/*/models.go` files before use; no constant names needed correcting. |
| 65 | + |
| 66 | +### Configuration |
| 67 | + |
| 68 | +N/A — no configuration fields changed. |
| 69 | + |
| 70 | +## Usage Examples |
| 71 | + |
| 72 | +### Example: xAI basic example now uses grok-4.5 |
| 73 | + |
| 74 | +```go |
| 75 | +// examples/chat/xai-basic/main.go (after this change) |
| 76 | +resp, err := client.Chat(xai.ModelGrok45). |
| 77 | + User("What are the three laws of robotics?"). |
| 78 | + GetResponse(ctx) |
| 79 | +``` |
| 80 | + |
| 81 | +The reasoning example (`examples/chat/xai-reasoning/main.go`) is intentionally NOT bumped: it stays on `xai.ModelGrok3Mini` because that model exposes `reasoning_content` (surfaced via `resp.Reasoning`), which the example prints. |
| 82 | + |
| 83 | +### Example: Gemini image generation now targets the 3.1 preview image model |
| 84 | + |
| 85 | +```go |
| 86 | +// examples/image/gemini/main.go (after this change) |
| 87 | +resp, err := imageGen.GenerateImage(ctx, &core.ImageGenerateRequest{ |
| 88 | + Model: gemini.ModelGemini31FlashImagePreview, |
| 89 | + Prompt: "A serene mountain landscape at sunset with a calm lake reflecting the colors of the sky", |
| 90 | + Size: core.ImageSize1024x1024, |
| 91 | +}) |
| 92 | +``` |
| 93 | + |
| 94 | +## Integration Notes |
| 95 | + |
| 96 | +- `providers/gemini/models.go` lists Gemini model series newest-first in file order and comments: "Gemini 3.6", "Gemini 3.5", "Gemini 3.1" (which includes `ModelGemini31FlashImagePreview`), then "Gemini 3" (which includes the older `ModelGemini3ProImage`, nicknamed "Nano Banana Pro" in its `DisplayName`). Despite the "Pro" naming suggesting more capability, `ModelGemini31FlashImagePreview` belongs to the newer 3.1 series and is therefore the constant this refresh selects — per the task's explicit tie-breaking rule ("prefer the newest image-generation constant that actually exists"), version series takes priority over tier name. |
| 97 | +- The mock-provider example's `"mock-model"` and `"any-model"` literals, and the Ollama (`llama3.2`, `qwen3`) and HuggingFace (`meta-llama/Llama-3.1-8B-Instruct`) example model strings, were deliberately left unchanged — these are either testing placeholders or represent locally-pulled/availability-varies models, not provider flagship references. |
| 98 | +- `examples/chat/responses-api/main.go` was left unchanged: it already uses `openai.ModelGPT56` (latest) for all Responses API calls, plus one intentional `openai.ModelGPT4o` call used specifically to contrast the Chat Completions code path against the Responses API path. |
| 99 | +- `examples/chat/xai-streaming/main.go` (already `xai.ModelGrok45`) and `examples/chat/zai-reasoning/main.go` (already `zai.ModelGLM52`) were already current and required no changes. |
| 100 | +- `examples/chat/xai-reasoning/main.go` was deliberately left on `xai.ModelGrok3Mini`: it is the model that returns `reasoning_content`, which the example demonstrates by printing `resp.Reasoning.Summary`. Bumping it to a newer model that does not expose the reasoning trace would defeat the example's purpose. |
| 101 | +- README's "Supported Models" / provider reference tables (OpenAI, Anthropic, xAI, Z.ai, Perplexity, Gemini, Ollama sections starting around line 850) were not touched — they were already catalog-current and are explicitly out of scope for this refresh. |
| 102 | +- README's Configuration section (`default_model: gpt-5.6 # or gpt-4o for older models`) was left as-is; it already shows the latest model and intentionally references `gpt-4o` as a contrasting "older model" example, not a generic flagship reference. |
| 103 | + |
| 104 | +## Breaking Changes & Migration |
| 105 | + |
| 106 | +N/A — example programs and documentation only; no public API, CLI, or configuration surface changed. Users who copy these examples will simply target newer provider models by default. |
| 107 | + |
| 108 | +## Deferred / Out of Scope |
| 109 | + |
| 110 | +- No production code changes (`core/`, `providers/*` implementation files) — only `providers/*/models.go` files were read to confirm constant names. |
| 111 | +- No changes to Ollama or HuggingFace example model strings, per explicit scope exclusion. |
| 112 | +- No changes to `examples/chat/responses-api/main.go`'s intentional `gpt-4o` comparison, or to any README "Supported Models" table. |
| 113 | + |
| 114 | +## Testing Notes |
| 115 | + |
| 116 | +- `go build ./examples/... ./...` — succeeds with no errors. |
| 117 | +- `go vet ./examples/...` — clean, no findings. |
| 118 | +- `gofmt -l examples/` — empty output (no formatting diffs). |
| 119 | +- Verified via `rg` that no unintended `"gpt-4o-mini"` or non-excluded `"gpt-4o"` literals remain in `examples/` or `README.md`, and that `xai.ModelGrok45`, `zai.ModelGLM52`, and `gemini.ModelGemini31FlashImagePreview` are valid, existing exported constants in their respective `providers/*/models.go` files. |
0 commit comments