docent-python 0.1.0a2__py3-none-any.whl → 0.1.0a4__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.
@@ -3,22 +3,12 @@ from docent.data_models.citation import Citation
3
3
  from docent.data_models.metadata import BaseAgentRunMetadata, BaseMetadata, FrameDimension
4
4
  from docent.data_models.regex import RegexSnippet
5
5
  from docent.data_models.transcript import Transcript
6
- from docent_core._db_service.filters import (
7
- AgentRunIdFilter,
8
- BaseFrameFilter,
9
- ComplexFilter,
10
- SearchResultPredicateFilter,
11
- )
12
6
 
13
7
  __all__ = [
14
8
  "AgentRun",
15
9
  "Citation",
16
10
  "RegexSnippet",
17
- "AgentRunIdFilter",
18
11
  "FrameDimension",
19
- "BaseFrameFilter",
20
- "SearchResultPredicateFilter",
21
- "ComplexFilter",
22
12
  "BaseAgentRunMetadata",
23
13
  "BaseMetadata",
24
14
  "Transcript",
docent/sdk/client.py CHANGED
@@ -5,7 +5,6 @@ import requests
5
5
 
6
6
  from docent._log_util.logger import get_logger
7
7
  from docent.data_models.agent_run import AgentRun
8
- from docent_core._db_service.filters import FrameFilter
9
8
 
10
9
  logger = get_logger(__name__)
11
10
 
@@ -55,6 +54,13 @@ class Docent:
55
54
  response = self._session.post(
56
55
  login_url, json={"email": self._email, "password": self._password}
57
56
  )
57
+
58
+ if response.status_code == 401:
59
+ raise ValueError(
60
+ "Invalid username/password combination. "
61
+ f"If you don't already have an account, please sign up at {self._web_url}/signup"
62
+ )
63
+
58
64
  response.raise_for_status()
59
65
  logger.info(f"Successfully logged in as {self._email}")
60
66
 
@@ -181,53 +187,6 @@ class Docent:
181
187
  logger.info(f"Successfully added {total_runs} agent runs to FrameGrid '{fg_id}'")
182
188
  return {"status": "success", "total_runs_added": total_runs}
183
189
 
184
- def get_base_filter(self, fg_id: str) -> dict[str, Any] | None:
185
- """Retrieves the base filter for a FrameGrid.
186
-
187
- The base filter defines default filtering applied to all views.
188
-
189
- Args:
190
- fg_id: ID of the FrameGrid.
191
-
192
- Returns:
193
- dict or None: Filter data if a filter exists, None otherwise.
194
-
195
- Raises:
196
- requests.exceptions.HTTPError: If the API request fails.
197
- """
198
- url = f"{self._server_url}/{fg_id}/base_filter"
199
- response = self._session.get(url)
200
- response.raise_for_status()
201
- # The endpoint returns the filter model directly or null
202
- filter_data = response.json()
203
- return filter_data
204
-
205
- def set_base_filter(self, fg_id: str, filter: FrameFilter | None) -> dict[str, Any]:
206
- """Sets the base filter for a FrameGrid.
207
-
208
- The base filter defines default filtering applied to all views.
209
-
210
- Args:
211
- fg_id: ID of the FrameGrid.
212
- filter: FrameFilter object defining the filter, or None to clear the filter.
213
-
214
- Returns:
215
- dict: API response data.
216
-
217
- Raises:
218
- requests.exceptions.HTTPError: If the API request fails.
219
- """
220
- url = f"{self._server_url}/{fg_id}/base_filter"
221
- payload = {
222
- "filter": filter.model_dump() if filter else None,
223
- }
224
-
225
- response = self._session.post(url, json=payload)
226
- response.raise_for_status()
227
-
228
- logger.info(f"Successfully set base filter for FrameGrid '{fg_id}'")
229
- return response.json()
230
-
231
190
  def list_framegrids(self) -> list[dict[str, Any]]:
232
191
  """Lists all available FrameGrids.
233
192
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docent-python
3
- Version: 0.1.0a2
3
+ Version: 0.1.0a4
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
@@ -2,7 +2,7 @@ docent/__init__.py,sha256=J2BbO6rzilfw9WXRUeolr439EGFezqbMU_kCpCCryRA,59
2
2
  docent/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  docent/_log_util/__init__.py,sha256=3HXXrxrSm8PxwG4llotrCnSnp7GuroK1FNHsdg6f7aE,73
4
4
  docent/_log_util/logger.py,sha256=kwM0yRW1IJd6-XTorjWn48B4l8qvD2ZM6VDjY5eskQI,4422
5
- docent/data_models/__init__.py,sha256=l4m80Igs1b_xlqTG6cB9A1jAbob1k5KfpoBY9GOovo8,694
5
+ docent/data_models/__init__.py,sha256=SbXBXpI2HLI2qeGoKD-6Qp0gY3igQAw6qOsolc_rj7Q,448
6
6
  docent/data_models/_tiktoken_util.py,sha256=hC0EDDWItv5-0cONBnHWgZtQOflDU7ZNEhXPFo4DvPc,3057
7
7
  docent/data_models/agent_run.py,sha256=sdvoUUpOhQAHqJHNR5KoHthCXrpJajdIREMacoR1ODk,9516
8
8
  docent/data_models/citation.py,sha256=WsVQZcBT2EJD24ysyeVOC5Xfo165RI7P5_cOnJBgHj0,10015
@@ -15,8 +15,8 @@ docent/data_models/chat/content.py,sha256=Co-jO8frQa_DSP11wJuhPX0s-GpJk8yqtKqPei
15
15
  docent/data_models/chat/message.py,sha256=iAo38kbV6wYbFh8S23cxLy6HY4C_i3PzQ6RpSQG5dxM,3861
16
16
  docent/data_models/chat/tool.py,sha256=x7NKINswPe0Kqvcx4ubjHzB-n0-i4DbFodvaBb2vitk,3042
17
17
  docent/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- docent/sdk/client.py,sha256=QrdhkoGhyl-Ts_Egihxo66j6RhVY6Cwnzm2CHmzhb-o,10210
19
- docent_python-0.1.0a2.dist-info/METADATA,sha256=oMzhci6coYnfLlpXwdE0gTsTMvtwNCSgfvtrnEvzZBI,493
20
- docent_python-0.1.0a2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
21
- docent_python-0.1.0a2.dist-info/licenses/LICENSE.md,sha256=vOHzq3K4Ndu0UV9hPrtXvlD7pHOjyDQmGjHuLSIkRQY,1087
22
- docent_python-0.1.0a2.dist-info/RECORD,,
18
+ docent/sdk/client.py,sha256=L97C9uo1Qv2UkwIW9_yXnYD5wiC7kUyg6HnobGO9q_U,8830
19
+ docent_python-0.1.0a4.dist-info/METADATA,sha256=wY8AG--TNjNQ-KjtDqqTw6YvzdscMjposd_flYpFdRU,493
20
+ docent_python-0.1.0a4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
21
+ docent_python-0.1.0a4.dist-info/licenses/LICENSE.md,sha256=vOHzq3K4Ndu0UV9hPrtXvlD7pHOjyDQmGjHuLSIkRQY,1087
22
+ docent_python-0.1.0a4.dist-info/RECORD,,