retab 0.0.45__tar.gz → 0.0.46__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 (127) hide show
  1. {retab-0.0.45 → retab-0.0.46}/PKG-INFO +1 -1
  2. {retab-0.0.45 → retab-0.0.46}/retab/generate_types.py +1 -1
  3. {retab-0.0.45 → retab-0.0.46}/retab/resources/projects/client.py +21 -21
  4. {retab-0.0.45 → retab-0.0.46}/retab/resources/projects/documents.py +43 -43
  5. {retab-0.0.45 → retab-0.0.46}/retab/resources/projects/iterations.py +54 -54
  6. {retab-0.0.45 → retab-0.0.46}/retab/types/ai_models.py +1 -1
  7. {retab-0.0.45 → retab-0.0.46}/retab/types/projects/documents.py +2 -0
  8. {retab-0.0.45 → retab-0.0.46}/retab/utils/benchmarking.py +1 -1
  9. {retab-0.0.45 → retab-0.0.46}/retab.egg-info/PKG-INFO +1 -1
  10. {retab-0.0.45 → retab-0.0.46}/setup.py +1 -1
  11. {retab-0.0.45 → retab-0.0.46}/tests/test_evaluations.py +56 -56
  12. {retab-0.0.45 → retab-0.0.46}/README.md +0 -0
  13. {retab-0.0.45 → retab-0.0.46}/pyproject.toml +0 -0
  14. {retab-0.0.45 → retab-0.0.46}/retab/__init__.py +0 -0
  15. {retab-0.0.45 → retab-0.0.46}/retab/_resource.py +0 -0
  16. {retab-0.0.45 → retab-0.0.46}/retab/client.py +0 -0
  17. {retab-0.0.45 → retab-0.0.46}/retab/py.typed +0 -0
  18. {retab-0.0.45 → retab-0.0.46}/retab/resources/__init__.py +0 -0
  19. {retab-0.0.45 → retab-0.0.46}/retab/resources/consensus/__init__.py +0 -0
  20. {retab-0.0.45 → retab-0.0.46}/retab/resources/consensus/client.py +0 -0
  21. {retab-0.0.45 → retab-0.0.46}/retab/resources/consensus/completions.py +0 -0
  22. {retab-0.0.45 → retab-0.0.46}/retab/resources/consensus/completions_stream.py +0 -0
  23. {retab-0.0.45 → retab-0.0.46}/retab/resources/consensus/responses.py +0 -0
  24. {retab-0.0.45 → retab-0.0.46}/retab/resources/consensus/responses_stream.py +0 -0
  25. {retab-0.0.45 → retab-0.0.46}/retab/resources/deployments/__init__.py +0 -0
  26. {retab-0.0.45 → retab-0.0.46}/retab/resources/deployments/client.py +0 -0
  27. {retab-0.0.45 → retab-0.0.46}/retab/resources/documents/__init__.py +0 -0
  28. {retab-0.0.45 → retab-0.0.46}/retab/resources/documents/client.py +0 -0
  29. {retab-0.0.45 → retab-0.0.46}/retab/resources/documents/extractions.py +0 -0
  30. {retab-0.0.45 → retab-0.0.46}/retab/resources/files.py +0 -0
  31. {retab-0.0.45 → retab-0.0.46}/retab/resources/finetuning.py +0 -0
  32. {retab-0.0.45 → retab-0.0.46}/retab/resources/jsonlUtils.py +0 -0
  33. {retab-0.0.45 → retab-0.0.46}/retab/resources/models.py +0 -0
  34. {retab-0.0.45 → retab-0.0.46}/retab/resources/openai_example.py +0 -0
  35. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/__init__.py +0 -0
  36. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/automations/__init__.py +0 -0
  37. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/automations/client.py +0 -0
  38. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/automations/endpoints.py +0 -0
  39. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/automations/links.py +0 -0
  40. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/automations/logs.py +0 -0
  41. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/automations/mailboxes.py +0 -0
  42. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/automations/outlook.py +0 -0
  43. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/automations/tests.py +0 -0
  44. {retab-0.0.45 → retab-0.0.46}/retab/resources/processors/client.py +0 -0
  45. {retab-0.0.45 → retab-0.0.46}/retab/resources/projects/__init__.py +0 -0
  46. {retab-0.0.45 → retab-0.0.46}/retab/resources/prompt_optimization.py +0 -0
  47. {retab-0.0.45 → retab-0.0.46}/retab/resources/schemas.py +0 -0
  48. {retab-0.0.45 → retab-0.0.46}/retab/resources/secrets/__init__.py +0 -0
  49. {retab-0.0.45 → retab-0.0.46}/retab/resources/secrets/client.py +0 -0
  50. {retab-0.0.45 → retab-0.0.46}/retab/resources/secrets/external_api_keys.py +0 -0
  51. {retab-0.0.45 → retab-0.0.46}/retab/resources/secrets/webhook.py +0 -0
  52. {retab-0.0.45 → retab-0.0.46}/retab/resources/usage.py +0 -0
  53. {retab-0.0.45 → retab-0.0.46}/retab/types/__init__.py +0 -0
  54. {retab-0.0.45 → retab-0.0.46}/retab/types/automations/__init__.py +0 -0
  55. {retab-0.0.45 → retab-0.0.46}/retab/types/automations/cron.py +0 -0
  56. {retab-0.0.45 → retab-0.0.46}/retab/types/automations/endpoints.py +0 -0
  57. {retab-0.0.45 → retab-0.0.46}/retab/types/automations/links.py +0 -0
  58. {retab-0.0.45 → retab-0.0.46}/retab/types/automations/mailboxes.py +0 -0
  59. {retab-0.0.45 → retab-0.0.46}/retab/types/automations/outlook.py +0 -0
  60. {retab-0.0.45 → retab-0.0.46}/retab/types/automations/webhooks.py +0 -0
  61. {retab-0.0.45 → retab-0.0.46}/retab/types/browser_canvas.py +0 -0
  62. {retab-0.0.45 → retab-0.0.46}/retab/types/chat.py +0 -0
  63. {retab-0.0.45 → retab-0.0.46}/retab/types/completions.py +0 -0
  64. {retab-0.0.45 → retab-0.0.46}/retab/types/consensus.py +0 -0
  65. {retab-0.0.45 → retab-0.0.46}/retab/types/db/__init__.py +0 -0
  66. {retab-0.0.45 → retab-0.0.46}/retab/types/db/annotations.py +0 -0
  67. {retab-0.0.45 → retab-0.0.46}/retab/types/db/files.py +0 -0
  68. {retab-0.0.45 → retab-0.0.46}/retab/types/deprecated_evals.py +0 -0
  69. {retab-0.0.45 → retab-0.0.46}/retab/types/documents/__init__.py +0 -0
  70. {retab-0.0.45 → retab-0.0.46}/retab/types/documents/correct_orientation.py +0 -0
  71. {retab-0.0.45 → retab-0.0.46}/retab/types/documents/create_messages.py +0 -0
  72. {retab-0.0.45 → retab-0.0.46}/retab/types/documents/extractions.py +0 -0
  73. {retab-0.0.45 → retab-0.0.46}/retab/types/documents/parse.py +0 -0
  74. {retab-0.0.45 → retab-0.0.46}/retab/types/events.py +0 -0
  75. {retab-0.0.45 → retab-0.0.46}/retab/types/extractions.py +0 -0
  76. {retab-0.0.45 → retab-0.0.46}/retab/types/inference_settings.py +0 -0
  77. {retab-0.0.45 → retab-0.0.46}/retab/types/jobs/__init__.py +0 -0
  78. {retab-0.0.45 → retab-0.0.46}/retab/types/jobs/base.py +0 -0
  79. {retab-0.0.45 → retab-0.0.46}/retab/types/jobs/batch_annotation.py +0 -0
  80. {retab-0.0.45 → retab-0.0.46}/retab/types/jobs/evaluation.py +0 -0
  81. {retab-0.0.45 → retab-0.0.46}/retab/types/jobs/finetune.py +0 -0
  82. {retab-0.0.45 → retab-0.0.46}/retab/types/jobs/prompt_optimization.py +0 -0
  83. {retab-0.0.45 → retab-0.0.46}/retab/types/jobs/webcrawl.py +0 -0
  84. {retab-0.0.45 → retab-0.0.46}/retab/types/logs.py +0 -0
  85. {retab-0.0.45 → retab-0.0.46}/retab/types/metrics.py +0 -0
  86. {retab-0.0.45 → retab-0.0.46}/retab/types/mime.py +0 -0
  87. {retab-0.0.45 → retab-0.0.46}/retab/types/modalities.py +0 -0
  88. {retab-0.0.45 → retab-0.0.46}/retab/types/pagination.py +0 -0
  89. {retab-0.0.45 → retab-0.0.46}/retab/types/predictions.py +0 -0
  90. {retab-0.0.45 → retab-0.0.46}/retab/types/projects/__init__.py +0 -0
  91. {retab-0.0.45 → retab-0.0.46}/retab/types/projects/iterations.py +0 -0
  92. {retab-0.0.45 → retab-0.0.46}/retab/types/projects/model.py +0 -0
  93. {retab-0.0.45 → retab-0.0.46}/retab/types/schemas/__init__.py +0 -0
  94. {retab-0.0.45 → retab-0.0.46}/retab/types/schemas/enhance.py +0 -0
  95. {retab-0.0.45 → retab-0.0.46}/retab/types/schemas/evaluate.py +0 -0
  96. {retab-0.0.45 → retab-0.0.46}/retab/types/schemas/generate.py +0 -0
  97. {retab-0.0.45 → retab-0.0.46}/retab/types/schemas/layout.py +0 -0
  98. {retab-0.0.45 → retab-0.0.46}/retab/types/schemas/object.py +0 -0
  99. {retab-0.0.45 → retab-0.0.46}/retab/types/schemas/templates.py +0 -0
  100. {retab-0.0.45 → retab-0.0.46}/retab/types/secrets/__init__.py +0 -0
  101. {retab-0.0.45 → retab-0.0.46}/retab/types/secrets/external_api_keys.py +0 -0
  102. {retab-0.0.45 → retab-0.0.46}/retab/types/standards.py +0 -0
  103. {retab-0.0.45 → retab-0.0.46}/retab/utils/__init__.py +0 -0
  104. {retab-0.0.45 → retab-0.0.46}/retab/utils/_model_cards/anthropic.yaml +0 -0
  105. {retab-0.0.45 → retab-0.0.46}/retab/utils/_model_cards/auto.yaml +0 -0
  106. {retab-0.0.45 → retab-0.0.46}/retab/utils/_model_cards/gemini.yaml +0 -0
  107. {retab-0.0.45 → retab-0.0.46}/retab/utils/_model_cards/openai.yaml +0 -0
  108. {retab-0.0.45 → retab-0.0.46}/retab/utils/_model_cards/xai.yaml +0 -0
  109. {retab-0.0.45 → retab-0.0.46}/retab/utils/ai_models.py +0 -0
  110. {retab-0.0.45 → retab-0.0.46}/retab/utils/chat.py +0 -0
  111. {retab-0.0.45 → retab-0.0.46}/retab/utils/display.py +0 -0
  112. {retab-0.0.45 → retab-0.0.46}/retab/utils/hashing.py +0 -0
  113. {retab-0.0.45 → retab-0.0.46}/retab/utils/json_schema.py +0 -0
  114. {retab-0.0.45 → retab-0.0.46}/retab/utils/mime.py +0 -0
  115. {retab-0.0.45 → retab-0.0.46}/retab/utils/responses.py +0 -0
  116. {retab-0.0.45 → retab-0.0.46}/retab/utils/stream_context_managers.py +0 -0
  117. {retab-0.0.45 → retab-0.0.46}/retab/utils/usage/__init__.py +0 -0
  118. {retab-0.0.45 → retab-0.0.46}/retab/utils/usage/usage.py +0 -0
  119. {retab-0.0.45 → retab-0.0.46}/retab.egg-info/SOURCES.txt +0 -0
  120. {retab-0.0.45 → retab-0.0.46}/retab.egg-info/dependency_links.txt +0 -0
  121. {retab-0.0.45 → retab-0.0.46}/retab.egg-info/requires.txt +0 -0
  122. {retab-0.0.45 → retab-0.0.46}/retab.egg-info/top_level.txt +0 -0
  123. {retab-0.0.45 → retab-0.0.46}/setup.cfg +0 -0
  124. {retab-0.0.45 → retab-0.0.46}/tests/test_automations_links.py +0 -0
  125. {retab-0.0.45 → retab-0.0.46}/tests/test_automations_mailboxes.py +0 -0
  126. {retab-0.0.45 → retab-0.0.46}/tests/test_documents_api.py +0 -0
  127. {retab-0.0.45 → retab-0.0.46}/tests/test_preprocessor.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: retab
3
- Version: 0.0.45
3
+ Version: 0.0.46
4
4
  Summary: Retab official python library
5
5
  Home-page: https://github.com/Retab-dev/retab
6
6
  Author: Retab
@@ -49,7 +49,7 @@ def type_to_zod(field_type: Any, put_names: bool = True, ts: bool = False) -> st
49
49
  excluded_fields = set()
50
50
  typename = "z.object({\n"
51
51
  ts_typename = "{\n"
52
- props = [(n, f.annotation, f.default) for n, f in origin.model_fields.items()] if issubclass(origin, BaseModel) else \
52
+ props = [(n, f.annotation, f.default) for n, f in origin.model_fields.items() if not f.exclude] if issubclass(origin, BaseModel) else \
53
53
  [(n, f, PydanticUndefined) for n, f in origin.__annotations__.items()]
54
54
 
55
55
  for field_name, field, default in props:
@@ -26,12 +26,12 @@ class ProjectsMixin:
26
26
  eval_data = BaseProject(**eval_dict)
27
27
  return PreparedRequest(method="POST", url="/v1/projects", data=eval_data.model_dump(exclude_unset=True, mode="json"))
28
28
 
29
- def prepare_get(self, evaluation_id: str) -> PreparedRequest:
30
- return PreparedRequest(method="GET", url=f"/v1/projects/{evaluation_id}")
29
+ def prepare_get(self, project_id: str) -> PreparedRequest:
30
+ return PreparedRequest(method="GET", url=f"/v1/projects/{project_id}")
31
31
 
32
32
  def prepare_update(
33
33
  self,
34
- evaluation_id: str,
34
+ project_id: str,
35
35
  name: str = FieldUnset,
36
36
  json_schema: dict[str, Any] = FieldUnset,
37
37
  default_inference_settings: InferenceSettings = FieldUnset,
@@ -52,7 +52,7 @@ class ProjectsMixin:
52
52
 
53
53
  data = PatchProjectRequest(**update_dict).model_dump(exclude_unset=True, mode="json")
54
54
 
55
- return PreparedRequest(method="PATCH", url=f"/v1/projects/{evaluation_id}", data=data)
55
+ return PreparedRequest(method="PATCH", url=f"/v1/projects/{project_id}", data=data)
56
56
 
57
57
  def prepare_list(self) -> PreparedRequest:
58
58
  """
@@ -105,25 +105,25 @@ class Projects(SyncAPIResource, ProjectsMixin):
105
105
  response = self._client._prepared_request(request)
106
106
  return Project(**response)
107
107
 
108
- def get(self, evaluation_id: str) -> Project:
108
+ def get(self, project_id: str) -> Project:
109
109
  """
110
110
  Get an evaluation by ID.
111
111
 
112
112
  Args:
113
- evaluation_id: The ID of the evaluation to retrieve
113
+ project_id: The ID of the evaluation to retrieve
114
114
 
115
115
  Returns:
116
116
  Project: The evaluation
117
117
  Raises:
118
118
  HTTPException if the request fails
119
119
  """
120
- request = self.prepare_get(evaluation_id)
120
+ request = self.prepare_get(project_id)
121
121
  response = self._client._prepared_request(request)
122
122
  return Project(**response)
123
123
 
124
124
  def update(
125
125
  self,
126
- evaluation_id: str,
126
+ project_id: str,
127
127
  name: str = FieldUnset,
128
128
  json_schema: dict[str, Any] = FieldUnset,
129
129
  default_inference_settings: InferenceSettings = FieldUnset,
@@ -132,7 +132,7 @@ class Projects(SyncAPIResource, ProjectsMixin):
132
132
  Update an evaluation with partial updates.
133
133
 
134
134
  Args:
135
- evaluation_id: The ID of the evaluation to update
135
+ project_id: The ID of the evaluation to update
136
136
  name: Optional new name for the evaluation
137
137
  json_schema: Optional new JSON schema
138
138
  documents: Optional list of documents to update
@@ -145,7 +145,7 @@ class Projects(SyncAPIResource, ProjectsMixin):
145
145
  HTTPException if the request fails
146
146
  """
147
147
  request = self.prepare_update(
148
- evaluation_id=evaluation_id,
148
+ project_id=project_id,
149
149
  name=name,
150
150
  json_schema=json_schema,
151
151
  default_inference_settings=default_inference_settings,
@@ -167,19 +167,19 @@ class Projects(SyncAPIResource, ProjectsMixin):
167
167
  response = self._client._prepared_request(request)
168
168
  return [Project(**item) for item in response.get("data", [])]
169
169
 
170
- def delete(self, evaluation_id: str) -> DeleteResponse:
170
+ def delete(self, project_id: str) -> DeleteResponse:
171
171
  """
172
172
  Delete an evaluation.
173
173
 
174
174
  Args:
175
- evaluation_id: The ID of the evaluation to delete
175
+ project_id: The ID of the evaluation to delete
176
176
 
177
177
  Returns:
178
178
  DeleteResponse: The response containing success status and ID
179
179
  Raises:
180
180
  HTTPException if the request fails
181
181
  """
182
- request = self.prepare_delete(evaluation_id)
182
+ request = self.prepare_delete(project_id)
183
183
  return self._client._prepared_request(request)
184
184
 
185
185
 
@@ -208,25 +208,25 @@ class AsyncProjects(AsyncAPIResource, ProjectsMixin):
208
208
  response = await self._client._prepared_request(request)
209
209
  return Project(**response)
210
210
 
211
- async def get(self, evaluation_id: str) -> Project:
211
+ async def get(self, project_id: str) -> Project:
212
212
  """
213
213
  Get an evaluation by ID.
214
214
 
215
215
  Args:
216
- evaluation_id: The ID of the evaluation to retrieve
216
+ project_id: The ID of the evaluation to retrieve
217
217
 
218
218
  Returns:
219
219
  Project: The evaluation
220
220
  Raises:
221
221
  HTTPException if the request fails
222
222
  """
223
- request = self.prepare_get(evaluation_id)
223
+ request = self.prepare_get(project_id)
224
224
  response = await self._client._prepared_request(request)
225
225
  return Project(**response)
226
226
 
227
227
  async def update(
228
228
  self,
229
- evaluation_id: str,
229
+ project_id: str,
230
230
  name: str = FieldUnset,
231
231
  json_schema: dict[str, Any] = FieldUnset,
232
232
  default_inference_settings: InferenceSettings = FieldUnset,
@@ -248,7 +248,7 @@ class AsyncProjects(AsyncAPIResource, ProjectsMixin):
248
248
  HTTPException if the request fails
249
249
  """
250
250
  request = self.prepare_update(
251
- evaluation_id=evaluation_id,
251
+ project_id=project_id,
252
252
  name=name,
253
253
  json_schema=json_schema,
254
254
  default_inference_settings=default_inference_settings,
@@ -269,17 +269,17 @@ class AsyncProjects(AsyncAPIResource, ProjectsMixin):
269
269
  response = await self._client._prepared_request(request)
270
270
  return [Project(**item) for item in response.get("data", [])]
271
271
 
272
- async def delete(self, evaluation_id: str) -> DeleteResponse:
272
+ async def delete(self, project_id: str) -> DeleteResponse:
273
273
  """
274
274
  Delete an evaluation.
275
275
 
276
276
  Args:
277
- evaluation_id: The ID of the evaluation to delete
277
+ project_id: The ID of the evaluation to delete
278
278
 
279
279
  Returns:
280
280
  DeleteResponse: The response containing success status and ID
281
281
  Raises:
282
282
  HTTPException if the request fails
283
283
  """
284
- request = self.prepare_delete(evaluation_id)
284
+ request = self.prepare_delete(project_id)
285
285
  return await self._client._prepared_request(request)
@@ -15,26 +15,26 @@ from ...types.documents.extractions import RetabParsedChatCompletion
15
15
 
16
16
 
17
17
  class DocumentsMixin:
18
- def prepare_get(self, evaluation_id: str, document_id: str) -> PreparedRequest:
19
- return PreparedRequest(method="GET", url=f"/v1/projects/{evaluation_id}/documents/{document_id}")
18
+ def prepare_get(self, project_id: str, document_id: str) -> PreparedRequest:
19
+ return PreparedRequest(method="GET", url=f"/v1/projects/{project_id}/documents/{document_id}")
20
20
 
21
- def prepare_create(self, evaluation_id: str, document: MIMEData, annotation: dict[str, Any], annotation_metadata: dict[str, Any] | None = None) -> PreparedRequest:
21
+ def prepare_create(self, project_id: str, document: MIMEData, annotation: dict[str, Any], annotation_metadata: dict[str, Any] | None = None) -> PreparedRequest:
22
22
  # Serialize the MIMEData
23
23
  document_item = DocumentItem(mime_data=document, annotation=annotation, annotation_metadata=PredictionMetadata(**annotation_metadata) if annotation_metadata else None)
24
- return PreparedRequest(method="POST", url=f"/v1/projects/{evaluation_id}/documents", data=document_item.model_dump(mode="json"))
24
+ return PreparedRequest(method="POST", url=f"/v1/projects/{project_id}/documents", data=document_item.model_dump(mode="json"))
25
25
 
26
- def prepare_list(self, evaluation_id: str) -> PreparedRequest:
27
- return PreparedRequest(method="GET", url=f"/v1/projects/{evaluation_id}/documents")
26
+ def prepare_list(self, project_id: str) -> PreparedRequest:
27
+ return PreparedRequest(method="GET", url=f"/v1/projects/{project_id}/documents")
28
28
 
29
- def prepare_update(self, evaluation_id: str, document_id: str, annotation: dict[str, Any]) -> PreparedRequest:
29
+ def prepare_update(self, project_id: str, document_id: str, annotation: dict[str, Any]) -> PreparedRequest:
30
30
  update_request = PatchProjectDocumentRequest(annotation=annotation)
31
- return PreparedRequest(method="PATCH", url=f"/v1/projects/{evaluation_id}/documents/{document_id}", data=update_request.model_dump(mode="json", exclude_unset=True))
31
+ return PreparedRequest(method="PATCH", url=f"/v1/projects/{project_id}/documents/{document_id}", data=update_request.model_dump(mode="json", exclude_unset=True))
32
32
 
33
- def prepare_delete(self, evaluation_id: str, document_id: str) -> PreparedRequest:
34
- return PreparedRequest(method="DELETE", url=f"/v1/projects/{evaluation_id}/documents/{document_id}")
33
+ def prepare_delete(self, project_id: str, document_id: str) -> PreparedRequest:
34
+ return PreparedRequest(method="DELETE", url=f"/v1/projects/{project_id}/documents/{document_id}")
35
35
 
36
- def prepare_llm_annotate(self, evaluation_id: str, document_id: str) -> PreparedRequest:
37
- return PreparedRequest(method="POST", url=f"/v1/projects/{evaluation_id}/documents/{document_id}/llm-annotate", data={"stream": False})
36
+ def prepare_llm_annotate(self, project_id: str, document_id: str) -> PreparedRequest:
37
+ return PreparedRequest(method="POST", url=f"/v1/projects/{project_id}/documents/{document_id}/llm-annotate", data={"stream": False})
38
38
 
39
39
 
40
40
  class Documents(SyncAPIResource, DocumentsMixin):
@@ -42,7 +42,7 @@ class Documents(SyncAPIResource, DocumentsMixin):
42
42
 
43
43
  def create(
44
44
  self,
45
- evaluation_id: str,
45
+ project_id: str,
46
46
  document: Union[Path, str, IOBase, MIMEData, PIL.Image.Image, HttpUrl],
47
47
  annotation: Dict[str, Any],
48
48
  annotation_metadata: Dict[str, Any] | None = None,
@@ -51,7 +51,7 @@ class Documents(SyncAPIResource, DocumentsMixin):
51
51
  Create a document for an evaluation.
52
52
 
53
53
  Args:
54
- evaluation_id: The ID of the evaluation
54
+ project_id: The ID of the evaluation
55
55
  document: The document to process. Can be:
56
56
  - A file path (Path or str)
57
57
  - A file-like object (IOBase)
@@ -69,32 +69,32 @@ class Documents(SyncAPIResource, DocumentsMixin):
69
69
  mime_document: MIMEData = prepare_mime_document(document)
70
70
 
71
71
  # Let prepare_create handle the serialization
72
- request = self.prepare_create(evaluation_id, mime_document, annotation, annotation_metadata)
72
+ request = self.prepare_create(project_id, mime_document, annotation, annotation_metadata)
73
73
  response = self._client._prepared_request(request)
74
74
  return ProjectDocument(**response)
75
75
 
76
- def list(self, evaluation_id: str) -> List[ProjectDocument]:
76
+ def list(self, project_id: str) -> List[ProjectDocument]:
77
77
  """
78
78
  List documents for an evaluation.
79
79
 
80
80
  Args:
81
- evaluation_id: The ID of the evaluation
81
+ project_id: The ID of the evaluation
82
82
 
83
83
  Returns:
84
84
  List[ProjectDocument]: List of documents
85
85
  Raises:
86
86
  HTTPException if the request fails
87
87
  """
88
- request = self.prepare_list(evaluation_id)
88
+ request = self.prepare_list(project_id)
89
89
  response = self._client._prepared_request(request)
90
90
  return [ProjectDocument(**item) for item in response.get("data", [])]
91
91
 
92
- def get(self, evaluation_id: str, document_id: str) -> ProjectDocument:
92
+ def get(self, project_id: str, document_id: str) -> ProjectDocument:
93
93
  """
94
94
  Get a document by ID.
95
95
 
96
96
  Args:
97
- evaluation_id: The ID of the evaluation
97
+ project_id: The ID of the evaluation
98
98
  document_id: The ID of the document
99
99
 
100
100
  Returns:
@@ -102,16 +102,16 @@ class Documents(SyncAPIResource, DocumentsMixin):
102
102
  Raises:
103
103
  HTTPException if the request fails
104
104
  """
105
- request = self.prepare_get(evaluation_id, document_id)
105
+ request = self.prepare_get(project_id, document_id)
106
106
  response = self._client._prepared_request(request)
107
107
  return ProjectDocument(**response)
108
108
 
109
- def update(self, evaluation_id: str, document_id: str, annotation: dict[str, Any]) -> ProjectDocument:
109
+ def update(self, project_id: str, document_id: str, annotation: dict[str, Any]) -> ProjectDocument:
110
110
  """
111
111
  Update a document.
112
112
 
113
113
  Args:
114
- evaluation_id: The ID of the evaluation
114
+ project_id: The ID of the evaluation
115
115
  document_id: The ID of the document
116
116
  annotation: The ground truth for the document
117
117
  Returns:
@@ -119,16 +119,16 @@ class Documents(SyncAPIResource, DocumentsMixin):
119
119
  Raises:
120
120
  HTTPException if the request fails
121
121
  """
122
- request = self.prepare_update(evaluation_id, document_id, annotation=annotation)
122
+ request = self.prepare_update(project_id, document_id, annotation=annotation)
123
123
  response = self._client._prepared_request(request)
124
124
  return ProjectDocument(**response)
125
125
 
126
- def delete(self, evaluation_id: str, document_id: str) -> DeleteResponse:
126
+ def delete(self, project_id: str, document_id: str) -> DeleteResponse:
127
127
  """
128
128
  Delete a document.
129
129
 
130
130
  Args:
131
- evaluation_id: The ID of the evaluation
131
+ project_id: The ID of the evaluation
132
132
  document_id: The ID of the document
133
133
 
134
134
  Returns:
@@ -136,14 +136,14 @@ class Documents(SyncAPIResource, DocumentsMixin):
136
136
  Raises:
137
137
  HTTPException if the request fails
138
138
  """
139
- request = self.prepare_delete(evaluation_id, document_id)
139
+ request = self.prepare_delete(project_id, document_id)
140
140
  return self._client._prepared_request(request)
141
141
 
142
- def llm_annotate(self, evaluation_id: str, document_id: str) -> RetabParsedChatCompletion:
142
+ def llm_annotate(self, project_id: str, document_id: str) -> RetabParsedChatCompletion:
143
143
  """
144
144
  Annotate a document with an LLM. This method updates the document (within the evaluation) with the latest extraction.
145
145
  """
146
- request = self.prepare_llm_annotate(evaluation_id, document_id)
146
+ request = self.prepare_llm_annotate(project_id, document_id)
147
147
  response = self._client._prepared_request(request)
148
148
  return RetabParsedChatCompletion(**response)
149
149
 
@@ -153,7 +153,7 @@ class AsyncDocuments(AsyncAPIResource, DocumentsMixin):
153
153
 
154
154
  async def create(
155
155
  self,
156
- evaluation_id: str,
156
+ project_id: str,
157
157
  document: Union[Path, str, IOBase, MIMEData, PIL.Image.Image, HttpUrl],
158
158
  annotation: Dict[str, Any],
159
159
  annotation_metadata: Dict[str, Any] | None = None,
@@ -162,7 +162,7 @@ class AsyncDocuments(AsyncAPIResource, DocumentsMixin):
162
162
  Create a document for an evaluation.
163
163
 
164
164
  Args:
165
- evaluation_id: The ID of the evaluation
165
+ project_id: The ID of the evaluation
166
166
  document: The document to process. Can be:
167
167
  - A file path (Path or str)
168
168
  - A file-like object (IOBase)
@@ -180,32 +180,32 @@ class AsyncDocuments(AsyncAPIResource, DocumentsMixin):
180
180
  mime_document: MIMEData = prepare_mime_document(document)
181
181
 
182
182
  # Let prepare_create handle the serialization
183
- request = self.prepare_create(evaluation_id, mime_document, annotation, annotation_metadata)
183
+ request = self.prepare_create(project_id, mime_document, annotation, annotation_metadata)
184
184
  response = await self._client._prepared_request(request)
185
185
  return ProjectDocument(**response)
186
186
 
187
- async def list(self, evaluation_id: str) -> List[ProjectDocument]:
187
+ async def list(self, project_id: str) -> List[ProjectDocument]:
188
188
  """
189
189
  List documents for an evaluation.
190
190
 
191
191
  Args:
192
- evaluation_id: The ID of the evaluation
192
+ project_id: The ID of the evaluation
193
193
 
194
194
  Returns:
195
195
  List[ProjectDocument]: List of documents
196
196
  Raises:
197
197
  HTTPException if the request fails
198
198
  """
199
- request = self.prepare_list(evaluation_id)
199
+ request = self.prepare_list(project_id)
200
200
  response = await self._client._prepared_request(request)
201
201
  return [ProjectDocument(**item) for item in response.get("data", [])]
202
202
 
203
- async def update(self, evaluation_id: str, document_id: str, annotation: dict[str, Any]) -> ProjectDocument:
203
+ async def update(self, project_id: str, document_id: str, annotation: dict[str, Any]) -> ProjectDocument:
204
204
  """
205
205
  Update a document.
206
206
 
207
207
  Args:
208
- evaluation_id: The ID of the evaluation
208
+ project_id: The ID of the evaluation
209
209
  document_id: The ID of the document
210
210
  annotation: The ground truth for the document
211
211
 
@@ -214,16 +214,16 @@ class AsyncDocuments(AsyncAPIResource, DocumentsMixin):
214
214
  Raises:
215
215
  HTTPException if the request fails
216
216
  """
217
- request = self.prepare_update(evaluation_id, document_id, annotation)
217
+ request = self.prepare_update(project_id, document_id, annotation)
218
218
  response = await self._client._prepared_request(request)
219
219
  return ProjectDocument(**response)
220
220
 
221
- async def delete(self, evaluation_id: str, document_id: str) -> DeleteResponse:
221
+ async def delete(self, project_id: str, document_id: str) -> DeleteResponse:
222
222
  """
223
223
  Delete a document.
224
224
 
225
225
  Args:
226
- evaluation_id: The ID of the evaluation
226
+ project_id: The ID of the evaluation
227
227
  document_id: The ID of the document
228
228
 
229
229
  Returns:
@@ -231,14 +231,14 @@ class AsyncDocuments(AsyncAPIResource, DocumentsMixin):
231
231
  Raises:
232
232
  HTTPException if the request fails
233
233
  """
234
- request = self.prepare_delete(evaluation_id, document_id)
234
+ request = self.prepare_delete(project_id, document_id)
235
235
  return await self._client._prepared_request(request)
236
236
 
237
- async def llm_annotate(self, evaluation_id: str, document_id: str) -> RetabParsedChatCompletion:
237
+ async def llm_annotate(self, project_id: str, document_id: str) -> RetabParsedChatCompletion:
238
238
  """
239
239
  Annotate a document with an LLM.
240
240
  This method updates the document (within the evaluation) with the latest extraction.
241
241
  """
242
- request = self.prepare_llm_annotate(evaluation_id, document_id)
242
+ request = self.prepare_llm_annotate(project_id, document_id)
243
243
  response = await self._client._prepared_request(request)
244
244
  return RetabParsedChatCompletion(**response)