HoneyHive Python SDK v1.0 supports the HoneyHive v2 platform launch. Use this guide to upgrade v0.x projects to SDK v1 and adopt v2-ready tracing and evaluation patterns.Documentation Index
Fetch the complete documentation index at: https://docs.honeyhive.ai/llms.txt
Use this file to discover all available pages before exploring further.
Use a coding agent to migrate
Use a coding agent to migrate
What changed
| Area | v0.x | v1.0 |
|---|---|---|
| Dataset ground truth key | ground_truths | ground_truth |
| Client API responses | Nested dict-style access common | Typed response models use attribute access |
| Evaluated function input | Commonly (inputs, ground_truths) | A single datapoint dict |
| Evaluator parameters | outputs, inputs, ground_truths | outputs, inputs, ground_truth |
| Result display | Manual inspection | print_results=True, or print_results=False plus result.print_table() |
| Session isolation | Instance-level session state | create_session() and with_session() use OpenTelemetry baggage |
| Enrichment | Global helper functions common | Tracer instance methods recommended |
1. Upgrade the package
2. Update direct client API usage
If you use lower-level client APIs such asclient.events, client.datapoints, client.datasets, or client.metrics, many nested request and response objects are typed Pydantic models in v1.
For responses, replace dict-style access with attribute access:
model_dump() on the typed model:
event_type can now raise pydantic.ValidationError at request-construction time instead of surfacing only as a backend error after the request is sent.
If your environment pins OpenTelemetry or Traceloop instrumentor versions, review those pins during the upgrade. SDK v1 requires newer minimum versions than older 0.x releases.
3. Use ground_truth in datasets
SDK v1 reads the singular ground_truth key from experiment datapoints. If your v0 datasets use ground_truths, rename that field in local datasets and dataset creation code.
This is a field-name change, not a restriction on the value shape. If you previously stored multiple expected values inside ground_truths, keep the same inner structure under ground_truth.
4. Update evaluated functions
In v1,evaluate() passes the full datapoint to your function. Read inputs and ground_truth from that datapoint.
5. Update evaluator parameters
In v1, evaluators can be plain functions.@evaluator is still accepted for compatibility but no longer required. Rename the third parameter to ground_truth so it matches the v1 dataset shape.
@evaluator remains available for compatibility, but plain functions can be passed directly in the evaluators list.
6. Update LLM evaluator templates
If you reference ground truth in evaluator prompts, update template variables.7. Use the v1 result summary
evaluate() returns an experiment result summary and prints a formatted table by default.
If you want to render the table yourself, pass print_results=False and call result.print_table(...) later.
print_results=False and let evaluate() print the table automatically.
8. Update enrichment calls
Free functions such asenrich_span() still work in v1, but instance methods are the primary pattern because they are explicit and work better with multiple tracers.
| Namespace | Use for |
|---|---|
metadata | Custom searchable context |
metrics | Scores, latency, token counts, numeric measurements |
feedback | Ratings, labels, corrections, ground truth |
inputs | Span or session input payloads |
outputs | Span or session output payloads |
config | Model and application configuration |
user_properties | User attributes |
9. Replace manual session state in concurrent apps
If your v0 integration reused one tracer across many requests, create request-scoped sessions in v1.with_session():
10. Simplify distributed tracing
v1 includes helpers for carrying OpenTelemetry trace context across services.Troubleshooting
Ground truth does not appear in HoneyHive
Check that every datapoint usesground_truth, not only ground_truths. SDK v1 reads ground_truth from each datapoint.
Dict-style client response access breaks after upgrading
If you use direct client APIs, switch from subscripts to attributes on typed response models:model_dump() only when you need a plain dict for serialization or an external boundary.
Evaluators do not receive ground truth
Use the singular evaluator parameter:Traces from different requests share one session
Usecreate_session() or acreate_session() per request instead of mutating tracer.session_id or relying on session_start() in a shared server process.
Import errors after upgrading
Confirm the runtime is using the upgraded package:Migration checklist
- Upgrade to
honeyhive>=1.0.0 - Update direct client API code from dict-style response access to typed-model attribute access
- Review request validation changes if you build payloads for
client.events,client.datapoints,client.datasets, orclient.metrics - Rename
ground_truthstoground_truthin datasets - Update evaluated functions to accept a datapoint dict
- Update evaluators to use
ground_truth - Update LLM evaluator templates from
feedback.ground_truthstofeedback.ground_truth - Use tracer instance methods for new enrichment code
- Use
create_session()orwith_session()for request-scoped sessions - Review pinned OpenTelemetry or Traceloop instrumentor versions, if any
- Run an evaluation and confirm table output, scores, and ground truth render correctly
Related
Migrate from Logger to v1
Replace
honeyhive-logger calls with SDK v1 tracing.Migrate from honeyhive-bundled to v1
Replace the bundled package with the stable SDK.
Evaluation Quickstart
Run your first experiment with
evaluate().Tracer Initialization
Choose the right tracer and session pattern for your runtime.
Enriching Traces
Add metadata, metrics, feedback, and user properties to traces.

