docent-python 0.1.23a0__py3-none-any.whl → 0.1.24a0__py3-none-any.whl

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.

Potentially problematic release.


This version of docent-python might be problematic. Click here for more details.

docent/sdk/client.py CHANGED
@@ -391,6 +391,24 @@ class Docent:
391
391
  # TODO(mengk): kinda hacky
392
392
  return AgentRun.model_validate(response.json())
393
393
 
394
+ def get_chat_sessions(self, collection_id: str, agent_run_id: str) -> list[dict[str, Any]]:
395
+ """Get all chat sessions for an agent run, excluding judge result sessions.
396
+
397
+ Args:
398
+ collection_id: ID of the Collection.
399
+ agent_run_id: The ID of the agent run to retrieve chat sessions for.
400
+
401
+ Returns:
402
+ list: List of chat session dictionaries.
403
+
404
+ Raises:
405
+ requests.exceptions.HTTPError: If the API request fails.
406
+ """
407
+ url = f"{self._server_url}/chat/{collection_id}/{agent_run_id}/sessions"
408
+ response = self._session.get(url)
409
+ self._handle_response_errors(response)
410
+ return response.json()
411
+
394
412
  def make_collection_public(self, collection_id: str) -> dict[str, Any]:
395
413
  """Make a collection publicly accessible to anyone with the link.
396
414
 
docent/trace.py CHANGED
@@ -1270,6 +1270,41 @@ def transcript_metadata(
1270
1270
  logger.error(f"Failed to send transcript metadata: {e}")
1271
1271
 
1272
1272
 
1273
+ def transcript_group_metadata(
1274
+ name: Optional[str] = None,
1275
+ description: Optional[str] = None,
1276
+ parent_transcript_group_id: Optional[str] = None,
1277
+ metadata: Optional[Dict[str, Any]] = None,
1278
+ ) -> None:
1279
+ """
1280
+ Send transcript group metadata directly to the backend for the current transcript group.
1281
+
1282
+ Args:
1283
+ name: Optional transcript group name
1284
+ description: Optional transcript group description
1285
+ parent_transcript_group_id: Optional parent transcript group ID
1286
+ metadata: Optional metadata to send
1287
+
1288
+ Example:
1289
+ transcript_group_metadata(name="pipeline", description="Main processing pipeline")
1290
+ transcript_group_metadata(metadata={"team": "search", "env": "prod"})
1291
+ """
1292
+ try:
1293
+ tracer = get_tracer()
1294
+ if tracer.is_disabled():
1295
+ return
1296
+ transcript_group_id = tracer.get_current_transcript_group_id()
1297
+ if not transcript_group_id:
1298
+ logger.warning("No active transcript group context. Metadata will not be sent.")
1299
+ return
1300
+
1301
+ tracer.send_transcript_group_metadata(
1302
+ transcript_group_id, name, description, parent_transcript_group_id, metadata
1303
+ )
1304
+ except Exception as e:
1305
+ logger.error(f"Failed to send transcript group metadata: {e}")
1306
+
1307
+
1273
1308
  class AgentRunContext:
1274
1309
  """Context manager that works in both sync and async contexts."""
1275
1310
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docent-python
3
- Version: 0.1.23a0
3
+ Version: 0.1.24a0
4
4
  Summary: Docent SDK
5
5
  Project-URL: Homepage, https://github.com/TransluceAI/docent
6
6
  Project-URL: Issues, https://github.com/TransluceAI/docent/issues
@@ -1,6 +1,6 @@
1
1
  docent/__init__.py,sha256=fuhETwJPcesiB76Zxa64HBJxeaaTyRalIH-fs77TWsU,112
2
2
  docent/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- docent/trace.py,sha256=u_1M_B1ncCR5a0Yy5ppQY_0k0AFYe4UhSIGeTuZCH0w,67271
3
+ docent/trace.py,sha256=PXMvXxtnYsd4xDxAX30SUZ32OoMuMrTpLbfq8f_QVmo,68565
4
4
  docent/trace_temp.py,sha256=Z0lAPwVzXjFvxpiU-CuvfWIslq9Q4alNkZMoQ77Xudk,40711
5
5
  docent/_llm_util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  docent/_llm_util/llm_cache.py,sha256=nGrvfFikFbEnfmzZRvWvZ60gfVSTvW1iC8-ciCXwbAk,6430
@@ -52,8 +52,8 @@ docent/samples/log.eval,sha256=orrW__9WBfANq7NwKsPSq9oTsQRcG6KohG5tMr_X_XY,39770
52
52
  docent/samples/tb_airline.json,sha256=eR2jFFRtOw06xqbEglh6-dPewjifOk-cuxJq67Dtu5I,47028
53
53
  docent/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  docent/sdk/agent_run_writer.py,sha256=0AWdxejoqZyuj9JSA39WlEwGcMSYTWNqnzIuluySY-M,11043
55
- docent/sdk/client.py,sha256=ZRJDz1RKcV7_gA0zHbr3bIdvUqFrSU99Zes__2kVnKo,19184
56
- docent_python-0.1.23a0.dist-info/METADATA,sha256=sxm-OrFzMKg2U2G_EmrHlGeceqhpY7cGzKa0H989FOo,1351
57
- docent_python-0.1.23a0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
58
- docent_python-0.1.23a0.dist-info/licenses/LICENSE.md,sha256=QIMv2UiT6MppRasso4ymaA0w7ltkqmlL0HCt8CLD7Rc,580
59
- docent_python-0.1.23a0.dist-info/RECORD,,
55
+ docent/sdk/client.py,sha256=aB_ILmzzK9JAC2kobtnp50stfINpSfNh54siaDlMEKc,19880
56
+ docent_python-0.1.24a0.dist-info/METADATA,sha256=jTg2sD4AXMPXBpXJOGcwvE2GsJ9oO6zDp6g1UJhPqk0,1351
57
+ docent_python-0.1.24a0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
58
+ docent_python-0.1.24a0.dist-info/licenses/LICENSE.md,sha256=QIMv2UiT6MppRasso4ymaA0w7ltkqmlL0HCt8CLD7Rc,580
59
+ docent_python-0.1.24a0.dist-info/RECORD,,