Repository navigation
Commit d90e7a3
Document baml tag setting and retrieval (#2534)
# Pull Request Template
Thanks for taking the time to fill out this pull request!
## Issue Reference
Please link to any related issues
- [ ] This PR fixes/closes #[issue number]
## Changes
Please describe the changes proposed in this pull request
This PR adds comprehensive documentation for BAML's tagging feature
across Python, TypeScript, and Go. It clarifies how to set tags at both
the parent trace and per-call level, and how to retrieve them using the
`Collector`. This enhances observability by providing clear guidance on
attaching and accessing custom metadata for BAML function calls.
Specifically:
- A new "Tags" section in the Observability guide explains tag usage and
retrieval.
- The Collector reference now includes a dedicated "Tags" subsection
with examples.
- The `with_options` API reference details the `tags` parameter for
per-call configuration.
## Testing
Please describe how you tested these changes
- [ ] Unit tests added/updated
- [X] Manual testing performed (verified documentation content and code
examples)
- [ ] Tested in [environment]
## Screenshots
If applicable, add screenshots to help explain your changes
[Add screenshots here...]
## PR Checklist
Please ensure you've completed these items
- [X] I have read and followed the contributing guidelines
- [X] My code follows the style guidelines of this project
- [X] I have performed a self-review of my own code
- [X] I have commented my code, particularly in hard-to-understand areas
(N/A for markdown)
- [X] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
## Additional Notes
Add any other context about the PR here
The documentation includes examples for Python, TypeScript, and Go, and
clarifies how tags from parent traces are inherited and merged with
per-call tags.
---
<a
href="https://cursor.com/background-agent?bcId=bc-e24c1fe2-93be-43f3-9f25-e5e15ca7a22b"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-cursor-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in
Cursor"
src="https://cursor.com/open-in-cursor.svg"></picture></a> <a
href="https://cursor.com/agents?id=bc-e24c1fe2-93be-43f3-9f25-e5e15ca7a22b"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-web-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web"
src="https://cursor.com/open-in-web.svg"></picture></a>
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds concise docs for setting/inheriting per-call tags and retrieving
them via Collector across Python/TS/Go, and removes the id-based
lookup/docs, updating examples accordingly.
>
> - **Guide**:
> - Adds "Tags on BAML calls and retrieving them with the Collector"
with Python/TypeScript/Go examples showing parent-trace tag inheritance,
per-call tags (`baml_options`/options/`WithTags`), and reading
`collector.last.tags`/`log.Tags()`.
> - **Reference: Collector**:
> - New "Tags" subsection with examples for setting and reading merged
tags.
> - API note: remove `collector.id(id)` from methods; recommend
correlating via `tags`.
> - **Reference: with_options**:
> - Adds "Per-call Tags" examples (Python/TS/Go) and mentions `tags`
param; usage examples updated to use `collector.last`/`logs` and tags
for correlation in parallel/streaming.
> - **Removals**:
> - Deletes `fern/03-reference/baml_client/id.mdx` (id feature doc).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
22b3e58. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>1 parent aba814b commit d90e7a3
4 files changed
Lines changed: 244 additions & 222 deletions
File tree
- fern
- 01-guide/07-observability
- 03-reference/baml_client
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments