quraite 0.0.1__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 (49) hide show
  1. quraite-0.0.1/PKG-INFO +44 -0
  2. quraite-0.0.1/README.md +9 -0
  3. quraite-0.0.1/pyproject.toml +74 -0
  4. quraite-0.0.1/quraite/__init__.py +3 -0
  5. quraite-0.0.1/quraite/adapters/__init__.py +134 -0
  6. quraite-0.0.1/quraite/adapters/agno_adapter.py +159 -0
  7. quraite-0.0.1/quraite/adapters/base.py +123 -0
  8. quraite-0.0.1/quraite/adapters/bedrock_agents_adapter.py +343 -0
  9. quraite-0.0.1/quraite/adapters/flowise_adapter.py +275 -0
  10. quraite-0.0.1/quraite/adapters/google_adk_adapter.py +209 -0
  11. quraite-0.0.1/quraite/adapters/http_adapter.py +239 -0
  12. quraite-0.0.1/quraite/adapters/langflow_adapter.py +192 -0
  13. quraite-0.0.1/quraite/adapters/langgraph_adapter.py +304 -0
  14. quraite-0.0.1/quraite/adapters/langgraph_server_adapter.py +252 -0
  15. quraite-0.0.1/quraite/adapters/n8n_adapter.py +220 -0
  16. quraite-0.0.1/quraite/adapters/openai_agents_adapter.py +269 -0
  17. quraite-0.0.1/quraite/adapters/pydantic_ai_adapter.py +312 -0
  18. quraite-0.0.1/quraite/adapters/smolagents_adapter.py +152 -0
  19. quraite-0.0.1/quraite/logger.py +62 -0
  20. quraite-0.0.1/quraite/schema/__init__.py +0 -0
  21. quraite-0.0.1/quraite/schema/message.py +54 -0
  22. quraite-0.0.1/quraite/schema/response.py +16 -0
  23. quraite-0.0.1/quraite/serve/__init__.py +1 -0
  24. quraite-0.0.1/quraite/serve/cloudflared.py +210 -0
  25. quraite-0.0.1/quraite/serve/local_agent.py +360 -0
  26. quraite-0.0.1/quraite/traces/traces_adk_openinference.json +379 -0
  27. quraite-0.0.1/quraite/traces/traces_agno_multi_agent.json +669 -0
  28. quraite-0.0.1/quraite/traces/traces_agno_openinference.json +321 -0
  29. quraite-0.0.1/quraite/traces/traces_crewai_openinference.json +155 -0
  30. quraite-0.0.1/quraite/traces/traces_langgraph_openinference.json +349 -0
  31. quraite-0.0.1/quraite/traces/traces_langgraph_openinference_multi_agent.json +2705 -0
  32. quraite-0.0.1/quraite/traces/traces_langgraph_traceloop.json +510 -0
  33. quraite-0.0.1/quraite/traces/traces_openai_agents_multi_agent_1.json +402 -0
  34. quraite-0.0.1/quraite/traces/traces_openai_agents_openinference.json +341 -0
  35. quraite-0.0.1/quraite/traces/traces_pydantic_openinference.json +286 -0
  36. quraite-0.0.1/quraite/traces/traces_pydantic_openinference_multi_agent_1.json +399 -0
  37. quraite-0.0.1/quraite/traces/traces_pydantic_openinference_multi_agent_2.json +398 -0
  38. quraite-0.0.1/quraite/traces/traces_smol_agents_openinference.json +397 -0
  39. quraite-0.0.1/quraite/traces/traces_smol_agents_tool_calling_openinference.json +704 -0
  40. quraite-0.0.1/quraite/tracing/__init__.py +24 -0
  41. quraite-0.0.1/quraite/tracing/constants.py +16 -0
  42. quraite-0.0.1/quraite/tracing/span_exporter.py +115 -0
  43. quraite-0.0.1/quraite/tracing/span_processor.py +49 -0
  44. quraite-0.0.1/quraite/tracing/tool_extractors.py +290 -0
  45. quraite-0.0.1/quraite/tracing/trace.py +494 -0
  46. quraite-0.0.1/quraite/tracing/types.py +179 -0
  47. quraite-0.0.1/quraite/tracing/utils.py +170 -0
  48. quraite-0.0.1/quraite/utils/__init__.py +0 -0
  49. quraite-0.0.1/quraite/utils/json_utils.py +269 -0
quraite-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,44 @@
1
+ Metadata-Version: 2.3
2
+ Name: quraite
3
+ Version: 0.0.1
4
+ Summary: This project provides adaptors and methods to integrate with the Quraite platform
5
+ Author: Shiv Mohith
6
+ Author-email: Shiv Mohith <shivmohith8@gmail.com>
7
+ Requires-Dist: aiohttp>=3.13.2
8
+ Requires-Dist: fastapi>=0.121.1
9
+ Requires-Dist: httpx>=0.28.1
10
+ Requires-Dist: openinference-semantic-conventions>=0.1.25
11
+ Requires-Dist: opentelemetry-api>=1.37.0
12
+ Requires-Dist: opentelemetry-sdk>=1.37.0
13
+ Requires-Dist: pydantic>=2.12.4
14
+ Requires-Dist: python-dotenv>=1.2.1
15
+ Requires-Dist: uvicorn>=0.38.0
16
+ Requires-Dist: agno>=2.3.4 ; extra == 'agno'
17
+ Requires-Dist: boto3>=1.40.70 ; extra == 'bedrock'
18
+ Requires-Dist: google-adk>=1.18.0 ; extra == 'google-adk'
19
+ Requires-Dist: langchain>=1.0.5 ; extra == 'langgraph'
20
+ Requires-Dist: langgraph>=1.0.3 ; extra == 'langgraph'
21
+ Requires-Dist: openai-agents>=0.5.0 ; extra == 'openai-agents'
22
+ Requires-Dist: pydantic-ai>=1.25.0 ; extra == 'pydantic-ai'
23
+ Requires-Dist: pyngrok>=7.5.0 ; extra == 'pyngrok'
24
+ Requires-Dist: smolagents>=1.23.0 ; extra == 'smolagents'
25
+ Requires-Python: >=3.10
26
+ Provides-Extra: agno
27
+ Provides-Extra: bedrock
28
+ Provides-Extra: google-adk
29
+ Provides-Extra: langgraph
30
+ Provides-Extra: openai-agents
31
+ Provides-Extra: pydantic-ai
32
+ Provides-Extra: pyngrok
33
+ Provides-Extra: smolagents
34
+ Description-Content-Type: text/markdown
35
+
36
+ ## Quraite Python SDK
37
+
38
+ ### Publishing to Test PyPI
39
+
40
+ ```bash
41
+ make update-version v=0.4.0
42
+ make build
43
+ make publish-test-pypi # enter user name as "__token__" and then enter the key
44
+ ```
@@ -0,0 +1,9 @@
1
+ ## Quraite Python SDK
2
+
3
+ ### Publishing to Test PyPI
4
+
5
+ ```bash
6
+ make update-version v=0.4.0
7
+ make build
8
+ make publish-test-pypi # enter user name as "__token__" and then enter the key
9
+ ```
@@ -0,0 +1,74 @@
1
+ [project]
2
+ name = "quraite"
3
+ version = "0.0.1"
4
+ description = "This project provides adaptors and methods to integrate with the Quraite platform"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Shiv Mohith", email = "shivmohith8@gmail.com" }
8
+ ]
9
+ requires-python = ">=3.10"
10
+ dependencies = [
11
+ "aiohttp>=3.13.2",
12
+ "fastapi>=0.121.1",
13
+ "httpx>=0.28.1",
14
+ "openinference-semantic-conventions>=0.1.25",
15
+ "opentelemetry-api>=1.37.0",
16
+ "opentelemetry-sdk>=1.37.0",
17
+ "pydantic>=2.12.4",
18
+ "python-dotenv>=1.2.1",
19
+ "uvicorn>=0.38.0",
20
+ ]
21
+
22
+ [project.optional-dependencies]
23
+ agno = ["agno>=2.3.4"]
24
+
25
+ google-adk = ["google-adk>=1.18.0"]
26
+
27
+ langgraph = [
28
+ "langchain>=1.0.5",
29
+ "langgraph>=1.0.3"
30
+ ]
31
+
32
+ bedrock = ["boto3>=1.40.70"]
33
+
34
+ openai-agents = ["openai-agents>=0.5.0"]
35
+
36
+ pydantic-ai = ["pydantic-ai>=1.25.0"]
37
+
38
+ smolagents = ["smolagents>=1.23.0"]
39
+
40
+ pyngrok = ["pyngrok>=7.5.0"]
41
+
42
+ [build-system]
43
+ requires = ["uv_build>=0.9.6,<0.10.0"]
44
+ build-backend = "uv_build"
45
+
46
+ [tool.uv.build-backend]
47
+ module-name = "quraite"
48
+ module-root = ""
49
+
50
+ [dependency-groups]
51
+ dev = [
52
+ "autoflake>=2.3.1",
53
+ "black>=25.9.0",
54
+ "ipykernel>=7.1.0",
55
+ "isort>=6.1.0",
56
+ ]
57
+ test = [
58
+ "numpy>=2.2.6",
59
+ "pandas>=2.3.3",
60
+ "langchain-google-genai>=3.0.2",
61
+ "langchain-openai>=1.0.2",
62
+ "openinference-instrumentation-agno>=0.1.23",
63
+ "openinference-instrumentation-google-adk>=0.1.7",
64
+ "openinference-instrumentation-langchain>=0.1.56",
65
+ "openinference-instrumentation-openai>=0.1.41",
66
+ "openinference-instrumentation-openai-agents>=1.4.0",
67
+ "openinference-instrumentation-pydantic-ai>=0.1.9",
68
+ "openinference-instrumentation-smolagents>=0.1.20",
69
+ "pytest>=9.0.1",
70
+ "pytest-asyncio>=1.3.0",
71
+ "pytest-vcr>=1.0.2",
72
+ "pytest-env>=1.2.0",
73
+ "pytest-dotenv>=0.5.2",
74
+ ]
@@ -0,0 +1,3 @@
1
+ """Quraite Python SDK"""
2
+
3
+ __version__ = "0.6.0"
@@ -0,0 +1,134 @@
1
+ from typing import TYPE_CHECKING
2
+
3
+ from quraite.adapters.base import BaseAdapter, DummyAdapter
4
+ from quraite.adapters.http_adapter import HttpAdapter
5
+
6
+ if TYPE_CHECKING:
7
+ from quraite.adapters.agno_adapter import AgnoAdapter
8
+ from quraite.adapters.bedrock_agents_adapter import BedrockAgentsAdapter
9
+ from quraite.adapters.flowise_adapter import FlowiseAdapter
10
+ from quraite.adapters.google_adk_adapter import GoogleADKAdapter
11
+ from quraite.adapters.langflow_adapter import LangflowAdapter
12
+ from quraite.adapters.langgraph_adapter import LanggraphAdapter
13
+ from quraite.adapters.langgraph_server_adapter import LanggraphServerAdapter
14
+ from quraite.adapters.n8n_adapter import N8nAdapter
15
+ from quraite.adapters.openai_agents_adapter import OpenaiAgentsAdapter
16
+ from quraite.adapters.pydantic_ai_adapter import PydanticAIAdapter
17
+ from quraite.adapters.smolagents_adapter import SmolagentsAdapter
18
+
19
+
20
+ __all__ = [
21
+ "AgnoAdapter",
22
+ "BaseAdapter",
23
+ "BedrockAgentsAdapter",
24
+ "DummyAdapter",
25
+ "FlowiseAdapter",
26
+ "GoogleADKAdapter",
27
+ "LangflowAdapter",
28
+ "LanggraphAdapter",
29
+ "LanggraphServerAdapter",
30
+ "N8nAdapter",
31
+ "OpenaiAgentsAdapter",
32
+ "PydanticAIAdapter",
33
+ "HttpAdapter",
34
+ "SmolagentsAdapter",
35
+ ]
36
+
37
+
38
+ def __getattr__(name: str):
39
+ if name == "AgnoAdapter":
40
+ try:
41
+ from quraite.adapters.agno_adapter import AgnoAdapter
42
+
43
+ return AgnoAdapter
44
+ except ImportError as e:
45
+ raise ImportError(
46
+ f"Failed to import {name}. Please install the 'agno' optional dependency: pip install 'quraite[agno]'"
47
+ ) from e
48
+
49
+ elif name == "BedrockAgentsAdapter":
50
+ try:
51
+ from quraite.adapters.bedrock_agents_adapter import BedrockAgentsAdapter
52
+
53
+ return BedrockAgentsAdapter
54
+ except ImportError as e:
55
+ raise ImportError(
56
+ f"Failed to import {name}. Please install the 'bedrock-agents' optional dependency: pip install 'quraite[bedrock-agents]'"
57
+ ) from e
58
+
59
+ elif name == "FlowiseAdapter":
60
+ from quraite.adapters.flowise_adapter import FlowiseAdapter
61
+
62
+ return FlowiseAdapter
63
+
64
+ elif name == "GoogleADKAdapter":
65
+ try:
66
+ from quraite.adapters.google_adk_adapter import GoogleADKAdapter
67
+
68
+ return GoogleADKAdapter
69
+ except ImportError as e:
70
+ raise ImportError(
71
+ f"Failed to import {name}. Please install the 'google-adk' optional dependency: pip install 'quraite[google-adk]'"
72
+ ) from e
73
+
74
+ elif name == "LangflowAdapter":
75
+ from quraite.adapters.langflow_adapter import LangflowAdapter
76
+
77
+ return LangflowAdapter
78
+
79
+ elif name == "LanggraphAdapter":
80
+ try:
81
+ from quraite.adapters.langgraph_adapter import LanggraphAdapter
82
+
83
+ return LanggraphAdapter
84
+ except ImportError as e:
85
+ raise ImportError(
86
+ f"Failed to import {name}. Please install the 'langgraph' optional dependency: pip install 'quraite[langgraph]'"
87
+ ) from e
88
+
89
+ elif name == "LanggraphServerAdapter":
90
+ try:
91
+ from quraite.adapters.langgraph_server_adapter import LanggraphServerAdapter
92
+
93
+ return LanggraphServerAdapter
94
+ except ImportError as e:
95
+ raise ImportError(
96
+ f"Failed to import {name}. Please install the 'langgraph' optional dependency: pip install 'quraite[langgraph]'"
97
+ ) from e
98
+
99
+ elif name == "N8nAdapter":
100
+ from quraite.adapters.n8n_adapter import N8nAdapter
101
+
102
+ return N8nAdapter
103
+
104
+ elif name == "OpenaiAgentsAdapter":
105
+ try:
106
+ from quraite.adapters.openai_agents_adapter import OpenaiAgentsAdapter
107
+
108
+ return OpenaiAgentsAdapter
109
+ except ImportError as e:
110
+ raise ImportError(
111
+ f"Failed to import {name}. Please install the 'openai-agents' optional dependency: pip install 'quraite[openai-agents]'"
112
+ ) from e
113
+
114
+ elif name == "PydanticAIAdapter":
115
+ try:
116
+ from quraite.adapters.pydantic_ai_adapter import PydanticAIAdapter
117
+
118
+ return PydanticAIAdapter
119
+ except ImportError as e:
120
+ raise ImportError(
121
+ f"Failed to import {name}. Please install the 'pydantic-ai' optional dependency: pip install 'quraite[pydantic-ai]'"
122
+ ) from e
123
+
124
+ elif name == "SmolagentsAdapter":
125
+ try:
126
+ from quraite.adapters.smolagents_adapter import SmolagentsAdapter
127
+
128
+ return SmolagentsAdapter
129
+ except ImportError as e:
130
+ raise ImportError(
131
+ f"Failed to import {name}. Please install the 'smolagents' optional dependency: pip install 'quraite[smolagents]'"
132
+ ) from e
133
+
134
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -0,0 +1,159 @@
1
+ import uuid
2
+ from typing import List, Union
3
+
4
+ from agno.agent import Agent
5
+ from agno.team import Team
6
+ from opentelemetry.trace import TracerProvider
7
+
8
+ from quraite.adapters.base import BaseAdapter
9
+ from quraite.logger import get_logger
10
+ from quraite.schema.message import AgentMessage
11
+ from quraite.schema.response import AgentInvocationResponse
12
+ from quraite.tracing.constants import QURAITE_ADAPTER_TRACE_PREFIX, Framework
13
+ from quraite.tracing.trace import AgentSpan, AgentTrace
14
+
15
+ logger = get_logger(__name__)
16
+
17
+
18
+ class AgnoAdapter(BaseAdapter):
19
+ """
20
+ Agno adapter wrapper that converts any Agno agent or team
21
+ to a standardized callable interface (invoke) and converts the output to List[AgentMessage].
22
+
23
+ This class wraps any Agno Agent or Team and provides:
24
+ - Asynchronous invocation via ainvoke()
25
+ - Automatic conversion to List[AgentMessage] format
26
+ - Access to message history and traces
27
+ - Support for both single agents and multi-agent teams
28
+ """
29
+
30
+ def __init__(
31
+ self,
32
+ agent: Union[Agent, Team],
33
+ agent_name: str = "Agno Agent",
34
+ tracer_provider: TracerProvider = None,
35
+ ):
36
+ """
37
+ Initialize with a pre-configured Agno agent or team
38
+
39
+ Args:
40
+ agent: An Agno Agent or Team instance
41
+ agent_name: Name of the agent for trajectory metadata
42
+ tracer_provider: TracerProvider for tracing (required)
43
+ """
44
+ logger.debug("Initializing AgnoAdapter with agent_name=%s", agent_name)
45
+ self._init_tracing(tracer_provider, required=True)
46
+
47
+ self.agent: Union[Agent, Team] = agent
48
+ self.agent_name = agent_name
49
+ logger.info(
50
+ "AgnoAdapter initialized successfully (tracing_enabled=%s)",
51
+ bool(tracer_provider),
52
+ )
53
+
54
+ def _prepare_input(self, input: List[AgentMessage]) -> str:
55
+ """
56
+ Prepare input for Agno agent from List[AgentMessage].
57
+
58
+ Args:
59
+ input: List[AgentMessage] containing user_message
60
+
61
+ Returns:
62
+ str: User message text
63
+ """
64
+ logger.debug("Preparing input from %d messages", len(input))
65
+ if not input or input[-1].role != "user":
66
+ logger.error("Invalid input: no user message found")
67
+ raise ValueError("No user message found in the input")
68
+
69
+ last_user_message = input[-1]
70
+ if not last_user_message.content:
71
+ logger.error("User message has no content")
72
+ raise ValueError("User message has no content")
73
+
74
+ text_content = None
75
+ for content_item in last_user_message.content:
76
+ if content_item.type == "text" and content_item.text:
77
+ text_content = content_item.text
78
+ break
79
+
80
+ if not text_content:
81
+ logger.error("No text content found in user message")
82
+ raise ValueError("No text content found in user message")
83
+
84
+ logger.debug("Prepared input with text_content length=%d", len(text_content))
85
+ return text_content
86
+
87
+ async def ainvoke(
88
+ self,
89
+ input: List[AgentMessage],
90
+ session_id: Union[str, None] = None,
91
+ ) -> AgentInvocationResponse:
92
+ """
93
+ Asynchronous invocation method - invokes the Agno agent/team with tracing
94
+
95
+ Args:
96
+ input: List[AgentMessage] containing user_message
97
+ session_id: Optional conversation ID for maintaining context
98
+
99
+ Returns:
100
+ AgentInvocationResponse - response containing agent trace, trajectory, and final response.
101
+ """
102
+ logger.info(
103
+ "ainvoke called (session_id=%s, input_messages=%d)", session_id, len(input)
104
+ )
105
+ agent_input = self._prepare_input(input)
106
+ session_id = session_id or "default"
107
+
108
+ try:
109
+ logger.debug("Invoking Agno agent with tracing (session_id=%s)", session_id)
110
+ return await self._ainvoke_with_tracing(agent_input, session_id)
111
+
112
+ except ValueError:
113
+ logger.exception("Invalid input during ainvoke")
114
+ raise
115
+ except Exception as e:
116
+ logger.exception("Unexpected error invoking Agno agent")
117
+ raise RuntimeError(f"Error invoking Agno agent: {e}") from e
118
+
119
+ async def _ainvoke_with_tracing(
120
+ self,
121
+ agent_input: str,
122
+ session_id: str,
123
+ ) -> AgentInvocationResponse:
124
+ """Execute ainvoke with tracing enabled."""
125
+ adapter_trace_id = f"{QURAITE_ADAPTER_TRACE_PREFIX}-{uuid.uuid4()}"
126
+ logger.debug(
127
+ "Starting traced invocation (trace_id=%s, session_id=%s)",
128
+ adapter_trace_id,
129
+ session_id,
130
+ )
131
+
132
+ with self.tracer.start_as_current_span(name=adapter_trace_id):
133
+ # Run the agent/team
134
+ await self.agent.arun(agent_input, session_id=session_id)
135
+
136
+ # Get trace spans
137
+ trace_readable_spans = self.quraite_span_exporter.get_trace_by_testcase(
138
+ adapter_trace_id
139
+ )
140
+
141
+ if trace_readable_spans:
142
+ logger.info(
143
+ "Retrieved %d spans for trace_id=%s",
144
+ len(trace_readable_spans),
145
+ adapter_trace_id,
146
+ )
147
+ agent_trace = AgentTrace(
148
+ spans=[
149
+ AgentSpan.from_readable_oi_span(span)
150
+ for span in trace_readable_spans
151
+ ],
152
+ )
153
+ else:
154
+ logger.warning("No spans found for trace_id=%s", adapter_trace_id)
155
+
156
+ return AgentInvocationResponse(
157
+ agent_trace=agent_trace,
158
+ agent_trajectory=agent_trace.to_agent_trajectory(framework=Framework.AGNO),
159
+ )
@@ -0,0 +1,123 @@
1
+ from abc import ABC, abstractmethod
2
+ from typing import Any, List, Optional, Union
3
+
4
+ from opentelemetry.trace import TracerProvider
5
+
6
+ from quraite.schema.message import AgentMessage, AssistantMessage, MessageContentText
7
+ from quraite.schema.response import AgentInvocationResponse
8
+ from quraite.tracing.constants import QURAITE_TRACER_NAME
9
+ from quraite.tracing.span_exporter import QuraiteInMemorySpanExporter
10
+ from quraite.tracing.span_processor import QuraiteSimpleSpanProcessor
11
+
12
+
13
+ class BaseAdapter(ABC):
14
+ """
15
+ Abstract base class for all adapter providers.
16
+
17
+ Subclasses must implement the asynchronous adapter method,
18
+ which take List[Message] and return agent Message outputs.
19
+
20
+ Methods:
21
+ ainvoke: Asynchronously invoke an agent call for the provided input.
22
+ """
23
+
24
+ tracer_provider: Optional[TracerProvider] = None
25
+ tracer: Optional[Any] = None
26
+ quraite_span_exporter: Optional[QuraiteInMemorySpanExporter] = None
27
+
28
+ def _init_tracing(
29
+ self,
30
+ tracer_provider: Optional[TracerProvider],
31
+ required: bool = False,
32
+ ) -> None:
33
+ """
34
+ Initialize tracing components from a TracerProvider.
35
+
36
+ Args:
37
+ tracer_provider: TracerProvider for tracing
38
+ span_exporter: SpanExporter for exporting spans
39
+ required: If True, raises ValueError when tracer_provider is None
40
+ """
41
+ if tracer_provider is None:
42
+ if required:
43
+ raise ValueError(
44
+ "tracer_provider is required. "
45
+ "Please provide a TracerProvider instance."
46
+ )
47
+ return
48
+
49
+ self.tracer_provider = tracer_provider
50
+ self.tracer = tracer_provider.get_tracer(QURAITE_TRACER_NAME)
51
+
52
+ # Find Quraite span exporter
53
+ quraite_span_exporter = next(
54
+ (
55
+ processor.span_exporter
56
+ for processor in tracer_provider._active_span_processor._span_processors
57
+ if isinstance(processor, QuraiteSimpleSpanProcessor)
58
+ ),
59
+ None,
60
+ )
61
+
62
+ if quraite_span_exporter is None:
63
+ raise ValueError(
64
+ "Quraite span exporter not found. "
65
+ "Please ensure QuraiteSimpleSpanProcessor is used in the tracer provider."
66
+ )
67
+
68
+ self.quraite_span_exporter = quraite_span_exporter
69
+
70
+ @abstractmethod
71
+ async def ainvoke(
72
+ self,
73
+ input: List[AgentMessage],
74
+ session_id: Union[str, None],
75
+ ) -> AgentInvocationResponse:
76
+ """
77
+ Asynchronously invoke the agent with the given input.
78
+
79
+ Args:
80
+ input (List[AgentMessage]): List of AgentMessage objects.
81
+ session_id (str or None): ID for conversation thread/context.
82
+
83
+ Returns:
84
+ AgentInvocationResponse: Response containing agent trace, trajectory, and final response.
85
+
86
+ Raises:
87
+ NotImplementedError: If not implemented by subclass.
88
+ """
89
+ raise NotImplementedError("Not implemented")
90
+
91
+
92
+ class DummyAdapter(BaseAdapter):
93
+ """
94
+ A dummy implementation of BaseAdapter, used mainly for testing and scaffolding.
95
+ Always returns a fixed dummy response.
96
+
97
+ Methods:
98
+ ainvoke: Returns a static assistant message asynchronously.
99
+ """
100
+
101
+ async def ainvoke(
102
+ self,
103
+ input: Any,
104
+ session_id: Union[str, None],
105
+ ) -> AgentInvocationResponse:
106
+ """
107
+ Asynchronously returns a dummy assistant response.
108
+
109
+ Args:
110
+ input: Ignored.
111
+ session_id: Ignored.
112
+
113
+ Returns:
114
+ AgentInvocationResponse: Response containing agent trace, trajectory, and final response.
115
+ """
116
+
117
+ return AgentInvocationResponse(
118
+ agent_trajectory=[
119
+ AssistantMessage(
120
+ content=[MessageContentText(text="Dummy response")],
121
+ )
122
+ ]
123
+ )