aip-agents-binary 0.5.21__py3-none-macosx_13_0_arm64.whl → 0.5.23__py3-none-macosx_13_0_arm64.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.
@@ -1,7 +1,8 @@
1
- """GL Connector tool wrapper for BOSA connector tools.
1
+ """Wrapper for GL Connectors.
2
2
 
3
3
  Authors:
4
4
  Saul Sayers (saul.sayers@gdplabs.id)
5
+ Christian Trisno Sen Long Chen (christian.t.s.l.chen@gdplabs.id)
5
6
 
6
7
  Reference:
7
8
  https://gl-docs.gitbook.io/bosa/gl-connector/gl-connector
@@ -21,11 +22,23 @@ from pydantic import ConfigDict, PrivateAttr
21
22
  from aip_agents.tools.constants import ToolType
22
23
 
23
24
  _REQUIRED_ENV_VARS: tuple[str, ...] = (
24
- "BOSA_BASE_URL",
25
- "BOSA_API_KEY",
26
- "BOSA_USERNAME",
27
- "BOSA_PASSWORD",
25
+ "GL_CONNECTORS_BASE_URL",
26
+ "GL_CONNECTORS_API_KEY",
27
+ "GL_CONNECTORS_USERNAME",
28
+ "GL_CONNECTORS_PASSWORD",
28
29
  )
30
+
31
+ _ENV_VAR_MAPPING: dict[str, tuple[str, ...]] = {
32
+ "GL_CONNECTORS_BASE_URL": (
33
+ "GL_CONNECTORS_BASE_URL",
34
+ "BOSA_BASE_URL",
35
+ "BOSA_API_BASE_URL",
36
+ ),
37
+ "GL_CONNECTORS_API_KEY": ("GL_CONNECTORS_API_KEY", "BOSA_API_KEY"),
38
+ "GL_CONNECTORS_USERNAME": ("GL_CONNECTORS_USERNAME", "BOSA_USERNAME"),
39
+ "GL_CONNECTORS_PASSWORD": ("GL_CONNECTORS_PASSWORD", "BOSA_PASSWORD"),
40
+ "GL_CONNECTORS_IDENTIFIER": ("GL_CONNECTORS_IDENTIFIER", "BOSA_IDENTIFIER"),
41
+ }
29
42
  _TOP_LEVEL_KEYS: tuple[str, ...] = (
30
43
  "token",
31
44
  "identifier",
@@ -145,12 +158,12 @@ def GLConnectorTool(
145
158
  api_key: str | None = None,
146
159
  identifier: str | None = None,
147
160
  ) -> BaseTool:
148
- """Create a single GL Connector tool by exact tool name.
161
+ """Create a single tool from GL Connectors by exact tool name.
149
162
 
150
163
  Args:
151
164
  tool_name: Exact tool name (not module name).
152
- api_key: Optional override for BOSA API key.
153
- identifier: Optional override for BOSA identifier.
165
+ api_key: Optional override for GL Connectors API key.
166
+ identifier: Optional override for GL Connectors identifier.
154
167
 
155
168
  Returns:
156
169
  A single LangChain BaseTool with token injection.
@@ -159,14 +172,17 @@ def GLConnectorTool(
159
172
  raise ValueError("tool_name must be a non-empty string")
160
173
 
161
174
  env_values = _load_env(api_key=api_key, identifier=identifier)
162
- connector = BosaConnector(api_base_url=env_values["BOSA_BASE_URL"], api_key=env_values["BOSA_API_KEY"])
175
+ connector = BosaConnector(
176
+ api_base_url=env_values["GL_CONNECTORS_BASE_URL"],
177
+ api_key=env_values["GL_CONNECTORS_API_KEY"],
178
+ )
163
179
 
164
180
  modules = _get_available_modules(connector)
165
181
  module_name = _resolve_module(tool_name, modules)
166
182
 
167
183
  generator = BOSAConnectorToolGenerator(
168
- api_base_url=env_values["BOSA_BASE_URL"],
169
- api_key=env_values["BOSA_API_KEY"],
184
+ api_base_url=env_values["GL_CONNECTORS_BASE_URL"],
185
+ api_key=env_values["GL_CONNECTORS_API_KEY"],
170
186
  app_name=module_name,
171
187
  )
172
188
  tools = generator.generate_tools(tool_type=ToolType.LANGCHAIN)
@@ -177,16 +193,20 @@ def GLConnectorTool(
177
193
  if len(matching) > 1:
178
194
  raise ValueError(f"Multiple tools named '{tool_name}' found in module '{module_name}'")
179
195
 
180
- token = _create_token(connector, env_values["BOSA_USERNAME"], env_values["BOSA_PASSWORD"])
181
- return _InjectedTool(matching[0], token, env_values.get("BOSA_IDENTIFIER"))
196
+ token = _create_token(
197
+ connector,
198
+ env_values["GL_CONNECTORS_USERNAME"],
199
+ env_values["GL_CONNECTORS_PASSWORD"],
200
+ )
201
+ return _InjectedTool(matching[0], token, env_values.get("GL_CONNECTORS_IDENTIFIER"))
182
202
 
183
203
 
184
204
  def _load_env(*, api_key: str | None, identifier: str | None) -> dict[str, str]:
185
205
  """Load and validate environment configuration for connector access.
186
206
 
187
207
  Args:
188
- api_key: Optional override for BOSA API key.
189
- identifier: Optional override for BOSA identifier.
208
+ api_key: Optional override for GL Connectors API key.
209
+ identifier: Optional override for GL Connectors identifier.
190
210
 
191
211
  Returns:
192
212
  Dictionary containing environment configuration values.
@@ -194,28 +214,40 @@ def _load_env(*, api_key: str | None, identifier: str | None) -> dict[str, str]:
194
214
  Raises:
195
215
  ValueError: If required environment variables are missing.
196
216
  """
197
- env = {key: os.getenv(key) for key in _REQUIRED_ENV_VARS}
217
+ env: dict[str, str | None] = {}
198
218
 
199
- resolved_api_key = api_key or env["BOSA_API_KEY"]
200
- env["BOSA_API_KEY"] = resolved_api_key
219
+ # Load from environment using mapping (prefers GL_CONNECTORS_* over BOSA_*)
220
+ for internal_key, env_vars in _ENV_VAR_MAPPING.items():
221
+ val = None
222
+ for var_name in env_vars:
223
+ val = os.getenv(var_name)
224
+ if val:
225
+ break
226
+ env[internal_key] = val
201
227
 
202
- optional_identifier = identifier or os.getenv("BOSA_IDENTIFIER")
228
+ if api_key:
229
+ env["GL_CONNECTORS_API_KEY"] = api_key
203
230
 
204
- if optional_identifier:
205
- env["BOSA_IDENTIFIER"] = optional_identifier
231
+ if identifier:
232
+ env["GL_CONNECTORS_IDENTIFIER"] = identifier
206
233
 
207
- missing = [key for key, value in env.items() if key in _REQUIRED_ENV_VARS and not value]
234
+ missing = [key for key in _REQUIRED_ENV_VARS if not env.get(key)]
208
235
  if missing:
209
- raise ValueError(f"Missing required environment variables: {', '.join(missing)}")
236
+ # Map back to human-friendly names for the error message
237
+ friendly_missing = []
238
+ for m in missing:
239
+ preferred = _ENV_VAR_MAPPING[m][0]
240
+ friendly_missing.append(preferred)
241
+ raise ValueError(f"Missing required environment variables: {', '.join(friendly_missing)}")
210
242
 
211
- return {key: value for key, value in env.items() if value is not None}
243
+ return {k: v for k, v in env.items() if v is not None}
212
244
 
213
245
 
214
246
  def _get_available_modules(connector: BosaConnector) -> list[str]:
215
247
  """Return available connector modules or raise an actionable error.
216
248
 
217
249
  Args:
218
- connector: BOSA connector instance to query for modules.
250
+ connector: GL Connectors instance to query for modules.
219
251
 
220
252
  Returns:
221
253
  List of available module names.
@@ -260,9 +292,9 @@ def _create_token(connector: BosaConnector, username: str, password: str) -> str
260
292
  """Authenticate the connector user and return a user token.
261
293
 
262
294
  Args:
263
- connector: BOSA connector instance for authentication.
264
- username: BOSA username for authentication.
265
- password: BOSA password for authentication.
295
+ connector: GL Connectors instance for authentication.
296
+ username: GL Connectors username for authentication.
297
+ password: GL Connectors password for authentication.
266
298
 
267
299
  Returns:
268
300
  Authentication token string.
@@ -273,11 +305,11 @@ def _create_token(connector: BosaConnector, username: str, password: str) -> str
273
305
  try:
274
306
  user = connector.authenticate_bosa_user(username, password)
275
307
  except Exception as exc:
276
- raise ValueError("Failed to authenticate BOSA user") from exc
308
+ raise ValueError("Failed to authenticate GL Connectors user") from exc
277
309
 
278
310
  token = getattr(user, "token", None)
279
311
  if not token:
280
- raise ValueError("BOSA user token missing after authentication")
312
+ raise ValueError("GL Connectors user token missing after authentication")
281
313
  return token
282
314
 
283
315
 
@@ -62,12 +62,12 @@ class _InjectedTool(BaseTool):
62
62
  """
63
63
 
64
64
  def GLConnectorTool(tool_name: str, *, api_key: str | None = None, identifier: str | None = None) -> BaseTool:
65
- """Create a single GL Connector tool by exact tool name.
65
+ """Create a single tool from GL Connectors by exact tool name.
66
66
 
67
67
  Args:
68
68
  tool_name: Exact tool name (not module name).
69
- api_key: Optional override for BOSA API key.
70
- identifier: Optional override for BOSA identifier.
69
+ api_key: Optional override for GL Connectors API key.
70
+ identifier: Optional override for GL Connectors identifier.
71
71
 
72
72
  Returns:
73
73
  A single LangChain BaseTool with token injection.
@@ -0,0 +1,119 @@
1
+ """Auto-generated tools from GL Connectors.
2
+
3
+ Authors:
4
+ Saul Sayers (saul.sayers@gdplabs.id)
5
+ """
6
+
7
+ from bosa_connectors import BosaConnector, BOSAConnectorToolGenerator
8
+ from langchain_core.tools import BaseTool
9
+
10
+ from aip_agents.tools.constants import (
11
+ GL_CONNECTORS_API_KEY,
12
+ GL_CONNECTORS_BASE_URL,
13
+ GL_CONNECTORS_FETCH_MAX_RETRIES,
14
+ ToolType,
15
+ )
16
+ from aip_agents.utils.logger import get_logger
17
+
18
+ logger = get_logger(__name__)
19
+
20
+
21
+ def get_gl_connector_modules_with_retry() -> list[str]:
22
+ """Try to get available modules with retries.
23
+
24
+ Returns:
25
+ List of available modules.
26
+ """
27
+ if not GL_CONNECTORS_BASE_URL or not GL_CONNECTORS_API_KEY:
28
+ logger.warning("GL Connectors credentials missing (base_url or api_key); returning empty modules list")
29
+ return []
30
+
31
+ connector = BosaConnector(api_base_url=GL_CONNECTORS_BASE_URL, api_key=GL_CONNECTORS_API_KEY)
32
+ modules = []
33
+ for attempt in range(GL_CONNECTORS_FETCH_MAX_RETRIES):
34
+ try:
35
+ modules = list(connector.get_available_modules())
36
+ if modules:
37
+ return modules
38
+ logger.warning(
39
+ f"Failed to get GL Connectors available modules, retrying... (attempt {attempt + 1} / {GL_CONNECTORS_FETCH_MAX_RETRIES})"
40
+ )
41
+ except Exception as e:
42
+ logger.exception(
43
+ f"Exception when getting GL Connectors available modules (attempt {attempt + 1} / {GL_CONNECTORS_FETCH_MAX_RETRIES}): {e}"
44
+ )
45
+ logger.error("Failed to get GL Connectors available modules after maximum retries")
46
+ return modules
47
+
48
+
49
+ class LazyGLConnectorToolsDict(dict):
50
+ """Lazy dictionary for GL Connectors."""
51
+
52
+ def __missing__(self, app):
53
+ """When a key is missing, create the tools and store them in the dictionary.
54
+
55
+ Args:
56
+ app: Name of the GL Connectors.
57
+
58
+ Returns:
59
+ List of tools generated by the GL Connectors tool generator.
60
+ """
61
+ if app not in get_gl_connector_modules():
62
+ return []
63
+ tools = []
64
+ for attempt in range(GL_CONNECTORS_FETCH_MAX_RETRIES):
65
+ try:
66
+ tools = BOSAConnectorToolGenerator(
67
+ api_base_url=GL_CONNECTORS_BASE_URL,
68
+ api_key=GL_CONNECTORS_API_KEY,
69
+ app_name=app,
70
+ ).generate_tools(tool_type=ToolType.LANGCHAIN)
71
+ if tools:
72
+ self[app] = tools
73
+ return tools
74
+ logger.warning(
75
+ f"Failed to create GL Connectors, retrying... (attempt {attempt + 1} / {GL_CONNECTORS_FETCH_MAX_RETRIES})"
76
+ )
77
+ except Exception as e:
78
+ logger.exception(
79
+ f"Exception when creating GL Connectors for app '{app}' "
80
+ f"(attempt {attempt + 1} / {GL_CONNECTORS_FETCH_MAX_RETRIES}): {e}"
81
+ )
82
+ logger.error("Failed to create GL Connectors after maximum retries")
83
+ return tools
84
+
85
+
86
+ # Supported modules (dynamic)
87
+ def get_gl_connector_modules() -> list[str]:
88
+ """Lazily fetch and cache GL Connectors modules.
89
+
90
+ Returns:
91
+ List of GL Connectors modules.
92
+ """
93
+ if not hasattr(get_gl_connector_modules, "_cache"):
94
+ get_gl_connector_modules._cache = get_gl_connector_modules_with_retry()
95
+ return get_gl_connector_modules._cache
96
+
97
+
98
+ # FOR BACKWARDS COMPATIBILITY
99
+ def get_bosa_modules() -> list[str]:
100
+ """Backward-compatible alias for get_gl_connector_modules."""
101
+ return get_gl_connector_modules()
102
+
103
+
104
+ GL_CONNECTORS_MODULES = [
105
+ "github",
106
+ "twitter",
107
+ "google",
108
+ "google_drive",
109
+ "google_mail",
110
+ "google_docs",
111
+ ]
112
+
113
+ # FOR BACKWARDS COMPATIBILITY
114
+ BOSA_MODULES = GL_CONNECTORS_MODULES
115
+
116
+ GL_CONNECTORS_AUTOMATED_TOOLS: dict[str, list[BaseTool]] = LazyGLConnectorToolsDict()
117
+
118
+ # FOR BACKWARDS COMPATIBILITY
119
+ BOSA_AUTOMATED_TOOLS = GL_CONNECTORS_AUTOMATED_TOOLS
@@ -0,0 +1,39 @@
1
+ from _typeshed import Incomplete
2
+ from aip_agents.tools.constants import GL_CONNECTORS_API_KEY as GL_CONNECTORS_API_KEY, GL_CONNECTORS_BASE_URL as GL_CONNECTORS_BASE_URL, GL_CONNECTORS_FETCH_MAX_RETRIES as GL_CONNECTORS_FETCH_MAX_RETRIES, ToolType as ToolType
3
+ from aip_agents.utils.logger import get_logger as get_logger
4
+ from langchain_core.tools import BaseTool as BaseTool
5
+
6
+ logger: Incomplete
7
+
8
+ def get_gl_connector_modules_with_retry() -> list[str]:
9
+ """Try to get available modules with retries.
10
+
11
+ Returns:
12
+ List of available modules.
13
+ """
14
+
15
+ class LazyGLConnectorToolsDict(dict):
16
+ """Lazy dictionary for GL Connectors."""
17
+ def __missing__(self, app):
18
+ """When a key is missing, create the tools and store them in the dictionary.
19
+
20
+ Args:
21
+ app: Name of the GL Connectors.
22
+
23
+ Returns:
24
+ List of tools generated by the GL Connectors tool generator.
25
+ """
26
+
27
+ def get_gl_connector_modules() -> list[str]:
28
+ """Lazily fetch and cache GL Connectors modules.
29
+
30
+ Returns:
31
+ List of GL Connectors modules.
32
+ """
33
+ def get_bosa_modules() -> list[str]:
34
+ """Backward-compatible alias for get_gl_connector_modules."""
35
+
36
+ GL_CONNECTORS_MODULES: Incomplete
37
+ BOSA_MODULES = GL_CONNECTORS_MODULES
38
+ GL_CONNECTORS_AUTOMATED_TOOLS: dict[str, list[BaseTool]]
39
+ BOSA_AUTOMATED_TOOLS = GL_CONNECTORS_AUTOMATED_TOOLS
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aip-agents-binary
3
- Version: 0.5.21
3
+ Version: 0.5.23
4
4
  Summary: A library for managing agents in Gen AI applications.
5
5
  Author-email: Raymond Christopher <raymond.christopher@gdplabs.id>
6
6
  Requires-Python: <3.13,>=3.11
@@ -15,7 +15,7 @@ Requires-Dist: deprecated<2.0.0,>=1.2.18
15
15
  Requires-Dist: fastapi<0.121.0,>=0.120.0
16
16
  Requires-Dist: gllm-core-binary<0.4.0,>=0.3.18
17
17
  Requires-Dist: gllm-inference-binary[anthropic,bedrock,google-genai,google-vertexai,openai]<0.6.0,>=0.5.90
18
- Requires-Dist: gllm-tools-binary<0.2.0,>=0.1.3
18
+ Requires-Dist: gllm-tools-binary<0.2.0,>=0.1.5
19
19
  Requires-Dist: google-adk<0.6.0,>=0.5.0
20
20
  Requires-Dist: langchain<0.4.0,>=0.3.0
21
21
  Requires-Dist: langchain-openai<0.4.0,>=0.3.17
@@ -34,7 +34,7 @@ Requires-Dist: gllm-privacy-binary<0.5.0,>=0.4.12; extra == "privacy"
34
34
  Provides-Extra: gl-connector
35
35
  Requires-Dist: bosa-connectors-binary<0.4.0,>=0.3.1; extra == "gl-connector"
36
36
  Provides-Extra: local
37
- Requires-Dist: e2b<2.0.0,>=1.5.4; extra == "local"
37
+ Requires-Dist: e2b<3.0.0,>=2.3.0; extra == "local"
38
38
  Requires-Dist: browser-use==0.5.9; extra == "local"
39
39
  Requires-Dist: steel-sdk>=0.7.0; extra == "local"
40
40
  Requires-Dist: json-repair>=0.52.3; extra == "local"
@@ -159,9 +159,9 @@ Navigate to the library's root directory (e.g., `python/aip-agents` if you clone
159
159
  python aip_agents/examples/hello_world_langgraph.py
160
160
  ```
161
161
 
162
- **LangGraph with BOSA Connector (OpenAI):**
162
+ **LangGraph with GL Connectors (OpenAI):**
163
163
  ```bash
164
- python aip_agents/examples/hello_world_langgraph_bosa_twitter.py
164
+ python aip_agents/examples/hello_world_langgraph_gl_connector_twitter.py
165
165
  ```
166
166
 
167
167
  **LangGraph Streaming (OpenAI):**
@@ -179,8 +179,8 @@ aip_agents/examples/hello_world_langflow_agent.py,sha256=NFgI_jJ0mDpeRpVhw5TESRS
179
179
  aip_agents/examples/hello_world_langflow_agent.pyi,sha256=sl3sF36CcY_s_zQ61gvneRyTiHmPV8p9xzPL2IeB1zo,1251
180
180
  aip_agents/examples/hello_world_langgraph.py,sha256=CSlZzVOtwbnCxw3uci_qGFzO7eYZe0uzs-4kmGNih7A,1248
181
181
  aip_agents/examples/hello_world_langgraph.pyi,sha256=ix3j1wqj79wkMMuOjEQUhZA4Isr5JSFEJw49WJ2NmM4,251
182
- aip_agents/examples/hello_world_langgraph_bosa_twitter.py,sha256=NmRmEU6bccPa7UNRw1RCxYrcgw6RaLU2HYgmfy6V4IY,1224
183
- aip_agents/examples/hello_world_langgraph_bosa_twitter.pyi,sha256=QSx4K8FDnQzedl3Cl5ZlngL1-HEjE7MiLSemQ2N0dsU,238
182
+ aip_agents/examples/hello_world_langgraph_gl_connector_twitter.py,sha256=cOvEKKr1cvyl1R3CX5c6JFUpwnOWYmAWtbJuqvwUsWA,1328
183
+ aip_agents/examples/hello_world_langgraph_gl_connector_twitter.pyi,sha256=zvvkXFJw8NV4W7B8XB4b4F3s-HKixsasSMfJAuteqoQ,264
184
184
  aip_agents/examples/hello_world_langgraph_mcp_http.py,sha256=BmfwomTLNbGH3jpMMxGmSV_waYuvfbtdYdeKqVVzEPw,1008
185
185
  aip_agents/examples/hello_world_langgraph_mcp_http.pyi,sha256=8Ye3T6ip-_qykUEsYz5oPrJ99Td89OvFYwTdiP6-hAk,264
186
186
  aip_agents/examples/hello_world_langgraph_mcp_http_stream.py,sha256=h2nkg-oeZvzFWF2k2LHvAOiUqfnpnGAk1sfK1JiVQlg,1129
@@ -209,7 +209,7 @@ aip_agents/examples/hello_world_multi_agent_langgraph_lm_invoker.py,sha256=sppLD
209
209
  aip_agents/examples/hello_world_multi_agent_langgraph_lm_invoker.pyi,sha256=zFNns9i-sPY8aBy4HaVS6tXDWTsU7f-ApLD8gDtb1uk,252
210
210
  aip_agents/examples/hello_world_pii_logger.py,sha256=pm9LK-doZwQL-VdJYFHziuvwH562c8wwAwmKZeAWQS0,584
211
211
  aip_agents/examples/hello_world_pii_logger.pyi,sha256=5gOVrvhQV2DxIwr7ocL1-oTUXsO8XSyl5WN70c7rl_w,134
212
- aip_agents/examples/hello_world_sentry.py,sha256=V-q6r9Nw76XosFGxIAxVtbpp_WmncgqU0PoBwMNBXXY,3958
212
+ aip_agents/examples/hello_world_sentry.py,sha256=Gccr6WCevSnMFZYT5M6uJ_22EvLmAMUE8Et_H510_kM,3976
213
213
  aip_agents/examples/hello_world_sentry.pyi,sha256=k0wFj46QqXEjBU0CEERmiEf2bovVFkupzuzQzeD6h00,671
214
214
  aip_agents/examples/hello_world_step_limits.py,sha256=hRV9XERlq2qW_yZ4kHAe1hTgukrSZjThIrsY9NuTdJg,9809
215
215
  aip_agents/examples/hello_world_step_limits.pyi,sha256=V9KP6r5OEVq2lNUfnqMeCGH1nsNewDsRL1Uo9up8xis,1060
@@ -292,7 +292,7 @@ aip_agents/mcp/client/persistent_session.py,sha256=I8JjHe_ZqU1PPB2OF6hUX4kcrraVW
292
292
  aip_agents/mcp/client/persistent_session.pyi,sha256=in3TgtC-eHD6j2payC9_TryuOLOmqoeDKfl7UaZ_kBA,3908
293
293
  aip_agents/mcp/client/session_pool.py,sha256=_J8WduSo3HAfhE5n4u67IQQ71m_L2aPUY1NOgX5e7yA,12617
294
294
  aip_agents/mcp/client/session_pool.pyi,sha256=RtzN-5QDLS5MFAlnR5TiarY1xW4xo780n7lQL0sQbRU,3579
295
- aip_agents/mcp/client/transports.py,sha256=1HqmFqpmktFhR-vKU85xuvWcwogkIjQIh9se0qo4LEM,8172
295
+ aip_agents/mcp/client/transports.py,sha256=i7cJ1_vUUrE4yVTq-nFf0AnfKv0j9k1d8EcVZBykTUI,8624
296
296
  aip_agents/mcp/client/transports.pyi,sha256=_V6ZaQyKtTMhHzNQH943asy0O6z2bHTOX8hc-lZlV2s,4576
297
297
  aip_agents/mcp/client/google_adk/__init__.py,sha256=ZJZE7IusoWFzEwaWsHOk-8VMdR-LUmWacepw_HHuOlI,280
298
298
  aip_agents/mcp/client/google_adk/__init__.pyi,sha256=TAbiDbysxbCtHQSASGdko6JIaZEnPbCmUqt4Jf966cs,127
@@ -348,10 +348,10 @@ aip_agents/schema/step_limit.py,sha256=8hqHSxHBWro8qvNR0pMxROpFSzlLqcyFO4veS_WDP
348
348
  aip_agents/schema/step_limit.pyi,sha256=UvLDMTy8BI7h1Jx5gpbpw1jrJ9L5vK8cmQkvQdlD3bs,2318
349
349
  aip_agents/schema/storage.py,sha256=Tl0RFT32GWdsc5y8bTvpWMOU8hmQxXIlrMub3qdwx8Y,1290
350
350
  aip_agents/schema/storage.pyi,sha256=exaZAS49PYSuhYSPYukIRCRHIGRyCpBGucrdpnhV4zE,557
351
- aip_agents/sentry/__init__.py,sha256=S1XFjmAnNsqnI_Jk_ozNqDodkqWgzZ8xZPTXS2zqXzI,252
351
+ aip_agents/sentry/__init__.py,sha256=l3nI-3pjBNNmcOZ7xPeIis1n_wkPpvnk2aHxQYWsflU,261
352
352
  aip_agents/sentry/__init__.pyi,sha256=OGxzQzEvbnqf02zXdBJUrHeKfjfBgvnOL7p-0gNvP8k,103
353
- aip_agents/sentry/sentry.py,sha256=LlahQ2bkjL9FSFH0RoCdMDLhyXEUAj3zHkK_xxMQIKo,4501
354
- aip_agents/sentry/sentry.pyi,sha256=G9YgWGIqHskkfj9aXN-Y6RLe3tvDvYi_RSkW1Y_MFzE,1436
353
+ aip_agents/sentry/sentry.py,sha256=zyhIZCnA2mcLuf5w-ezE_7ZWOjPdGt3A5g7AcJrPgxY,4504
354
+ aip_agents/sentry/sentry.pyi,sha256=fTFb71FfeByBUIACjkp8qaHsWe6C52Y4tPTfizAPVv0,1432
355
355
  aip_agents/storage/__init__.py,sha256=cN4L2whui-DOm81tsYV88Wx5g5-cUjeLVyp55RtbJJU,1219
356
356
  aip_agents/storage/__init__.pyi,sha256=wn8VuS7x4WSzKuV01WrjPkZfnh3GylNum9FlPiaSdsA,901
357
357
  aip_agents/storage/base.py,sha256=dijzGJJRHPEneV-6QRC_xm0CzgYuIyhmnWloJC8oIx0,2413
@@ -370,12 +370,12 @@ aip_agents/storage/providers/memory.py,sha256=81E9yT_oRkH7tMVr5azZv1oXIaeTzTAtTu
370
370
  aip_agents/storage/providers/memory.pyi,sha256=r0meeCsjKyE9FHJqCysfQ5ZH_FWRRv2SWg-NOHCUD-g,2109
371
371
  aip_agents/storage/providers/object_storage.py,sha256=Q268Sn8Y09gS-ilP6fe4CR0YIOvdbunh3V6SmuQsAVs,6413
372
372
  aip_agents/storage/providers/object_storage.pyi,sha256=nBIKJjUAWkIKhYhBFmFcypjoOieIYOghy55f62x7AX8,2878
373
- aip_agents/tools/__init__.py,sha256=e3hU4EDzhrEnvRjy_NrGzMFqMQAjI4za4GBV7QdgceU,1840
374
- aip_agents/tools/__init__.pyi,sha256=_7XYjGn393oG99dCAPQqYdy5GmnykPBBH6TJB6QM54c,783
375
- aip_agents/tools/bosa_tools.py,sha256=uhRImaIACt_Ol9nraUGr0ddT8e35c8doVzwlJV6kGeA,3411
376
- aip_agents/tools/bosa_tools.pyi,sha256=GpWQhkytk4XS_rKWGBiS70y5mXC8b-1GGCkN1BaE97s,1128
377
- aip_agents/tools/constants.py,sha256=pVmUJx8WN1gYtDT52B4FsetnaYZZWozKQQ7wW18xIHo,5274
378
- aip_agents/tools/constants.pyi,sha256=QucwMEKTXywF72m8ofImoswbj6zA-BsfP0tRaIy7A6Y,3393
373
+ aip_agents/tools/__init__.py,sha256=J0wDdcKre3Qc_z1hhzKfPiaa1m2OPOXyHjl6uwOkApU,1935
374
+ aip_agents/tools/__init__.pyi,sha256=w1gRWL5iRdLtuBNXBhmD87uzfvIRrXwq3uZ1meku8js,888
375
+ aip_agents/tools/constants.py,sha256=AabnuPQG_mc2sVdr9jV23_6bFempAsxQv3kdCR_ztLA,5723
376
+ aip_agents/tools/constants.pyi,sha256=kFY8dKgRqHKGvPqG3QUyuEc8C5yRaDj7DYQDH88K2T0,3552
377
+ aip_agents/tools/gl_connector_tools.py,sha256=bxl_3VQYZDv3lFn6Y3kDVVRFwH4cntOLz3f74YzDcic,3936
378
+ aip_agents/tools/gl_connector_tools.pyi,sha256=2ATn_MW_FRg5Uv7dLI_ToBOtlgTSfj0zgDQpN1N-cJs,1366
379
379
  aip_agents/tools/memory_search_tool.py,sha256=gqTTb_Fao_Hl-SavfaFsqPDhnFQUjzIQUkzizSD2L0A,653
380
380
  aip_agents/tools/memory_search_tool.pyi,sha256=BCVFEEgH3pETnI9b6vRlMm2_PnnIeBe_vuMlL9y3LpU,453
381
381
  aip_agents/tools/time_tool.py,sha256=NPjz73hy1SNc3okWhDXdR45q84vmRUerDGDk_E-XyZk,3732
@@ -412,9 +412,9 @@ aip_agents/tools/code_sandbox/__init__.py,sha256=QPUBMzmSDGjvjnLRRJRHK7shP16LH6K
412
412
  aip_agents/tools/code_sandbox/__init__.pyi,sha256=hBgsW_ZdnGonBx7PtCwz3ohs8RuZcDpQMU6iK_VZIYg,134
413
413
  aip_agents/tools/code_sandbox/constant.py,sha256=55uM9sHOISdT40O3pVdLfL88YU-1Npy7CXkYxlLFzug,679
414
414
  aip_agents/tools/code_sandbox/constant.pyi,sha256=3bwRpYOZZNVYjBBvPXnTR_cq6dH-pALsy_5yCbxdPQU,81
415
- aip_agents/tools/code_sandbox/e2b_cloud_sandbox_extended.py,sha256=H91-1a3keS6Si5hLzQ7Z1tHM7ZWEv6p2fJQ6HSqttw0,9821
416
- aip_agents/tools/code_sandbox/e2b_cloud_sandbox_extended.pyi,sha256=ZnW7S-Wla5J-ZD8P92-sXuzTGZ2-z5zyv4aH97FlshI,3554
417
- aip_agents/tools/code_sandbox/e2b_sandbox_tool.py,sha256=sTFTQd9Li9lB2iXgsARfpJEfFz9O2_sdFYFh8gFvC6A,16954
415
+ aip_agents/tools/code_sandbox/e2b_cloud_sandbox_extended.py,sha256=78mrQ4Tfv0HQst92NugC2_ogw7LU0ubx8XKFAbW53vY,12013
416
+ aip_agents/tools/code_sandbox/e2b_cloud_sandbox_extended.pyi,sha256=W2NIk0b9dK-HTResYt1ppQdAcBLp2963D94XHX9hq6E,4366
417
+ aip_agents/tools/code_sandbox/e2b_sandbox_tool.py,sha256=TChVXscOR1WXmpjelwcZ_Ws4pYtuYhLALbvPXYz6iSU,16937
418
418
  aip_agents/tools/code_sandbox/e2b_sandbox_tool.pyi,sha256=ylrBQaqNBa1Jppld-mHjaskSa9SOjsQD8TdcK2bnl4s,1165
419
419
  aip_agents/tools/document_loader/__init__.py,sha256=rnQFLYJqvit5eegGIWGdjOUoEJiyOh3nW0mLSRd7xfE,1375
420
420
  aip_agents/tools/document_loader/__init__.pyi,sha256=RYZb-EdfR1btPxFBUwfmrOWs51aVgwJuw9epguxnVgQ,650
@@ -428,10 +428,10 @@ aip_agents/tools/document_loader/pdf_reader_tool.py,sha256=36U_r7E0n_nLl4xUXC4nD
428
428
  aip_agents/tools/document_loader/pdf_reader_tool.pyi,sha256=ZKr5E3ePTJWHdLfM3_7Ji9NGDpL29uKLFhLl-smZQqQ,494
429
429
  aip_agents/tools/document_loader/pdf_splitter.py,sha256=-QyrlnN4AXDqY_dxeUzxcgCVJJiD1vYUYR7swfhM_RQ,5752
430
430
  aip_agents/tools/document_loader/pdf_splitter.pyi,sha256=3IiRDQWDz8QR5LH_sni9O-N2qJFheFjKOQMAhiWxB7E,716
431
- aip_agents/tools/gl_connector/__init__.py,sha256=tpQ0vF7gMiyO32jTBndOAVor5MRDNff7yh_SC7Frv_U,136
431
+ aip_agents/tools/gl_connector/__init__.py,sha256=f8F4mdBFj0ulxewCQwG5qN2SDzlgI2jA0Kfj31A5iD0,137
432
432
  aip_agents/tools/gl_connector/__init__.pyi,sha256=96wtNkB3VUSI66aRlYxVrzMiPtqOYviRMKviRgX3_fc,113
433
- aip_agents/tools/gl_connector/tool.py,sha256=FaS8B6lJI4RuB5NoirqezIBQhsVb4ymUBvItJXtdWMc,11999
434
- aip_agents/tools/gl_connector/tool.pyi,sha256=u6GQCwxqFLVhZVYeTek6ExEvrhPTF7z1QCHcRtcgFqU,2746
433
+ aip_agents/tools/gl_connector/tool.py,sha256=jzT8XmTfFQC9ZcQplVcRs2VmCtKewH9FzT7wSFtUJac,13106
434
+ aip_agents/tools/gl_connector/tool.pyi,sha256=a5l0MHSOe_iWDvjMRzYtcbMdX0bFlK1m7Hl52HQ__iQ,2770
435
435
  aip_agents/tools/memory_search/__init__.py,sha256=YSsObYlHjdZEbJj4MVYy3Ht8JPlo42YhjnkI-yFNWV0,608
436
436
  aip_agents/tools/memory_search/__init__.pyi,sha256=NG0g94OoC_xw66yIqiPViqTnpj01QdnRsVBGzkSxJFI,554
437
437
  aip_agents/tools/memory_search/base.py,sha256=M4Vq5CnXge1rhVkESfVCAjyWEc6Ijmh8-6oAMkcZkjY,7333
@@ -540,7 +540,7 @@ aip_agents/utils/pii/pii_helper.py,sha256=g0yRzakfA2AA6vjUNLWHqFlcxyLql6MXQ90NN3
540
540
  aip_agents/utils/pii/pii_helper.pyi,sha256=dulZs150ikbAL3Bw2YLcz3_g4DsGmL3lciwf8mKxEjI,2939
541
541
  aip_agents/utils/pii/uuid_deanonymizer_mapping.py,sha256=Gks8l8t0cuS9pzoQnrpiK1CaLmWYksjOnTeiHh3_7EE,7348
542
542
  aip_agents/utils/pii/uuid_deanonymizer_mapping.pyi,sha256=gnWfD1rWZh_tloJjgKiZ6f6iNUuBaHpKqCSiP0d-9bs,3084
543
- aip_agents_binary-0.5.21.dist-info/METADATA,sha256=9Ta-eHHQSIDbLqofOHQfohKHsxxDakYIGyB2jChAuq8,22207
544
- aip_agents_binary-0.5.21.dist-info/WHEEL,sha256=PaP4PvkDyiSc4C6Dhw6ccQmfxsWFrSv-lJQjBshu0hw,105
545
- aip_agents_binary-0.5.21.dist-info/top_level.txt,sha256=PEz8vcwC1bH4UrkhF0LkIYCNfXGWZUHdSklbvkBe25E,11
546
- aip_agents_binary-0.5.21.dist-info/RECORD,,
543
+ aip_agents_binary-0.5.23.dist-info/METADATA,sha256=VlQHX0DiRpcp68ytt7zTHreClijm1LVv-IKEoz23044,22214
544
+ aip_agents_binary-0.5.23.dist-info/WHEEL,sha256=PaP4PvkDyiSc4C6Dhw6ccQmfxsWFrSv-lJQjBshu0hw,105
545
+ aip_agents_binary-0.5.23.dist-info/top_level.txt,sha256=PEz8vcwC1bH4UrkhF0LkIYCNfXGWZUHdSklbvkBe25E,11
546
+ aip_agents_binary-0.5.23.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- from aip_agents.agent import LangGraphAgent as LangGraphAgent
2
- from aip_agents.tools import BOSA_AUTOMATED_TOOLS as BOSA_AUTOMATED_TOOLS
3
-
4
- async def langgraph_bosa_example() -> None:
5
- """Demonstrates the LangGraphAgent's arun method."""
@@ -1,105 +0,0 @@
1
- """Auto-generated tools from BOSA connector.
2
-
3
- Authors:
4
- Saul Sayers (saul.sayers@gdplabs.id)
5
- """
6
-
7
- from bosa_connectors import BosaConnector, BOSAConnectorToolGenerator
8
- from langchain_core.tools import BaseTool
9
-
10
- from aip_agents.tools.constants import BOSA_API_BASE_URL, BOSA_API_KEY, BOSA_FETCH_MAX_RETRIES, ToolType
11
- from aip_agents.utils.logger import get_logger
12
-
13
- logger = get_logger(__name__)
14
-
15
-
16
- def get_bosa_modules_with_retry() -> list[str]:
17
- """Try to get available modules with retries.
18
-
19
- Returns:
20
- List of available modules.
21
- """
22
- if not BOSA_API_BASE_URL or not BOSA_API_KEY:
23
- logger.warning("BOSA credentials missing (base_url or api_key); returning empty modules list")
24
- return []
25
-
26
- connector = BosaConnector(api_base_url=BOSA_API_BASE_URL, api_key=BOSA_API_KEY)
27
- modules = []
28
- for attempt in range(BOSA_FETCH_MAX_RETRIES):
29
- try:
30
- modules = list(connector.get_available_modules())
31
- if modules:
32
- return modules
33
- logger.warning(
34
- f"Failed to get BOSA available modules, retrying... (attempt {attempt + 1} / {BOSA_FETCH_MAX_RETRIES})"
35
- )
36
- except Exception as e:
37
- logger.exception(
38
- f"Exception when getting BOSA available modules (attempt {attempt + 1} / {BOSA_FETCH_MAX_RETRIES}): {e}"
39
- )
40
- logger.error("Failed to get BOSA available modules after maximum retries")
41
- return modules
42
-
43
-
44
- class LazyBosaToolsDict(dict):
45
- """Lazy dictionary for BOSA tools."""
46
-
47
- def __missing__(self, app):
48
- """When a key is missing, create the tools and store them in the dictionary.
49
-
50
- Args:
51
- app: Name of the BOSA connector.
52
-
53
- Returns:
54
- List of tools generated by BOSAConnectorToolGenerator.
55
- """
56
- if app not in get_bosa_modules():
57
- return []
58
- tools = []
59
- for attempt in range(BOSA_FETCH_MAX_RETRIES):
60
- try:
61
- tools = BOSAConnectorToolGenerator(
62
- api_base_url=BOSA_API_BASE_URL,
63
- api_key=BOSA_API_KEY,
64
- app_name=app,
65
- ).generate_tools(tool_type=ToolType.LANGCHAIN)
66
- if tools:
67
- self[app] = tools
68
- return tools
69
- logger.warning(
70
- f"Failed to create BOSA tools, retrying... (attempt {attempt + 1} / {BOSA_FETCH_MAX_RETRIES})"
71
- )
72
- except Exception as e:
73
- logger.exception(
74
- f"Exception when creating BOSA tools for app '{app}' "
75
- f"(attempt {attempt + 1} / {BOSA_FETCH_MAX_RETRIES}): {e}"
76
- )
77
- logger.error("Failed to create BOSA tools after maximum retries")
78
- return tools
79
-
80
-
81
- # Supported modules (dynamic)
82
- def get_bosa_modules() -> list[str]:
83
- """Lazily fetch and cache BOSA modules.
84
-
85
- This is for backwards compatibility with the old BOSA modules.
86
-
87
- Returns:
88
- List of BOSA modules.
89
- """
90
- if not hasattr(get_bosa_modules, "_cache"):
91
- get_bosa_modules._cache = get_bosa_modules_with_retry()
92
- return get_bosa_modules._cache
93
-
94
-
95
- # FOR BACKWARDS COMPATIBILITY
96
- BOSA_MODULES = [
97
- "github",
98
- "twitter",
99
- "google",
100
- "google_drive",
101
- "google_mail",
102
- "google_docs",
103
- ]
104
-
105
- BOSA_AUTOMATED_TOOLS: dict[str, list[BaseTool]] = LazyBosaToolsDict()
@@ -1,37 +0,0 @@
1
- from _typeshed import Incomplete
2
- from aip_agents.tools.constants import BOSA_API_BASE_URL as BOSA_API_BASE_URL, BOSA_API_KEY as BOSA_API_KEY, BOSA_FETCH_MAX_RETRIES as BOSA_FETCH_MAX_RETRIES, ToolType as ToolType
3
- from aip_agents.utils.logger import get_logger as get_logger
4
- from langchain_core.tools import BaseTool as BaseTool
5
-
6
- logger: Incomplete
7
-
8
- def get_bosa_modules_with_retry() -> list[str]:
9
- """Try to get available modules with retries.
10
-
11
- Returns:
12
- List of available modules.
13
- """
14
-
15
- class LazyBosaToolsDict(dict):
16
- """Lazy dictionary for BOSA tools."""
17
- def __missing__(self, app):
18
- """When a key is missing, create the tools and store them in the dictionary.
19
-
20
- Args:
21
- app: Name of the BOSA connector.
22
-
23
- Returns:
24
- List of tools generated by BOSAConnectorToolGenerator.
25
- """
26
-
27
- def get_bosa_modules() -> list[str]:
28
- """Lazily fetch and cache BOSA modules.
29
-
30
- This is for backwards compatibility with the old BOSA modules.
31
-
32
- Returns:
33
- List of BOSA modules.
34
- """
35
-
36
- BOSA_MODULES: Incomplete
37
- BOSA_AUTOMATED_TOOLS: dict[str, list[BaseTool]]