kagent-adk 0.6.12__tar.gz → 0.6.15__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.
Potentially problematic release.
This version of kagent-adk might be problematic. Click here for more details.
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/PKG-INFO +1 -1
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/pyproject.toml +1 -1
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/_session_service.py +0 -4
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/models/_openai.py +1 -1
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/types.py +24 -11
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/.gitignore +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/.python-version +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/README.md +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/__init__.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/_a2a.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/_agent_executor.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/_token.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/cli.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/converters/__init__.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/converters/error_mappings.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/converters/event_converter.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/converters/part_converter.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/converters/request_converter.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/src/kagent/adk/models/__init__.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/tests/__init__.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/tests/unittests/__init__.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/tests/unittests/converters/__init__.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/tests/unittests/converters/test_event_converter.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/tests/unittests/models/__init__.py +0 -0
- {kagent_adk-0.6.12 → kagent_adk-0.6.15}/tests/unittests/models/test_openai.py +0 -0
|
@@ -24,10 +24,6 @@ class KAgentSessionService(BaseSessionService):
|
|
|
24
24
|
super().__init__()
|
|
25
25
|
self.client = client
|
|
26
26
|
|
|
27
|
-
async def _get_user_id(self) -> str:
|
|
28
|
-
"""Get the default user ID. Override this method to implement custom user ID logic."""
|
|
29
|
-
return "admin@kagent.dev"
|
|
30
|
-
|
|
31
27
|
@override
|
|
32
28
|
async def create_session(
|
|
33
29
|
self,
|
|
@@ -395,7 +395,7 @@ class AzureOpenAI(BaseOpenAI):
|
|
|
395
395
|
@cached_property
|
|
396
396
|
def _client(self) -> AsyncAzureOpenAI:
|
|
397
397
|
"""Get the Azure OpenAI client."""
|
|
398
|
-
api_version = self.api_version or os.environ.get("
|
|
398
|
+
api_version = self.api_version or os.environ.get("OPENAI_API_VERSION", "2024-02-15-preview")
|
|
399
399
|
azure_endpoint = self.azure_endpoint or os.environ.get("AZURE_OPENAI_ENDPOINT")
|
|
400
400
|
api_key = self.api_key or os.environ.get("AZURE_OPENAI_API_KEY")
|
|
401
401
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import httpx
|
|
1
2
|
import logging
|
|
2
|
-
|
|
3
|
+
|
|
4
|
+
from typing import Literal, Any, Union
|
|
3
5
|
|
|
4
6
|
from google.adk.agents import Agent
|
|
5
7
|
from google.adk.agents.base_agent import BaseAgent
|
|
6
8
|
from google.adk.agents.llm_agent import ToolUnion
|
|
7
|
-
from google.adk.agents.remote_a2a_agent import AGENT_CARD_WELL_KNOWN_PATH, RemoteA2aAgent
|
|
9
|
+
from google.adk.agents.remote_a2a_agent import AGENT_CARD_WELL_KNOWN_PATH, DEFAULT_TIMEOUT, RemoteA2aAgent
|
|
8
10
|
from google.adk.models.anthropic_llm import Claude as ClaudeLLM
|
|
9
11
|
from google.adk.models.google_llm import Gemini as GeminiLLM
|
|
10
12
|
from google.adk.models.lite_llm import LiteLlm
|
|
@@ -31,6 +33,8 @@ class SseMcpServerConfig(BaseModel):
|
|
|
31
33
|
class RemoteAgentConfig(BaseModel):
|
|
32
34
|
name: str
|
|
33
35
|
url: str
|
|
36
|
+
headers: dict[str, Any] | None = None
|
|
37
|
+
timeout: float = DEFAULT_TIMEOUT
|
|
34
38
|
description: str = ""
|
|
35
39
|
|
|
36
40
|
|
|
@@ -77,29 +81,38 @@ class AgentConfig(BaseModel):
|
|
|
77
81
|
)
|
|
78
82
|
description: str
|
|
79
83
|
instruction: str
|
|
80
|
-
http_tools: list[HttpMcpServerConfig] | None = None #
|
|
81
|
-
sse_tools: list[SseMcpServerConfig] | None = None #
|
|
84
|
+
http_tools: list[HttpMcpServerConfig] | None = None # Streamable HTTP MCP tools
|
|
85
|
+
sse_tools: list[SseMcpServerConfig] | None = None # SSE MCP tools
|
|
82
86
|
remote_agents: list[RemoteAgentConfig] | None = None # remote agents
|
|
83
87
|
|
|
84
88
|
def to_agent(self, name: str) -> Agent:
|
|
85
89
|
if name is None or not str(name).strip():
|
|
86
90
|
raise ValueError("Agent name must be a non-empty string.")
|
|
87
|
-
|
|
91
|
+
tools: list[ToolUnion] = []
|
|
88
92
|
if self.http_tools:
|
|
89
93
|
for http_tool in self.http_tools: # add http tools
|
|
90
|
-
|
|
94
|
+
tools.append(MCPToolset(connection_params=http_tool.params, tool_filter=http_tool.tools))
|
|
91
95
|
if self.sse_tools:
|
|
92
96
|
for sse_tool in self.sse_tools: # add stdio tools
|
|
93
|
-
|
|
97
|
+
tools.append(MCPToolset(connection_params=sse_tool.params, tool_filter=sse_tool.tools))
|
|
94
98
|
if self.remote_agents:
|
|
95
99
|
for remote_agent in self.remote_agents: # Add remote agents as tools
|
|
96
|
-
|
|
100
|
+
client = None
|
|
101
|
+
|
|
102
|
+
if remote_agent.headers:
|
|
103
|
+
client = httpx.AsyncClient(
|
|
104
|
+
headers=remote_agent.headers, timeout=httpx.Timeout(timeout=remote_agent.timeout)
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
remote_a2a_agent = RemoteA2aAgent(
|
|
97
108
|
name=remote_agent.name,
|
|
98
109
|
agent_card=f"{remote_agent.url}/{AGENT_CARD_WELL_KNOWN_PATH}",
|
|
99
110
|
description=remote_agent.description,
|
|
111
|
+
httpx_client=client,
|
|
100
112
|
)
|
|
101
|
-
|
|
102
|
-
|
|
113
|
+
|
|
114
|
+
tools.append(
|
|
115
|
+
AgentTool(agent=remote_a2a_agent, skip_summarization=True)
|
|
103
116
|
) # Get headers from model config
|
|
104
117
|
|
|
105
118
|
extra_headers = self.model.headers or {}
|
|
@@ -127,5 +140,5 @@ class AgentConfig(BaseModel):
|
|
|
127
140
|
model=model,
|
|
128
141
|
description=self.description,
|
|
129
142
|
instruction=self.instruction,
|
|
130
|
-
tools=
|
|
143
|
+
tools=tools,
|
|
131
144
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|