charmbracelet / charmbracelet/fantasy
Add application-level extension field and PrepareCall hook to AgentCall / AgentStreamCall
- Dominant language
- Go
- Stars
- 987
- Forks
- 137
- Avg merge
- 14h 41m
- Merged PRs (30d)
- 12
Description
Currently AgentCall and AgentStreamCall only carry a fixed set of fields (sampling params, messages, tools, callbacks, etc.). There is no first-class way for application-layer code to:
1. Attach arbitrary, application-specific data to a call.
2. Run a one-shot preparation hook before the first model invocation, analogous to the internal agent.prepareCall.
Typical use cases for the hook: translating an application-defined context object into SystemPrompt / ProviderOptions / Messages, injecting tenant-scoped headers, resolving feature flags, hydrating RAG context, etc.
Contributor guide
Research direction
Start by locating AgentCall and AgentStreamCall, then read the internal agent.prepareCall flow to understand when preparation occurs. Define how application-specific data and a one-shot preparation hook fit both call types, with completion shown by supporting context translation, option or message injection, and other application-level preparation before the first model invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- ai, backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100