docs: explain client-side sampling callbacks - #2789
Conversation
|
I was about to take a pass at #1205 and checked this PR first. This looks like it covers the missing client-side half of sampling clearly: it answers that the SDK does not call a provider directly, shows where Local validation on current PR head: uv run --frozen mkdocs build --strictResult: docs build completed successfully. Only output was the existing MkDocs/Material compatibility warning, not specific to this change. One small thing I specifically checked: adding |
|
Thanks for the PR. This has since landed via #2978. Closing as part of a general backlog cleanup following the v2 release. If this is still relevant against v2, feel free to reopen. |
Summary
sampling_callbackand own the model/provider callmodel_preferences,include_context, andClientRequestContextreach the callbackThis intentionally keeps the change provider-neutral and docs-only. It complements the existing server-side sampling snippet and avoids adding a full example project or model-provider dependency.
Addresses #1205.
Testing
PYTHONIOENCODING=utf-8 uv run mkdocs build --strict