docent-python 0.1.24a0__py3-none-any.whl → 0.1.25a0__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.

@@ -18,8 +18,13 @@ from openai import (
18
18
  PermissionDeniedError,
19
19
  RateLimitError,
20
20
  UnprocessableEntityError,
21
- omit,
22
21
  )
22
+ try:
23
+ from openai import omit
24
+ except ImportError:
25
+ from openai import Omit as _OpenAIOmit
26
+
27
+ omit = _OpenAIOmit()
23
28
  from openai.types.chat import (
24
29
  ChatCompletion,
25
30
  ChatCompletionAssistantMessageParam,
docent/trace.py CHANGED
@@ -129,6 +129,8 @@ class DocentTracer:
129
129
  lambda: itertools.count(0)
130
130
  )
131
131
  self._transcript_counter_lock = threading.Lock()
132
+ self._transcript_group_states: dict[str, dict[str, Optional[str]]] = {}
133
+ self._transcript_group_state_lock = threading.Lock()
132
134
  self._flush_lock = threading.Lock()
133
135
 
134
136
  def get_current_agent_run_id(self) -> Optional[str]:
@@ -888,6 +890,27 @@ class DocentTracer:
888
890
  )
889
891
  return
890
892
 
893
+ with self._transcript_group_state_lock:
894
+ state: dict[str, Optional[str]] = self._transcript_group_states.setdefault(
895
+ transcript_group_id, {}
896
+ )
897
+ final_name: Optional[str] = name if name is not None else state.get("name")
898
+ final_description: Optional[str] = (
899
+ description if description is not None else state.get("description")
900
+ )
901
+ final_parent_transcript_group_id: Optional[str] = (
902
+ parent_transcript_group_id
903
+ if parent_transcript_group_id is not None
904
+ else state.get("parent_transcript_group_id")
905
+ )
906
+
907
+ if final_name is not None:
908
+ state["name"] = final_name
909
+ if final_description is not None:
910
+ state["description"] = final_description
911
+ if final_parent_transcript_group_id is not None:
912
+ state["parent_transcript_group_id"] = final_parent_transcript_group_id
913
+
891
914
  payload: Dict[str, Any] = {
892
915
  "collection_id": collection_id,
893
916
  "transcript_group_id": transcript_group_id,
@@ -895,12 +918,12 @@ class DocentTracer:
895
918
  "timestamp": datetime.now(timezone.utc).isoformat(),
896
919
  }
897
920
 
898
- if name is not None:
899
- payload["name"] = name
900
- if description is not None:
901
- payload["description"] = description
902
- if parent_transcript_group_id is not None:
903
- payload["parent_transcript_group_id"] = parent_transcript_group_id
921
+ if final_name is not None:
922
+ payload["name"] = final_name
923
+ if final_description is not None:
924
+ payload["description"] = final_description
925
+ if final_parent_transcript_group_id is not None:
926
+ payload["parent_transcript_group_id"] = final_parent_transcript_group_id
904
927
  if metadata is not None:
905
928
  payload["metadata"] = metadata
906
929
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docent-python
3
- Version: 0.1.24a0
3
+ Version: 0.1.25a0
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=PXMvXxtnYsd4xDxAX30SUZ32OoMuMrTpLbfq8f_QVmo,68565
3
+ docent/trace.py,sha256=loJJDD3AX-rrP-QsZ8WkkFPxKd4u9wiiBG0gtxSgY0I,69743
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
@@ -13,7 +13,7 @@ docent/_llm_util/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
13
13
  docent/_llm_util/providers/anthropic.py,sha256=-1oPd5FB4aFwKSmNvXzG8PVewjhgsogLRX1SCpnCxoA,18720
14
14
  docent/_llm_util/providers/common.py,sha256=dgcTuU4XkCKoAaM48UW8zMgRYUzj7TDBhvWqtnxBO7g,1166
15
15
  docent/_llm_util/providers/google.py,sha256=2D9mDgenZW0pt0_V7koX-aoZzpl8jo8xE5EWOLK7I0k,20314
16
- docent/_llm_util/providers/openai.py,sha256=4niQV9CNaJ-iiEwYG0BSFxCwcsCAWZz0JuUs4wBKu9M,25904
16
+ docent/_llm_util/providers/openai.py,sha256=ebLUMF2-nTniI8OEBqS5sma5cM_LF0igOoWSfVfnWZw,26016
17
17
  docent/_llm_util/providers/openrouter.py,sha256=sT2onpeQ1gAwJLjkQbzD2RodJWTm013Q-siTXezca10,11958
18
18
  docent/_llm_util/providers/preference_types.py,sha256=K1IH15YyU8E8F7Jk7LgLKiCJeDNk9uASTdnZGk5hSDc,3773
19
19
  docent/_llm_util/providers/provider_registry.py,sha256=EPYGQlegYPtg4ogEusCftm_5PZP-_XVKH1qg3xjPFTU,6337
@@ -53,7 +53,7 @@ docent/samples/tb_airline.json,sha256=eR2jFFRtOw06xqbEglh6-dPewjifOk-cuxJq67Dtu5
53
53
  docent/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  docent/sdk/agent_run_writer.py,sha256=0AWdxejoqZyuj9JSA39WlEwGcMSYTWNqnzIuluySY-M,11043
55
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,,
56
+ docent_python-0.1.25a0.dist-info/METADATA,sha256=kBFVQJ-HqomY9dG6wd3xCw9OyC5gRP7Gz3ZIQHpqq0c,1351
57
+ docent_python-0.1.25a0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
58
+ docent_python-0.1.25a0.dist-info/licenses/LICENSE.md,sha256=QIMv2UiT6MppRasso4ymaA0w7ltkqmlL0HCt8CLD7Rc,580
59
+ docent_python-0.1.25a0.dist-info/RECORD,,