aip-agents-binary 0.6.4__py3-none-macosx_13_0_arm64.whl → 0.6.5__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.
@@ -6,13 +6,25 @@ Author:
6
6
  Christian Trisno Sen Long Chen (christian.t.s.l.chen@gdplabs.id)
7
7
  """
8
8
 
9
+ from __future__ import annotations
10
+
11
+ from typing import TYPE_CHECKING, Any
12
+
9
13
  from aip_agents.agent.base_agent import BaseAgent
14
+
15
+ if TYPE_CHECKING:
16
+ from aip_agents.agent.google_adk_agent import GoogleADKAgent
17
+ from aip_agents.agent.langflow_agent import LangflowAgent
10
18
  from aip_agents.agent.base_langgraph_agent import BaseLangGraphAgent
11
- from aip_agents.agent.google_adk_agent import GoogleADKAgent
12
19
  from aip_agents.agent.interface import AgentInterface
13
- from aip_agents.agent.langflow_agent import LangflowAgent
14
- from aip_agents.agent.langgraph_memory_enhancer_agent import LangGraphMemoryEnhancerAgent
15
- from aip_agents.agent.langgraph_react_agent import LangChainAgent, LangGraphAgent, LangGraphReactAgent
20
+ from aip_agents.agent.langgraph_memory_enhancer_agent import (
21
+ LangGraphMemoryEnhancerAgent,
22
+ )
23
+ from aip_agents.agent.langgraph_react_agent import (
24
+ LangChainAgent,
25
+ LangGraphAgent,
26
+ LangGraphReactAgent,
27
+ )
16
28
 
17
29
  __all__ = [
18
30
  "AgentInterface",
@@ -25,3 +37,31 @@ __all__ = [
25
37
  "LangflowAgent",
26
38
  "LangGraphMemoryEnhancerAgent",
27
39
  ]
40
+
41
+
42
+ def __getattr__(name: str) -> Any:
43
+ """Lazy import of heavy agent implementations.
44
+
45
+ This avoids importing heavy dependencies (Google ADK, etc.)
46
+ when they are not needed.
47
+
48
+ Args:
49
+ name: Attribute name to import.
50
+
51
+ Returns:
52
+ The requested class.
53
+
54
+ Raises:
55
+ AttributeError: If attribute is not found.
56
+ """
57
+ if name == "GoogleADKAgent":
58
+ from aip_agents.agent.google_adk_agent import (
59
+ GoogleADKAgent as _GoogleADKAgent,
60
+ )
61
+
62
+ return _GoogleADKAgent
63
+ elif name == "LangflowAgent":
64
+ from aip_agents.agent.langflow_agent import LangflowAgent as _LangflowAgent
65
+
66
+ return _LangflowAgent
67
+ raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
@@ -7,8 +7,44 @@ Authors:
7
7
  Putu Ravindra Wiguna (putu.r.wiguna@gdplabs.id)
8
8
  """
9
9
 
10
+ from __future__ import annotations
11
+
12
+ from typing import TYPE_CHECKING, Any
13
+
10
14
  from aip_agents.mcp.client.base_mcp_client import BaseMCPClient
11
- from aip_agents.mcp.client.google_adk.client import GoogleADKMCPClient
12
- from aip_agents.mcp.client.langchain.client import LangchainMCPClient
15
+
16
+ if TYPE_CHECKING:
17
+ from aip_agents.mcp.client.google_adk.client import GoogleADKMCPClient
18
+ from aip_agents.mcp.client.langchain.client import LangchainMCPClient
13
19
 
14
20
  __all__ = ["GoogleADKMCPClient", "LangchainMCPClient", "BaseMCPClient"]
21
+
22
+
23
+ def __getattr__(name: str) -> Any:
24
+ """Lazy import of MCP client implementations.
25
+
26
+ This avoids importing heavy dependencies (Google ADK, Vertex AI, etc.)
27
+ when they are not needed.
28
+
29
+ Args:
30
+ name: Attribute name to import.
31
+
32
+ Returns:
33
+ The requested class.
34
+
35
+ Raises:
36
+ AttributeError: If attribute is not found.
37
+ """
38
+ if name == "GoogleADKMCPClient":
39
+ from aip_agents.mcp.client.google_adk.client import (
40
+ GoogleADKMCPClient as _GoogleADKMCPClient,
41
+ )
42
+
43
+ return _GoogleADKMCPClient
44
+ elif name == "LangchainMCPClient":
45
+ from aip_agents.mcp.client.langchain.client import (
46
+ LangchainMCPClient as _LangchainMCPClient,
47
+ )
48
+
49
+ return _LangchainMCPClient
50
+ raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
@@ -6,6 +6,7 @@ Authors:
6
6
 
7
7
  import inspect
8
8
  import os
9
+ from typing import Any
9
10
 
10
11
  from bosa_core.telemetry import (
11
12
  FastAPIConfig,
@@ -20,7 +21,7 @@ from bosa_core.telemetry.opentelemetry.instrument.functions import (
20
21
  from dotenv import load_dotenv
21
22
  from fastapi import FastAPI
22
23
 
23
- from aip_agents.agent import BaseAgent, GoogleADKAgent, LangChainAgent, LangGraphAgent
24
+ from aip_agents.agent import BaseAgent, LangChainAgent, LangGraphAgent
24
25
  from aip_agents.utils.logger import get_logger
25
26
 
26
27
  load_dotenv()
@@ -35,12 +36,32 @@ VERSION_NUMBER = os.getenv("VERSION_NUMBER", "0.0.0")
35
36
  BUILD_NUMBER = os.getenv("BUILD_NUMBER", "0")
36
37
  USE_OPENTELEMETRY = os.getenv("USE_OPENTELEMETRY", "true").lower() == "true"
37
38
 
38
- CLASSES_TO_INSTRUMENT = [
39
- BaseAgent,
40
- LangGraphAgent,
41
- LangChainAgent,
42
- GoogleADKAgent,
43
- ]
39
+ # Lazy import of GoogleADKAgent to avoid heavy dependencies when not needed.
40
+ # This is initialized lazily by _get_classes_to_instrument() and can be
41
+ # patched by tests for mocking purposes.
42
+ CLASSES_TO_INSTRUMENT: list[type[Any]] | None = None
43
+
44
+
45
+ def _get_classes_to_instrument() -> list[type[Any]]:
46
+ """Get the list of classes to instrument.
47
+
48
+ This lazily imports GoogleADKAgent only when telemetry is being set up,
49
+ avoiding the heavy Google ADK dependencies during module import.
50
+
51
+ Returns:
52
+ List of agent classes to instrument.
53
+ """
54
+ global CLASSES_TO_INSTRUMENT
55
+ if CLASSES_TO_INSTRUMENT is None:
56
+ from aip_agents.agent import GoogleADKAgent
57
+
58
+ CLASSES_TO_INSTRUMENT = [
59
+ BaseAgent,
60
+ LangGraphAgent,
61
+ LangChainAgent,
62
+ GoogleADKAgent,
63
+ ]
64
+ return CLASSES_TO_INSTRUMENT
44
65
 
45
66
 
46
67
  def get_all_methods(cls: type) -> list:
@@ -66,7 +87,7 @@ def instrument_gl_functions() -> None:
66
87
  if BOSAFunctionsInstrumentor is None:
67
88
  return
68
89
  agent_methods = []
69
- for cls in CLASSES_TO_INSTRUMENT:
90
+ for cls in _get_classes_to_instrument():
70
91
  agent_methods.extend(get_all_methods(cls))
71
92
  BOSAFunctionsInstrumentor().instrument(methods=agent_methods)
72
93
 
@@ -1,7 +1,8 @@
1
1
  from _typeshed import Incomplete
2
- from aip_agents.agent import BaseAgent as BaseAgent, GoogleADKAgent as GoogleADKAgent, LangChainAgent as LangChainAgent, LangGraphAgent as LangGraphAgent
2
+ from aip_agents.agent import BaseAgent as BaseAgent, LangChainAgent as LangChainAgent, LangGraphAgent as LangGraphAgent
3
3
  from aip_agents.utils.logger import get_logger as get_logger
4
4
  from fastapi import FastAPI
5
+ from typing import Any
5
6
 
6
7
  logger: Incomplete
7
8
  SENTRY_DSN: Incomplete
@@ -10,7 +11,7 @@ SENTRY_PROJECT: Incomplete
10
11
  VERSION_NUMBER: Incomplete
11
12
  BUILD_NUMBER: Incomplete
12
13
  USE_OPENTELEMETRY: Incomplete
13
- CLASSES_TO_INSTRUMENT: Incomplete
14
+ CLASSES_TO_INSTRUMENT: list[type[Any]] | None
14
15
 
15
16
  def get_all_methods(cls) -> list:
16
17
  """Get all methods from a class.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aip-agents-binary
3
- Version: 0.6.4
3
+ Version: 0.6.5
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
@@ -16,7 +16,7 @@ aip_agents/a2a/server/langflow_executor.py,sha256=6bVnwqRnqbBi949JHHWcIB-ZVQAPGJ
16
16
  aip_agents/a2a/server/langflow_executor.pyi,sha256=nlWUIOEGFcp4qtyrmmxax0TfzwIwOGkvFK-YmG0cGMg,1837
17
17
  aip_agents/a2a/server/langgraph_executor.py,sha256=45XRRwj7EQFBAkS69cZGtuL4ZtHZ0BDEyvDTp4Kw3yg,10765
18
18
  aip_agents/a2a/server/langgraph_executor.pyi,sha256=I6RX8_CjF0-gbJEYmNMO2P_i272k3R7X5iZNP5IfdTE,2287
19
- aip_agents/agent/__init__.py,sha256=KBT-e5nEBMVJypC8OFulmErUK63gmQZus0UcBu6EqBo,892
19
+ aip_agents/agent/__init__.py,sha256=v43Suwam9yhDIMhhr3bupMzOZqrzYjj_rm4Diw-wM30,1771
20
20
  aip_agents/agent/__init__.pyi,sha256=MxIAeAv1pPCtqfAa3lvmeCAN-IT5p3v77IeKhfKYvKo,855
21
21
  aip_agents/agent/base_agent.py,sha256=XH19lJZuumWBu2JMoretv6T4bSXcWMqK8jZ3mOWWzCk,39669
22
22
  aip_agents/agent/base_agent.pyi,sha256=xnWp05zTJrt1YfHmm9CsggBmrSsIY-SSy_G9EWGvEBQ,11118
@@ -302,7 +302,7 @@ aip_agents/guardrails/engines/phrase_matcher.py,sha256=4rilmNkZ3OCeUC6YhMVRT_UJe
302
302
  aip_agents/guardrails/engines/phrase_matcher.pyi,sha256=Gk978fctlBNoyoxtjIIQTwcoBC6pzb0DVP7LTHeKQfc,2060
303
303
  aip_agents/mcp/__init__.py,sha256=CCc2mHoabzEFzQyjEW4ULKglEGtR_BGgBZNix8QjWjU,60
304
304
  aip_agents/mcp/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
305
- aip_agents/mcp/client/__init__.py,sha256=85jA6v-bjjm13kCqnu57__fIprCAk5fC628API9h6uc,493
305
+ aip_agents/mcp/client/__init__.py,sha256=tA-LtCpvTL_OM0nzLLCm7uOxb46xMz4cuN_xBZojPmw,1430
306
306
  aip_agents/mcp/client/__init__.pyi,sha256=XgIkFbbmAh5cqQM4t1xT5y-Avu0vf4b-YCn6btXjIK8,339
307
307
  aip_agents/mcp/client/base_mcp_client.py,sha256=36bY_4BbzVBogDekwBOCL3A12MuXmKiNTpbxQjBgjlM,13973
308
308
  aip_agents/mcp/client/base_mcp_client.pyi,sha256=FuJBA4TLFPBJzuHqpxMGOlODgMpT7avOoAR34TsiQAk,5881
@@ -412,8 +412,8 @@ aip_agents/schema/storage.py,sha256=Tl0RFT32GWdsc5y8bTvpWMOU8hmQxXIlrMub3qdwx8Y,
412
412
  aip_agents/schema/storage.pyi,sha256=exaZAS49PYSuhYSPYukIRCRHIGRyCpBGucrdpnhV4zE,557
413
413
  aip_agents/sentry/__init__.py,sha256=l3nI-3pjBNNmcOZ7xPeIis1n_wkPpvnk2aHxQYWsflU,261
414
414
  aip_agents/sentry/__init__.pyi,sha256=OGxzQzEvbnqf02zXdBJUrHeKfjfBgvnOL7p-0gNvP8k,103
415
- aip_agents/sentry/sentry.py,sha256=zyhIZCnA2mcLuf5w-ezE_7ZWOjPdGt3A5g7AcJrPgxY,4504
416
- aip_agents/sentry/sentry.pyi,sha256=fTFb71FfeByBUIACjkp8qaHsWe6C52Y4tPTfizAPVv0,1432
415
+ aip_agents/sentry/sentry.py,sha256=EBpHFzm_I--lZStmFuA2HQHXvJOEiYj2KG2t1LGn0Vc,5280
416
+ aip_agents/sentry/sentry.pyi,sha256=ikoJuMEAvg_DSHf_IvBxNEXxhdagmsN1CtqvsMGjfg0,1433
417
417
  aip_agents/storage/__init__.py,sha256=cN4L2whui-DOm81tsYV88Wx5g5-cUjeLVyp55RtbJJU,1219
418
418
  aip_agents/storage/__init__.pyi,sha256=wn8VuS7x4WSzKuV01WrjPkZfnh3GylNum9FlPiaSdsA,901
419
419
  aip_agents/storage/base.py,sha256=dijzGJJRHPEneV-6QRC_xm0CzgYuIyhmnWloJC8oIx0,2413
@@ -606,7 +606,7 @@ aip_agents/utils/pii/pii_helper.py,sha256=g0yRzakfA2AA6vjUNLWHqFlcxyLql6MXQ90NN3
606
606
  aip_agents/utils/pii/pii_helper.pyi,sha256=dulZs150ikbAL3Bw2YLcz3_g4DsGmL3lciwf8mKxEjI,2939
607
607
  aip_agents/utils/pii/uuid_deanonymizer_mapping.py,sha256=Gks8l8t0cuS9pzoQnrpiK1CaLmWYksjOnTeiHh3_7EE,7348
608
608
  aip_agents/utils/pii/uuid_deanonymizer_mapping.pyi,sha256=gnWfD1rWZh_tloJjgKiZ6f6iNUuBaHpKqCSiP0d-9bs,3084
609
- aip_agents_binary-0.6.4.dist-info/METADATA,sha256=IEUX5CDrYnEC8vfhCQ4_UuRBm8OsYx-aY246fcjOpyE,22194
610
- aip_agents_binary-0.6.4.dist-info/WHEEL,sha256=KxCTaSkoYs_EnWvWxmau4HAvN-_rCRYV_bfRc_41A9k,106
611
- aip_agents_binary-0.6.4.dist-info/top_level.txt,sha256=PEz8vcwC1bH4UrkhF0LkIYCNfXGWZUHdSklbvkBe25E,11
612
- aip_agents_binary-0.6.4.dist-info/RECORD,,
609
+ aip_agents_binary-0.6.5.dist-info/METADATA,sha256=oTbOgYNNZ2IWWrrf2uSGyocsC5qcFNh1WGX5pOpZDXA,22194
610
+ aip_agents_binary-0.6.5.dist-info/WHEEL,sha256=KxCTaSkoYs_EnWvWxmau4HAvN-_rCRYV_bfRc_41A9k,106
611
+ aip_agents_binary-0.6.5.dist-info/top_level.txt,sha256=PEz8vcwC1bH4UrkhF0LkIYCNfXGWZUHdSklbvkBe25E,11
612
+ aip_agents_binary-0.6.5.dist-info/RECORD,,