trodo-python 3.0.5__tar.gz → 3.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trodo_python-3.0.5 → trodo_python-3.0.6}/PKG-INFO +1 -1
- {trodo_python-3.0.5 → trodo_python-3.0.6}/pyproject.toml +1 -1
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_sender.py +11 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/__init__.py +3 -1
- trodo_python-3.0.6/trodo/_version.py +1 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/client.py +4 -1
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo_python.egg-info/PKG-INFO +1 -1
- trodo_python-3.0.5/trodo/_version.py +0 -1
- {trodo_python-3.0.5 → trodo_python-3.0.6}/README.md +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/setup.cfg +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_anon_distinct_id.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_auto_instrument_fixes.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_cross_process_session.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_datasets.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_end_run.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_end_run_order.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_error_enrichment.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_framework_deference.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_get_prompt_version_types.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_instrumentor_resolution.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_llm_usage_cost.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_long_runs.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_multi_agent_shape.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_processor_methods.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_prompt_fingerprint.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_prompt_trace.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_prompts.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_register_otel.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_start_run.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_user_traits.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/tests/test_wrap_agent_unchanged.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/api/__init__.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/api/_retry.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/api/async_client.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/api/endpoints.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/api/http_client.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/api/management.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/auto/__init__.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/auto/auto_event_manager.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/delivery/__init__.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/delivery/sender.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/managers/__init__.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/managers/dataset_manager.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/managers/group_manager.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/managers/people_manager.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/managers/prompt_manager.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/managers/user_manager.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/otel/__init__.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/otel/auto_instrument.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/otel/context.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/otel/helpers.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/otel/processor.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/otel/prompt_trace.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/otel/register.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/otel/transport.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/otel/wrap_agent.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/prompts/__init__.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/prompts/compile.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/prompts/template.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/prompts/types.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/queue/__init__.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/queue/batch_flusher.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/queue/event_queue.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/session/__init__.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/session/server_session.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/session/session_manager.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/types.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/user_context.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/util/__init__.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo/util/lru.py +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo_python.egg-info/SOURCES.txt +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo_python.egg-info/dependency_links.txt +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo_python.egg-info/requires.txt +0 -0
- {trodo_python-3.0.5 → trodo_python-3.0.6}/trodo_python.egg-info/top_level.txt +0 -0
|
@@ -479,3 +479,14 @@ def test_version_matches_the_package():
|
|
|
479
479
|
import trodo
|
|
480
480
|
from trodo._version import SDK_VERSION
|
|
481
481
|
assert trodo.__version__ == SDK_VERSION
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
def test_feedback_on_a_span_carries_its_span_id():
|
|
485
|
+
from trodo.client import TrodoClient
|
|
486
|
+
c = TrodoClient.__new__(TrodoClient)
|
|
487
|
+
sent = []
|
|
488
|
+
c._sender = type("S", (), {"enqueue": lambda self, item: sent.append(item)})()
|
|
489
|
+
TrodoClient.feedback(c, "r1", rating=5, span_id="s9")
|
|
490
|
+
TrodoClient.feedback(c, "r2", rating=4)
|
|
491
|
+
assert sent[0]["feedback"]["span_id"] == "s9"
|
|
492
|
+
assert "span_id" not in sent[1]["feedback"]
|
|
@@ -813,8 +813,9 @@ def feedback(
|
|
|
813
813
|
feedback: Optional[str] = None,
|
|
814
814
|
distinct_id: Optional[str] = None,
|
|
815
815
|
metadata: Optional[Dict[str, Any]] = None,
|
|
816
|
+
span_id: Optional[str] = None,
|
|
816
817
|
) -> ApiResult:
|
|
817
|
-
"""Attach feedback to a
|
|
818
|
+
"""Attach feedback to a run, or with ``span_id`` to one span of it."""
|
|
818
819
|
return _get_client().feedback(
|
|
819
820
|
run_id,
|
|
820
821
|
satisfaction=satisfaction,
|
|
@@ -823,6 +824,7 @@ def feedback(
|
|
|
823
824
|
feedback=feedback,
|
|
824
825
|
distinct_id=distinct_id,
|
|
825
826
|
metadata=metadata,
|
|
827
|
+
span_id=span_id,
|
|
826
828
|
)
|
|
827
829
|
|
|
828
830
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SDK_VERSION = "3.0.6"
|
|
@@ -608,8 +608,9 @@ class TrodoClient:
|
|
|
608
608
|
feedback: Optional[str] = None,
|
|
609
609
|
distinct_id: Optional[str] = None,
|
|
610
610
|
metadata: Optional[Dict[str, Any]] = None,
|
|
611
|
+
span_id: Optional[str] = None,
|
|
611
612
|
) -> ApiResult:
|
|
612
|
-
"""Attach feedback to a
|
|
613
|
+
"""Attach feedback to a run, or with ``span_id`` to one span of it (3.0.6)."""
|
|
613
614
|
if satisfaction is None and rating is None and not (comment or feedback):
|
|
614
615
|
raise ValueError(
|
|
615
616
|
"At least one of 'satisfaction', 'rating', or 'comment' is required"
|
|
@@ -621,6 +622,8 @@ class TrodoClient:
|
|
|
621
622
|
"distinct_id": distinct_id,
|
|
622
623
|
"attributes": metadata or {},
|
|
623
624
|
}
|
|
625
|
+
if span_id:
|
|
626
|
+
payload["span_id"] = span_id
|
|
624
627
|
# Queued behind the run it belongs to (2.24): never waits on the
|
|
625
628
|
# network, survives an outage, and lands after its run.
|
|
626
629
|
self._sender.enqueue({"run_id": run_id, "feedback": payload})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
SDK_VERSION = "3.0.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|