docent-python 0.1.57a0__tar.gz → 0.1.58a0__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.
Files changed (70) hide show
  1. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/PKG-INFO +1 -1
  2. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/reading.py +19 -1
  3. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/sdk/client.py +23 -22
  4. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/sdk/llm_request.py +9 -2
  5. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/sdk/reading.py +16 -2
  6. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/pyproject.toml +1 -1
  7. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/uv.lock +1 -1
  8. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/.gitignore +0 -0
  9. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/LICENSE.md +0 -0
  10. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/README.md +0 -0
  11. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/__init__.py +0 -0
  12. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/__init__.py +0 -0
  13. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/data_models/__init__.py +0 -0
  14. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/data_models/exceptions.py +0 -0
  15. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/data_models/llm_output.py +0 -0
  16. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/llm_cache.py +0 -0
  17. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/llm_svc.py +0 -0
  18. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/model_registry.py +0 -0
  19. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/providers/__init__.py +0 -0
  20. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/providers/anthropic.py +0 -0
  21. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/providers/common.py +0 -0
  22. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/providers/google.py +0 -0
  23. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/providers/openai.py +0 -0
  24. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/providers/openrouter.py +0 -0
  25. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/providers/preference_types.py +0 -0
  26. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_llm_util/providers/provider_registry.py +0 -0
  27. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_log_util/__init__.py +0 -0
  28. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/_log_util/logger.py +0 -0
  29. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/__init__.py +0 -0
  30. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/_tiktoken_util.py +0 -0
  31. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/agent_run.py +0 -0
  32. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/chat/__init__.py +0 -0
  33. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/chat/content.py +0 -0
  34. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/chat/message.py +0 -0
  35. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/chat/response_format.py +0 -0
  36. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/chat/tool.py +0 -0
  37. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/citation.py +0 -0
  38. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/feedback.py +0 -0
  39. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/formatted_objects.py +0 -0
  40. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/judge.py +0 -0
  41. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/metadata_util.py +0 -0
  42. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/regex.py +0 -0
  43. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/transcript.py +0 -0
  44. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/data_models/util.py +0 -0
  45. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/__init__.py +0 -0
  46. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/analysis.py +0 -0
  47. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/impl.py +0 -0
  48. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/runner.py +0 -0
  49. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/stats.py +0 -0
  50. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/types.py +0 -0
  51. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/util/forgiving_json.py +0 -0
  52. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/util/meta_schema.json +0 -0
  53. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/util/meta_schema.py +0 -0
  54. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/util/parse_output.py +0 -0
  55. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/util/template_formatter.py +0 -0
  56. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/judges/util/voting.py +0 -0
  57. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/loaders/load_inspect.py +0 -0
  58. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/mcp/__init__.py +0 -0
  59. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/mcp/__main__.py +0 -0
  60. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/mcp/server.py +0 -0
  61. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/py.typed +0 -0
  62. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/samples/__init__.py +0 -0
  63. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/samples/load.py +0 -0
  64. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/samples/log.eval +0 -0
  65. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/samples/tb_airline.json +0 -0
  66. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/sdk/__init__.py +0 -0
  67. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/sdk/agent_run_writer.py +0 -0
  68. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/sdk/llm_context.py +0 -0
  69. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/trace.py +0 -0
  70. {docent_python-0.1.57a0 → docent_python-0.1.58a0}/docent/trace_temp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docent-python
3
- Version: 0.1.57a0
3
+ Version: 0.1.58a0
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
@@ -185,6 +185,25 @@ class ReadingStep(BaseModel):
185
185
  approved_at: datetime | None = None
186
186
  submitted_at: datetime | None = None
187
187
 
188
+ def to_submission(self, *, dql_query: str | None = None) -> "ReadingStepSubmission":
189
+ """Convert to a ReadingStepSubmission for resolve_reading_entry.
190
+
191
+ Optionally overrides dql_query (e.g. after alias substitution).
192
+ """
193
+ return ReadingStepSubmission(
194
+ alias=self.alias,
195
+ name=self.name,
196
+ model=self.model,
197
+ output_schema=self.output_schema,
198
+ max_new_tokens=self.max_new_tokens,
199
+ user_metadata=self.user_metadata,
200
+ prompt_template_segments=self.prompt_template_segments,
201
+ context_config=self.context_config,
202
+ dql_query=dql_query if dql_query is not None else self.dql_query,
203
+ source_reading_preset_id=self.source_reading_preset_id,
204
+ cache_mode=self.cache_mode,
205
+ )
206
+
188
207
 
189
208
  PlanStep: TypeAlias = BeginGroupStep | EndGroupStep | DqlOnlyStep | ReadingStep
190
209
 
@@ -285,7 +304,6 @@ class PlanSubmissionRequest(BaseModel):
285
304
  plan_name: str | None = None
286
305
  source_script: str | None = None
287
306
  entries: list[PlanStepSubmission]
288
- upsert_by_name: bool = False
289
307
 
290
308
 
291
309
  class PlanStepSubmissionStatus(BaseModel):
@@ -373,7 +373,6 @@ class Docent:
373
373
  self._plan_name_sent: bool = False
374
374
  self._is_notebook: bool = False
375
375
  self._notebook_hook_registered: bool = False
376
- self._flushed_names: set[str] = set()
377
376
 
378
377
  self._register_notebook_hook()
379
378
 
@@ -2279,7 +2278,10 @@ class Docent:
2279
2278
  output_schema: dict[str, Any] | None = None,
2280
2279
  max_concurrency: int | None = None,
2281
2280
  ) -> dict[str, Any]:
2282
- """Submit LLM requests for processing.
2281
+ """
2282
+ Deprecated - use readings instead.
2283
+
2284
+ Submit LLM requests for processing.
2283
2285
 
2284
2286
  Creates a result set and submits requests for background LLM processing.
2285
2287
  Prints the result set URL and returns submission details.
@@ -2380,7 +2382,10 @@ class Docent:
2380
2382
  result_set_name: str | None = None,
2381
2383
  exists_ok: bool = False,
2382
2384
  ) -> dict[str, Any]:
2383
- """Submit pre-computed results directly.
2385
+ """
2386
+ Deprecated.
2387
+
2388
+ Submit pre-computed results directly.
2384
2389
 
2385
2390
  For use when you've run analysis locally (e.g., with a local LLM)
2386
2391
  and want to upload the results to Docent for viewing.
@@ -2431,7 +2436,10 @@ class Docent:
2431
2436
  collection_id: str,
2432
2437
  name_or_id: str,
2433
2438
  ) -> dict[str, Any]:
2434
- """Get a result set by name or ID.
2439
+ """
2440
+ Deprecated - use readings instead.
2441
+
2442
+ Get a result set by name or ID.
2435
2443
 
2436
2444
  Args:
2437
2445
  collection_id: ID of the Collection.
@@ -2456,7 +2464,10 @@ class Docent:
2456
2464
  with_auto_joins: bool = False,
2457
2465
  include_incomplete: bool = False,
2458
2466
  ) -> "pd.DataFrame":
2459
- """Get result set contents as a pandas DataFrame.
2467
+ """
2468
+ Deprecated - use readings instead.
2469
+
2470
+ Get result set contents as a pandas DataFrame.
2460
2471
 
2461
2472
  Args:
2462
2473
  collection_id: ID of the Collection.
@@ -2563,7 +2574,10 @@ class Docent:
2563
2574
  collection_id: str,
2564
2575
  name_or_id: str,
2565
2576
  ) -> str:
2566
- """Open a result set in the browser.
2577
+ """
2578
+ Deprecated - use readings instead.
2579
+
2580
+ Open a result set in the browser.
2567
2581
 
2568
2582
  Args:
2569
2583
  collection_id: ID of the Collection.
@@ -2665,14 +2679,6 @@ class Docent:
2665
2679
  return alias
2666
2680
 
2667
2681
  def _enqueue_pending(self, entry: PendingEntry) -> None:
2668
- """Add a pending entry, replacing any existing entry with the same name."""
2669
- name: str | None = getattr(entry, "name", None)
2670
- if name is not None:
2671
- for i, existing in enumerate(self._pending):
2672
- existing_name: str | None = getattr(existing, "name", None)
2673
- if existing_name == name:
2674
- self._pending[i] = entry
2675
- return
2676
2682
  self._pending.append(entry)
2677
2683
 
2678
2684
  def _register_atexit(self) -> None:
@@ -2900,11 +2906,13 @@ class Docent:
2900
2906
 
2901
2907
  param_name = seg.column_name
2902
2908
  param_type = seg.type_annotation or "unknown"
2909
+ # Unknown type means "defer to server-side inference"; false here does not
2910
+ # mean the caller explicitly declared a scalar placeholder.
2903
2911
  segments.append(
2904
2912
  {
2905
2913
  "param_name": param_name,
2906
2914
  "param_type": param_type,
2907
- "is_list": False,
2915
+ "is_list": seg.is_list_annotation if seg.type_annotation else False,
2908
2916
  }
2909
2917
  )
2910
2918
  if context_config and param_name not in param_configs:
@@ -3119,14 +3127,11 @@ class Docent:
3119
3127
  else None
3120
3128
  )
3121
3129
 
3122
- upsert_by_name = bool(self._flushed_names)
3123
-
3124
3130
  request_body = PlanSubmissionRequest(
3125
3131
  plan_id=self._plan_id,
3126
3132
  plan_name=plan_name,
3127
3133
  source_script=source_script,
3128
3134
  entries=entries,
3129
- upsert_by_name=upsert_by_name,
3130
3135
  )
3131
3136
  is_first_flush_for_plan = self._plan_id is None
3132
3137
 
@@ -3141,10 +3146,6 @@ class Docent:
3141
3146
  self._flushed_collection_id = collection_id
3142
3147
  self._plan_name_sent = True
3143
3148
 
3144
- for p in self._pending:
3145
- entry_name: str | None = getattr(p, "name", None)
3146
- if entry_name is not None:
3147
- self._flushed_names.add(entry_name)
3148
3149
  self._pending.clear()
3149
3150
 
3150
3151
  for status_entry in result.get("entry_statuses", []):
@@ -6,7 +6,10 @@ from docent.sdk.llm_context import PromptData
6
6
 
7
7
 
8
8
  class LLMRequest(BaseModel):
9
- """Represents a request for LLM analysis of agent runs/transcripts.
9
+ """
10
+ Deprecated - use readings instead.
11
+
12
+ Represents a request for LLM analysis of agent runs/transcripts.
10
13
 
11
14
  Example:
12
15
  from docent.sdk.llm_context import Prompt, AgentRunRef
@@ -34,7 +37,11 @@ class LLMRequest(BaseModel):
34
37
 
35
38
 
36
39
  class ExternalAnalysisResult(BaseModel):
37
- """Result of run analysis from an external source."""
40
+ """
41
+ Deprecated.
42
+
43
+ Result of run analysis from an external source.
44
+ """
38
45
 
39
46
  request: LLMRequest
40
47
  output: dict[str, Any]
@@ -30,6 +30,7 @@ class ColumnRef:
30
30
  self._query_result = query_result
31
31
  self._column_name = column_name
32
32
  self._type_annotation: AnnotatableReadingParamType | None = None
33
+ self._is_list_annotation = False
33
34
 
34
35
  @property
35
36
  def query_result(self) -> QueryResult:
@@ -43,16 +44,29 @@ class ColumnRef:
43
44
  def type_annotation(self) -> AnnotatableReadingParamType | None:
44
45
  return self._type_annotation
45
46
 
46
- def as_type(self, type_name: AnnotatableReadingParamType) -> ColumnRef:
47
+ @property
48
+ def is_list_annotation(self) -> bool:
49
+ return self._is_list_annotation
50
+
51
+ def as_type(
52
+ self,
53
+ type_name: AnnotatableReadingParamType,
54
+ *,
55
+ is_list: bool = False,
56
+ ) -> ColumnRef:
47
57
  """Annotate this column reference with an explicit type (e.g. 'transcript')."""
48
58
  clone = ColumnRef(self._query_result, self._column_name)
49
59
  clone._type_annotation = type_name
60
+ clone._is_list_annotation = is_list
50
61
  return clone
51
62
 
52
63
  def __repr__(self) -> str:
53
64
  base = f"ColumnRef({self._query_result!r}, {self._column_name!r})"
54
65
  if self._type_annotation:
55
- base = f"{base}.as_type({self._type_annotation!r})"
66
+ if self._is_list_annotation:
67
+ base = f"{base}.as_type({self._type_annotation!r}, is_list=True)"
68
+ else:
69
+ base = f"{base}.as_type({self._type_annotation!r})"
56
70
  return base
57
71
 
58
72
 
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "docent-python"
3
3
  description = "Docent SDK"
4
- version = "0.1.57-alpha"
4
+ version = "0.1.58-alpha"
5
5
  authors = [
6
6
  { name="Transluce", email="info@transluce.org" },
7
7
  ]
@@ -553,7 +553,7 @@ wheels = [
553
553
 
554
554
  [[package]]
555
555
  name = "docent-python"
556
- version = "0.1.57a0"
556
+ version = "0.1.58a0"
557
557
  source = { editable = "." }
558
558
  dependencies = [
559
559
  { name = "anthropic" },