docent-python 0.1.9a0__tar.gz → 0.1.10a0__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.

Potentially problematic release.


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

Files changed (31) hide show
  1. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/.gitignore +1 -0
  2. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/PKG-INFO +1 -1
  3. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/sdk/client.py +33 -31
  4. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/pyproject.toml +1 -1
  5. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/LICENSE.md +0 -0
  6. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/README.md +0 -0
  7. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/__init__.py +0 -0
  8. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/_log_util/__init__.py +0 -0
  9. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/_log_util/logger.py +0 -0
  10. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/__init__.py +0 -0
  11. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/_tiktoken_util.py +0 -0
  12. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/agent_run.py +0 -0
  13. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/chat/__init__.py +0 -0
  14. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/chat/content.py +0 -0
  15. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/chat/message.py +0 -0
  16. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/chat/tool.py +0 -0
  17. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/citation.py +0 -0
  18. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/metadata.py +0 -0
  19. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/regex.py +0 -0
  20. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/shared_types.py +0 -0
  21. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/data_models/transcript.py +0 -0
  22. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/loaders/load_inspect.py +0 -0
  23. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/py.typed +0 -0
  24. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/samples/__init__.py +0 -0
  25. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/samples/load.py +0 -0
  26. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/samples/log.eval +0 -0
  27. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/samples/tb_airline.json +0 -0
  28. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/sdk/__init__.py +0 -0
  29. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/trace.py +0 -0
  30. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/docent/trace_temp.py +0 -0
  31. {docent_python-0.1.9a0 → docent_python-0.1.10a0}/uv.lock +0 -0
@@ -135,6 +135,7 @@ celerybeat.pid
135
135
  # Environments
136
136
  .env
137
137
  .env.*
138
+ !.env.template
138
139
  .venv
139
140
  env/
140
141
  venv/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docent-python
3
- Version: 0.1.9a0
3
+ Version: 0.1.10a0
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
@@ -196,7 +196,7 @@ class Docent:
196
196
  response.raise_for_status()
197
197
  return response.json()
198
198
 
199
- def list_searches(self, collection_id: str) -> list[dict[str, Any]]:
199
+ def list_rubrics(self, collection_id: str) -> list[dict[str, Any]]:
200
200
  """List all rubrics for a given collection.
201
201
 
202
202
  Args:
@@ -213,71 +213,73 @@ class Docent:
213
213
  response.raise_for_status()
214
214
  return response.json()
215
215
 
216
- def get_search_results(
217
- self, collection_id: str, rubric_id: str, rubric_version: int
218
- ) -> list[dict[str, Any]]:
219
- """Get rubric results for a given collection, rubric and version.
216
+ def get_rubric_run_state(self, collection_id: str, rubric_id: str) -> dict[str, Any]:
217
+ """Get rubric run state for a given collection and rubric.
220
218
 
221
219
  Args:
222
220
  collection_id: ID of the Collection.
223
- rubric_id: The ID of the rubric to get results for.
224
- rubric_version: The version of the rubric to get results for.
221
+ rubric_id: The ID of the rubric to get run state for.
225
222
 
226
223
  Returns:
227
- list: List of dictionaries containing rubric result information.
224
+ dict: Dictionary containing rubric run state with results, job_id, and total_agent_runs.
228
225
 
229
226
  Raises:
230
227
  requests.exceptions.HTTPError: If the API request fails.
231
228
  """
232
- url = f"{self._server_url}/rubric/{collection_id}/{rubric_id}/results"
233
- response = self._session.get(url, params={"rubric_version": rubric_version})
229
+ url = f"{self._server_url}/rubric/{collection_id}/{rubric_id}/rubric_run_state"
230
+ response = self._session.get(url)
234
231
  response.raise_for_status()
235
232
  return response.json()
236
233
 
237
- def list_search_clusters(
238
- self, collection_id: str, rubric_id: str, rubric_version: int | None = None
239
- ) -> list[dict[str, Any]]:
240
- """List all centroids for a given collection and rubric.
234
+ def get_clustering_state(self, collection_id: str, rubric_id: str) -> dict[str, Any]:
235
+ """Get clustering state for a given collection and rubric.
241
236
 
242
237
  Args:
243
238
  collection_id: ID of the Collection.
244
- rubric_id: The ID of the rubric to get centroids for.
245
- rubric_version: Optional version of the rubric. If not provided, uses latest.
239
+ rubric_id: The ID of the rubric to get clustering state for.
246
240
 
247
241
  Returns:
248
- list: List of dictionaries containing centroid information.
242
+ dict: Dictionary containing job_id, centroids, and assignments.
249
243
 
250
244
  Raises:
251
245
  requests.exceptions.HTTPError: If the API request fails.
252
246
  """
253
- url = f"{self._server_url}/rubric/{collection_id}/{rubric_id}/centroids"
254
- params: dict[str, int] = {}
255
- if rubric_version is not None:
256
- params["rubric_version"] = rubric_version
257
- response = self._session.get(url, params=params)
247
+ url = f"{self._server_url}/rubric/{collection_id}/{rubric_id}/clustering_job"
248
+ response = self._session.get(url)
258
249
  response.raise_for_status()
259
250
  return response.json()
260
251
 
261
- def get_cluster_matches(
262
- self, collection_id: str, rubric_id: str, rubric_version: int
263
- ) -> list[dict[str, Any]]:
252
+ def get_cluster_centroids(self, collection_id: str, rubric_id: str) -> list[dict[str, Any]]:
253
+ """Get centroids for a given collection and rubric.
254
+
255
+ Args:
256
+ collection_id: ID of the Collection.
257
+ rubric_id: The ID of the rubric to get centroids for.
258
+
259
+ Returns:
260
+ list: List of dictionaries containing centroid information.
261
+
262
+ Raises:
263
+ requests.exceptions.HTTPError: If the API request fails.
264
+ """
265
+ clustering_state = self.get_clustering_state(collection_id, rubric_id)
266
+ return clustering_state.get("centroids", [])
267
+
268
+ def get_cluster_assignments(self, collection_id: str, rubric_id: str) -> dict[str, list[str]]:
264
269
  """Get centroid assignments for a given rubric.
265
270
 
266
271
  Args:
267
272
  collection_id: ID of the Collection.
268
273
  rubric_id: The ID of the rubric to get assignments for.
269
- rubric_version: The version of the rubric to get assignments for.
270
274
 
271
275
  Returns:
272
- list: List of dictionaries containing centroid assignment information.
276
+ dict: Dictionary mapping centroid IDs to lists of judge result IDs.
273
277
 
274
278
  Raises:
275
279
  requests.exceptions.HTTPError: If the API request fails.
276
280
  """
277
- url = f"{self._server_url}/rubric/{collection_id}/{rubric_id}/assignments"
278
- response = self._session.get(url, params={"rubric_version": rubric_version})
279
- response.raise_for_status()
280
- return response.json()
281
+ clustering_state = self.get_clustering_state(collection_id, rubric_id)
282
+ return clustering_state.get("assignments", {})
281
283
 
282
284
  def get_agent_run(self, collection_id: str, agent_run_id: str) -> AgentRun | None:
283
285
  """Get a specific agent run by its ID.
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "docent-python"
3
3
  description = "Docent SDK"
4
- version = "0.1.9-alpha"
4
+ version = "0.1.10-alpha"
5
5
  authors = [
6
6
  { name="Transluce", email="info@transluce.org" },
7
7
  ]