Commit log

86872ba v0.13.0

Andrey Nering created

f20a77d docs(readme): remove experimental note + provider tools is now supported

Andrey Nering created

9cf02ad chore: delete duplicated example

Click to expand commit body
This is currently already covered by `web-search` example.

Andrey Nering created

6462ab9 feat(openai): add web search tool support for Responses API (#173)

Click to expand commit body
Add OpenAI web search as a provider-defined tool, mirroring the
Anthropic web search implementation pattern.

New files:
- providers/openai/web_search.go: WebSearchTool() helper with
  SearchContextSize, AllowedDomains, and UserLocation options.
- examples/openai-web-search/main.go: Example using the agent
  pattern with web search.

Changes to existing files:
- responses_options.go: WebSearchCallMetadata, WebSearchAction,
  and WebSearchSource types registered for JSON round-tripping.
- responses_language_model.go:
  - toResponsesTools(): Route ProviderDefinedTool web_search to
    the OpenAI SDK WebSearchToolParam.
  - Generate(): Emit ToolCallContent + ToolResultContent pair for
    web_search_call output items. Source citations come from
    url_citation annotations on message text.
  - Stream(): Emit ToolInputStart/ToolInputEnd/ToolCall/ToolResult
    lifecycle events for web_search_call items.
  - toResponsesPrompt(): Round-trip provider-executed tool calls
    via item_reference; skip SourceContent and provider-executed
    ToolResultPart (already handled by the reference).
- providertests/provider_registry_test.go: Add metadata test case.

Kyle Carberry created

522a4f8 docs(agents): minor AGENTS.md updates

Christian Rocha created

720c765 Merge pull request #163 from kylecarbs/feat/anthropic-web-search

Click to expand commit body
Add support for the Anthropic web search tool

Christian Rocha created

85e0422 fix(lint): guard against overflow

Christian Rocha created

df8bcd9 chore(deps): bump the all group with 4 updates (#171)

Click to expand commit body
Bumps the all group with 4 updates: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2), [github.com/openai/openai-go/v3](https://github.com/openai/openai-go) and [google.golang.org/genai](https://github.com/googleapis/go-genai).


Updates `github.com/aws/aws-sdk-go-v2` from 1.41.3 to 1.41.4
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.41.3...v1.41.4)

Updates `github.com/aws/aws-sdk-go-v2/config` from 1.32.11 to 1.32.12
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.32.11...config/v1.32.12)

Updates `github.com/openai/openai-go/v3` from 3.26.0 to 3.28.0
- [Release notes](https://github.com/openai/openai-go/releases)
- [Changelog](https://github.com/openai/openai-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openai/openai-go/compare/v3.26.0...v3.28.0)

Updates `google.golang.org/genai` from 1.49.0 to 1.50.0
- [Release notes](https://github.com/googleapis/go-genai/releases)
- [Changelog](https://github.com/googleapis/go-genai/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/go-genai/compare/v1.49.0...v1.50.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.41.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/openai/openai-go/v3
  dependency-version: 3.28.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: google.golang.org/genai
  dependency-version: 1.50.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

dependabot[bot] and dependabot[bot] created

eaa111e chore(anthroipic): harden web_search coercion for json round-trips

Click to expand commit body
This guards against cases when web_search options could be silently
dropped when tool args pass through generic/JSON-shaped data, so domain
filters, max uses, and user location reliably reach Anthropic.

Christian Rocha created

0320b54 chore(examples): go mod tidy

Christian Rocha created

2460fd0 fix(agent): make per-step tool selection apply to all tool types

Christian Rocha created

ffc8408 v0.12.3

Andrey Nering created

50d95df chore: update openai sdk to v3 (#168)

Andrey Nering created

caf105e test: re-record almost all fixtures (#167)

Andrey Nering created

38eb77b feat: add Anthropic web search tool support (server_tool_use + web_search_tool_result)

Click to expand commit body
- Handle ProviderDefinedTool with ID "web_search" in toTools(), mapping to
  anthropic.WebSearchTool20250305Param with optional allowed/blocked domains
- Parse "server_tool_use" blocks in Generate() and Stream(), producing
  ToolCallContent with ProviderExecuted=true
- Parse "web_search_tool_result" blocks, extracting SourceContent for each
  search result and a ToolResultContent summary
- Stream server_tool_use via ToolInputStart/ToolInputEnd/ToolCall events
- Stream web_search_tool_result via Source events for each result item
- Skip provider-executed tool results and source content when building
  Anthropic prompts (toPrompt) to avoid sending unrecognized block types
- Add ProviderExecuted field to ToolResultPart with JSON marshal/unmarshal
- Propagate ProviderExecuted from ToolResultContent to ToolResultPart in
  agent's toResponseMessages()

Kyle Carberry created

fa02069 v0.12.2

Andrey Nering created

7ebd9b5 test: re-record all openrouter fixtures

Andrey Nering created

a3b8a69 fix(openrouter): preserve anthropic reasoning signature in streaming

Click to expand commit body
Anthropic sends the reasoning signature chunk after tool_calls have
started. The streaming hook was ending reasoning prematurely on the
first tool_call chunk, so the late-arriving signature was lost. Track
the reasoning format and defer ending for anthropic streams until the
signature arrives. Also fix the agent stream assembler to not overwrite
provider metadata with nil on reasoning deltas.

💘 Generated with Crush

Assisted-by: Claude Opus 4.6 via Crush <crush@charm.land>

Andrey Nering created

152acfe fix: guard against nil EncryptedContent dereference in reasoning details

Click to expand commit body
Reasoning metadata can exist without encrypted content, causing a nil
pointer panic when building prompt messages for openrouter and vercel.

💘 Generated with Crush

Assisted-by: Claude Opus 4.6 via Crush <crush@charm.land>

Andrey Nering created

50a1116 fix: improve default user-agent string

Click to expand commit body
This change to be better follow the convention:

* App name should not have spaces: `Charm Fantasy` -> `Charm-Fantasy`.
* Add comment `()` with app site.

Andrey Nering created

e8560e6 fix(openai): use noDefaultUserAgent in all responses API calls

Click to expand commit body
💘 Generated with Crush

Assisted-by: Kimi K2.5 via Crush <crush@charm.land>

Christian Rocha created

522e026 fix(openai): propagate noDefaultUserAgent to responsesLanguageModel

Click to expand commit body
💘 Generated with Crush

Assisted-by: Kimi K2.5 via Crush <crush@charm.land>

Christian Rocha created

2e29858 fix(openrouter): avoid brittle User-Agent assertion

Click to expand commit body
💘 Generated with Crush

Assisted-by: Kimi K2.5 via Crush <crush@charm.land>

Christian Rocha created

182ba5f docs(openai): correct grammar in comment

Click to expand commit body
💘 Generated with Crush

Assisted-by: Kimi K2.5 via Crush <crush@charm.land>

Christian Rocha created

96f0454 fix(openai): don't mutate shared languageModelOptions

Click to expand commit body
💘 Generated with Crush

Assisted-by: Kimi K2.5 via Crush <crush@charm.land>

Christian Rocha created

7dc3888 fix(openrouter): don't set User-Agent

Click to expand commit body
OpenRouter rejects API calls using a custom User Agent. This workaround
skips OpenRouter when setting a user agent.

Note that we've added two new methods accordingly, as OpenRouter uses
the openai package:

openai.WithSkipUserAgent()
openai.WithLanguageModelSkipUserAgent()

Christian Rocha created

04950be v0.12.1

Andrey Nering created

5d76d7d chore(examples): go mod tidy

Andrey Nering created

d9de5db fix(errors): improve check for when to retry requests (#164)

Click to expand commit body
* Follow OpenAI's Go SDK.
* Check status code >= 500.
* Check `x-should-retry` header.

Co-authored-by: yuguorui <yuguorui@pku.edu.cn>

Andrey Nering and yuguorui created

b137f01 chore(deps): bump the all group across 1 directory with 4 updates (#162)

Click to expand commit body
Bumps the all group with 4 updates in the / directory: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2), [golang.org/x/oauth2](https://github.com/golang/oauth2) and [google.golang.org/genai](https://github.com/googleapis/go-genai).


Updates `github.com/aws/aws-sdk-go-v2` from 1.41.2 to 1.41.3
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.41.2...v1.41.3)

Updates `github.com/aws/aws-sdk-go-v2/config` from 1.32.10 to 1.32.11
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.32.10...config/v1.32.11)

Updates `golang.org/x/oauth2` from 0.35.0 to 0.36.0
- [Commits](https://github.com/golang/oauth2/compare/v0.35.0...v0.36.0)

Updates `google.golang.org/genai` from 1.48.0 to 1.49.0
- [Release notes](https://github.com/googleapis/go-genai/releases)
- [Changelog](https://github.com/googleapis/go-genai/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/go-genai/compare/v1.48.0...v1.49.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.41.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: google.golang.org/genai
  dependency-version: 1.49.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

dependabot[bot] and dependabot[bot] created

13ad470 ci(dependabot): update kronk in a separate group

Andrey Nering created

ae2e22e ci: fix govulncheck by updating go version (#161)

Andrey Nering created

422f954 v0.12.0

Andrey Nering created

1b0027b feat: configurable user-agent (#152)

Click to expand commit body
Note that the user agent defaults to Charm Fantasy/<version>, which
means we need to maintain a const for the version number.

Christian Rocha created

0806f24 chore(deps): go mod tidy examples (#159)

Christian Rocha created

fb3643d v0.11.1

Andrey Nering created

4747a08 chore: add support for gpt 5.4 (#158)

Andrey Nering created

0a0ed20 chore(deps): bump the all group with 3 updates (#155)

Click to expand commit body
Bumps the all group with 3 updates: [github.com/ardanlabs/kronk](https://github.com/ardanlabs/kronk), [github.com/aws/smithy-go](https://github.com/aws/smithy-go) and [github.com/kaptinlin/jsonschema](https://github.com/kaptinlin/jsonschema).


Updates `github.com/ardanlabs/kronk` from 1.20.3 to 1.20.8
- [Release notes](https://github.com/ardanlabs/kronk/releases)
- [Commits](https://github.com/ardanlabs/kronk/compare/v1.20.3...v1.20.8)

Updates `github.com/aws/smithy-go` from 1.24.1 to 1.24.2
- [Release notes](https://github.com/aws/smithy-go/releases)
- [Changelog](https://github.com/aws/smithy-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/smithy-go/compare/v1.24.1...v1.24.2)

Updates `github.com/kaptinlin/jsonschema` from 0.7.3 to 0.7.5
- [Commits](https://github.com/kaptinlin/jsonschema/compare/v0.7.3...v0.7.5)

---
updated-dependencies:
- dependency-name: github.com/ardanlabs/kronk
  dependency-version: 1.20.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/aws/smithy-go
  dependency-version: 1.24.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/kaptinlin/jsonschema
  dependency-version: 0.7.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

dependabot[bot] and dependabot[bot] created

8d2ec4f chore(deps): bump github.com/ardanlabs/kronk in the all group (#153)

Click to expand commit body
Bumps the all group with 1 update: [github.com/ardanlabs/kronk](https://github.com/ardanlabs/kronk).


Updates `github.com/ardanlabs/kronk` from 1.20.1 to 1.20.3
- [Release notes](https://github.com/ardanlabs/kronk/releases)
- [Commits](https://github.com/ardanlabs/kronk/compare/v1.20.1...v1.20.3)

---
updated-dependencies:
- dependency-name: github.com/ardanlabs/kronk
  dependency-version: 1.20.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

dependabot[bot] and dependabot[bot] created

5442a7f v0.11.0

Andrey Nering created

8f24e95 chore(deps): bump the all group with 4 updates (#150)

Click to expand commit body
Bumps the all group with 4 updates: [github.com/ardanlabs/kronk](https://github.com/ardanlabs/kronk), [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) and [google.golang.org/genai](https://github.com/googleapis/go-genai).


Updates `github.com/ardanlabs/kronk` from 1.19.6 to 1.20.1
- [Release notes](https://github.com/ardanlabs/kronk/releases)
- [Commits](https://github.com/ardanlabs/kronk/compare/v1.19.6...v1.20.1)

Updates `github.com/aws/aws-sdk-go-v2` from 1.41.1 to 1.41.2
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.41.1...v1.41.2)

Updates `github.com/aws/aws-sdk-go-v2/config` from 1.32.9 to 1.32.10
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.32.9...config/v1.32.10)

Updates `google.golang.org/genai` from 1.47.0 to 1.48.0
- [Release notes](https://github.com/googleapis/go-genai/releases)
- [Changelog](https://github.com/googleapis/go-genai/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/go-genai/compare/v1.47.0...v1.48.0)

---
updated-dependencies:
- dependency-name: github.com/ardanlabs/kronk
  dependency-version: 1.20.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.41.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: google.golang.org/genai
  dependency-version: 1.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

dependabot[bot] and dependabot[bot] created

8a1457c feat: add support for anthropic thinking effort (#147)

Click to expand commit body
Co-authored-by: Andrey Nering <andreynering@users.noreply.github.com>

Kyle Carberry and Andrey Nering created

26a572c v0.10.0

Andrey Nering created

cf3151e lint: fix missing doc comment

Andrey Nering created

4e71eb6 test: unify gemini 2 and gemini 3 thinking tests

Andrey Nering created

bd6d47d feat(google): add ThinkingLevel support for Gemini 3+ models

Click to expand commit body
Gemini 3+ uses thinking_level (LOW/MEDIUM/HIGH/MINIMAL) instead of
thinking_budget. The two are mutually exclusive per Google's API.
Maps to genai.ThinkingConfig.ThinkingLevel already available in v1.45.0.

Xavier Capaldi created

54b30ae feat: detect context-too-large errors (#125)

mhpenta created

b802c67 chore: update anthropic-sdk-go from our fork (#148)

Click to expand commit body
The `fantasy` branch was updated from upstream.

See:

* https://github.com/charmbracelet/anthropic-sdk-go/pull/1
* https://github.com/charmbracelet/fantasy/pull/147

Andrey Nering created

7d7c4b3 chore(deps): bump the all group with 3 updates (#146)

Click to expand commit body
Bumps the all group with 3 updates: [github.com/ardanlabs/kronk](https://github.com/ardanlabs/kronk), [github.com/aws/smithy-go](https://github.com/aws/smithy-go) and [github.com/kaptinlin/jsonschema](https://github.com/kaptinlin/jsonschema).


Updates `github.com/ardanlabs/kronk` from 1.19.2 to 1.19.6
- [Release notes](https://github.com/ardanlabs/kronk/releases)
- [Commits](https://github.com/ardanlabs/kronk/compare/v1.19.2...v1.19.6)

Updates `github.com/aws/smithy-go` from 1.24.0 to 1.24.1
- [Release notes](https://github.com/aws/smithy-go/releases)
- [Changelog](https://github.com/aws/smithy-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/smithy-go/compare/v1.24.0...v1.24.1)

Updates `github.com/kaptinlin/jsonschema` from 0.7.2 to 0.7.3
- [Commits](https://github.com/kaptinlin/jsonschema/compare/v0.7.2...v0.7.3)

---
updated-dependencies:
- dependency-name: github.com/ardanlabs/kronk
  dependency-version: 1.19.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/aws/smithy-go
  dependency-version: 1.24.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/kaptinlin/jsonschema
  dependency-version: 0.7.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

dependabot[bot] and dependabot[bot] created

b2eb8d1 v0.9.0

Andrey Nering created