aixtools 0.3.0__py3-none-any.whl → 0.3.2__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 aixtools might be problematic. Click here for more details.

aixtools/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.3.0'
32
- __version_tuple__ = version_tuple = (0, 3, 0)
31
+ __version__ = version = '0.3.2'
32
+ __version_tuple__ = version_tuple = (0, 3, 2)
33
33
 
34
34
  __commit_id__ = commit_id = None
aixtools/agents/agent.py CHANGED
@@ -129,6 +129,7 @@ def get_agent( # noqa: PLR0913, pylint: disable=too-many-arguments,too-many-pos
129
129
  output_type: Any = str,
130
130
  deps_type=NoneType,
131
131
  http_client=None,
132
+ retries: int = 1,
132
133
  ) -> Agent:
133
134
  """Get a PydanticAI agent"""
134
135
  if model_settings is None:
@@ -147,6 +148,7 @@ def get_agent( # noqa: PLR0913, pylint: disable=too-many-arguments,too-many-pos
147
148
  tools=tools,
148
149
  toolsets=toolsets,
149
150
  instrument=True,
151
+ retries=retries,
150
152
  )
151
153
  return agent
152
154
 
aixtools/auth/auth.py CHANGED
@@ -30,6 +30,7 @@ class AuthTokenErrorCode(str, enum.Enum):
30
30
  JWT_ERROR = "Generic JWT error"
31
31
  MISSING_GROUPS_ERROR = "Missing authorized groups"
32
32
  INVALID_TOKEN_SCOPE = "Token scope does not match configured scope"
33
+ TOKEN_MISSING = "Token missing"
33
34
 
34
35
 
35
36
  class AuthTokenError(Exception):
@@ -185,3 +186,18 @@ class AccessTokenAuthProvider(AuthProvider):
185
186
  return AccessToken(
186
187
  token=token, client_id=self.token_verifier.api_id, scopes=scopes_arr, expires_at=claims.get("exp", None)
187
188
  )
189
+
190
+ async def verify_auth_header(self, auth_header: str | None) -> AccessToken:
191
+ """
192
+ Splits the authorization header and looks for bearer type token,
193
+ then verifies the extracted bearer token and returns an AccessToken object.
194
+ """
195
+
196
+ if auth_header and auth_header.lower().startswith("bearer "):
197
+ auth_token = auth_header.split(" ", 1)[1].strip()
198
+ return await self.verify_token(auth_token)
199
+
200
+ raise AuthTokenError(
201
+ AuthTokenErrorCode.TOKEN_MISSING,
202
+ f"Could not find bearer token in authorization header: {auth_header}",
203
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aixtools
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Tools for AI exploration and debugging
5
5
  Requires-Python: >=3.11.2
6
6
  Description-Content-Type: text/markdown
@@ -1,5 +1,5 @@
1
1
  aixtools/__init__.py,sha256=9NGHm7LjsQmsvjTZvw6QFJexSvAU4bCoN_KBk9SCa00,260
2
- aixtools/_version.py,sha256=5zTqm8rgXsWYBpB2M3Zw_K1D-aV8wP7NsBLrmMKkrAQ,704
2
+ aixtools/_version.py,sha256=e8NqPtZ8fggRgk3GPrqZ_U_BDV8aSULw1u_Gn9NNbnk,704
3
3
  aixtools/app.py,sha256=JzQ0nrv_bjDQokllIlGHOV0HEb-V8N6k_nGQH-TEsVU,5227
4
4
  aixtools/chainlit.md,sha256=yC37Ly57vjKyiIvK4oUvf4DYxZCwH7iocTlx7bLeGLU,761
5
5
  aixtools/context.py,sha256=I_MD40ZnvRm5WPKAKqBUAdXIf8YaurkYUUHSVVy-QvU,598
@@ -25,7 +25,7 @@ aixtools/a2a/google_sdk/utils.py,sha256=k5VtTr4XLxsSKQDqly9QtWcZ5xfm03VbPpQ8OwoX
25
25
  aixtools/a2a/google_sdk/pydantic_ai_adapter/agent_executor.py,sha256=xamLIKl-FeB8PElVKgiIKR-MhFKmPjywHmC_ow-fGAA,9904
26
26
  aixtools/a2a/google_sdk/pydantic_ai_adapter/storage.py,sha256=nGoVL7MPoZJW7iVR71laqpUYP308yFKZIifJtvUgpiU,878
27
27
  aixtools/agents/__init__.py,sha256=MAW196S2_G7uGqv-VNjvlOETRfuV44WlU1leO7SiR0A,282
28
- aixtools/agents/agent.py,sha256=7ZxKVOqLI_9K5LsTnqoTwRRHp6i-nFgQrJ6yA4M9iUE,7700
28
+ aixtools/agents/agent.py,sha256=X5A9sreXbcVK8ww0W_aJa8oxh6xI-ZDhhobK1K3Yj70,7747
29
29
  aixtools/agents/agent_batch.py,sha256=0Zu9yNCRPAQZPjXQ-dIUAmP1uGTVbxVt7xvnMpoJMjU,2251
30
30
  aixtools/agents/nodes_to_md.py,sha256=hAT8dgiZTG4uGoSgeRZkIJ7zgkQUNpdIr8KSFhjWAH0,7515
31
31
  aixtools/agents/nodes_to_message.py,sha256=ZqcmxUNf4esiCTRk37wWP1LquhqNsCmydvMr4kjZEjw,1012
@@ -33,7 +33,7 @@ aixtools/agents/nodes_to_str.py,sha256=UkOu5Nry827J4H_ohQU3tPBfJxtr3p6FfCfWoUy5u
33
33
  aixtools/agents/print_nodes.py,sha256=wVTngNfqM0As845WTRz6G3Rei_Gr3HuBlvu-G_eXuig,1665
34
34
  aixtools/agents/prompt.py,sha256=oZl6_3SelyoSysLpF6AAmLHLHhwyPYCtX8hJ2pRUnhw,7396
35
35
  aixtools/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- aixtools/auth/auth.py,sha256=gooviMSsfvAn9BulJLD5My2B45qsAR4ZT6JgIS3uSLQ,7467
36
+ aixtools/auth/auth.py,sha256=rCvkcZCDNo-f3lsuMkLlcfpTO5GlRsHY9qhCnB7ayhU,8123
37
37
  aixtools/compliance/__init__.py,sha256=vnw0zEdySIJWvDAJ8DCRRaWmY_agEOz1qlpAdhmtiuo,191
38
38
  aixtools/compliance/private_data.py,sha256=OOM9mIp3_w0fNgj3VAEWBl7-jrPc19_Ls1pC5dfF5UY,5323
39
39
  aixtools/db/__init__.py,sha256=b8vRhme3egV-aUZbAntnOaDkSXB8UT0Xy5oqQhU_z0Q,399
@@ -95,8 +95,8 @@ aixtools/utils/chainlit/cl_agent_show.py,sha256=vaRuowp4BRvhxEr5hw0zHEJ7iaSF_5bo
95
95
  aixtools/utils/chainlit/cl_utils.py,sha256=fxaxdkcZg6uHdM8uztxdPowg3a2f7VR7B26VPY4t-3c,5738
96
96
  aixtools/vault/__init__.py,sha256=fsr_NuX3GZ9WZ7dGfe0gp_5-z3URxAfwVRXw7Xyc0dU,141
97
97
  aixtools/vault/vault.py,sha256=9dZLWdZQk9qN_Q9Djkofw9LUKnJqnrX5H0fGusVLBhA,6037
98
- aixtools-0.3.0.dist-info/METADATA,sha256=2Jp_goSiv2jkTgzlhkgnZ4fBtS6iwF848wNeYgE7c0w,28014
99
- aixtools-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
- aixtools-0.3.0.dist-info/entry_points.txt,sha256=q8412TG4T0S8K0SKeWp2vkVPIDYQs0jNoHqcQ7qxOiA,155
101
- aixtools-0.3.0.dist-info/top_level.txt,sha256=wBn-rw9bCtxrR4AYEYgjilNCUVmKY0LWby9Zan2PRJM,9
102
- aixtools-0.3.0.dist-info/RECORD,,
98
+ aixtools-0.3.2.dist-info/METADATA,sha256=FnBXFfGny-BUh1L6fkR_JUZy7OjZPbjRhhoDIgfg5jM,28014
99
+ aixtools-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
+ aixtools-0.3.2.dist-info/entry_points.txt,sha256=q8412TG4T0S8K0SKeWp2vkVPIDYQs0jNoHqcQ7qxOiA,155
101
+ aixtools-0.3.2.dist-info/top_level.txt,sha256=wBn-rw9bCtxrR4AYEYgjilNCUVmKY0LWby9Zan2PRJM,9
102
+ aixtools-0.3.2.dist-info/RECORD,,