kagent-adk 0.6.21__py3-none-any.whl → 0.7.0__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 kagent-adk might be problematic. Click here for more details.

kagent/adk/_a2a.py CHANGED
@@ -9,7 +9,7 @@ from a2a.server.apps import A2AFastAPIApplication
9
9
  from a2a.server.request_handlers import DefaultRequestHandler
10
10
  from a2a.server.tasks import InMemoryTaskStore
11
11
  from a2a.types import AgentCard
12
- from agentsts.adk import ADKRunner, ADKSessionService, ADKSTSIntegration, ADKTokenPropagationPlugin
12
+ from agentsts.adk import ADKSTSIntegration, ADKTokenPropagationPlugin
13
13
  from fastapi import FastAPI, Request
14
14
  from fastapi.responses import PlainTextResponse
15
15
  from google.adk.agents import BaseAgent
@@ -80,13 +80,12 @@ class KAgentApp:
80
80
  plugins = []
81
81
  if sts_well_known_uri:
82
82
  sts_integration = ADKSTSIntegration(sts_well_known_uri)
83
- session_service = ADKSessionService(sts_integration, session_service)
84
83
  plugins.append(ADKTokenPropagationPlugin(sts_integration))
85
84
 
86
85
  adk_app = App(name=self.app_name, root_agent=self.root_agent, plugins=plugins)
87
86
 
88
87
  def create_runner() -> Runner:
89
- return ADKRunner(
88
+ return Runner(
90
89
  app=adk_app,
91
90
  session_service=session_service,
92
91
  )
@@ -21,6 +21,7 @@ from a2a.types import (
21
21
  TaskStatusUpdateEvent,
22
22
  TextPart,
23
23
  )
24
+ from google.adk.events import Event, EventActions
24
25
  from google.adk.runners import Runner
25
26
  from google.adk.utils.context_utils import Aclosing
26
27
  from opentelemetry import trace
@@ -156,12 +157,23 @@ class A2aAgentExecutor(AgentExecutor):
156
157
  # Convert the a2a request to ADK run args
157
158
  run_args = convert_a2a_request_to_adk_run_args(context)
158
159
 
160
+ # ensure the session exists
161
+ session = await self._prepare_session(context, run_args, runner)
162
+
159
163
  # set request headers to session state
160
164
  headers = context.call_context.state.get("headers", {})
161
- run_args["headers"] = headers
165
+ state_changes = {
166
+ "headers": headers,
167
+ }
168
+
169
+ actions_with_update = EventActions(state_delta=state_changes)
170
+ system_event = Event(
171
+ invocation_id="header_update",
172
+ author="system",
173
+ actions=actions_with_update,
174
+ )
162
175
 
163
- # ensure the session exists
164
- session = await self._prepare_session(context, run_args, runner)
176
+ await runner.session_service.append_event(session, system_event)
165
177
 
166
178
  current_span = trace.get_current_span()
167
179
  if run_args["user_id"]:
@@ -259,6 +271,7 @@ class A2aAgentExecutor(AgentExecutor):
259
271
  user_id=user_id,
260
272
  session_id=session_id,
261
273
  )
274
+
262
275
  if session is None:
263
276
  # Extract session name from the first TextPart (like the UI does)
264
277
  session_name = None
@@ -108,13 +108,18 @@ class KAgentSessionService(BaseSessionService):
108
108
  events.append(Event.model_validate_json(event_data["data"]))
109
109
 
110
110
  # Convert to ADK Session format
111
- return Session(
111
+ session = Session(
112
112
  id=session_data["id"],
113
113
  user_id=session_data["user_id"],
114
114
  events=events,
115
115
  app_name=app_name,
116
- state={}, # TODO: restore State
116
+ state={},
117
117
  )
118
+
119
+ for event in events:
120
+ await super().append_event(session, event)
121
+
122
+ return session
118
123
  except httpx.HTTPStatusError as e:
119
124
  if e.response.status_code == 404:
120
125
  return None
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kagent-adk
3
- Version: 0.6.21
3
+ Version: 0.7.0
4
4
  Summary: kagent-adk is an sdk for integrating adk agents with kagent
5
5
  Requires-Python: >=3.11.0
6
6
  Requires-Dist: a2a-sdk>=0.3.1
7
- Requires-Dist: agentsts-adk>=0.0.5
8
- Requires-Dist: agentsts-core>=0.0.5
7
+ Requires-Dist: agentsts-adk>=0.0.6
8
+ Requires-Dist: agentsts-core>=0.0.6
9
9
  Requires-Dist: aiofiles>=24.1.0
10
10
  Requires-Dist: anthropic[vertex]>=0.49.0
11
11
  Requires-Dist: anyio>=4.9.0
12
12
  Requires-Dist: fastapi>=0.115.1
13
- Requires-Dist: google-adk>=1.11.0
13
+ Requires-Dist: google-adk>=1.16.0
14
14
  Requires-Dist: google-auth>=2.40.2
15
15
  Requires-Dist: google-genai>=1.21.1
16
16
  Requires-Dist: httpx>=0.25.0
@@ -1,7 +1,7 @@
1
1
  kagent/adk/__init__.py,sha256=Cam9hwhl6Z1tZ3WJIB1KATX24MwRMpiyBLYF64DTqQI,182
2
- kagent/adk/_a2a.py,sha256=B1ZiVFJHNJyJ_6HsCbAG5w5-wF9xrNKhr3-ok9CCick,6424
3
- kagent/adk/_agent_executor.py,sha256=3aFMR41FwluDZZJGkpsL4yhz7JgqTTSbKtLeENrr0TE,11090
4
- kagent/adk/_session_service.py,sha256=7o2T4-572hAvpD3KZQn1ExPvI67aEuLcyHqQXB3b2JI,5757
2
+ kagent/adk/_a2a.py,sha256=oSpj5fAzPPA_KP5fTNLUpFSQ2J28tLXrTCBpQSNCjq0,6309
3
+ kagent/adk/_agent_executor.py,sha256=U_ZxJhaGyn-FPxvoNn7L5ZQComZ-vfFG9TdCWRLoTm8,11469
4
+ kagent/adk/_session_service.py,sha256=6kwFS4FF10HlUyyCV2SgwxqKIJ47s0ZZ8KW-iIRDyec,5858
5
5
  kagent/adk/_token.py,sha256=OL46m7U5vUTby1WWjVB7Jqzig4TWddzoAmLVLlfSdAg,2515
6
6
  kagent/adk/cli.py,sha256=_yluK6p7sbUld5juWCyIu3E8U1_Zys7eWxBabcHXXIo,3251
7
7
  kagent/adk/types.py,sha256=kcNpRwo6XcfMtgsOchgDuslYjMY-7pSlVnglihoUKss,5685
@@ -12,7 +12,7 @@ kagent/adk/converters/part_converter.py,sha256=8Ej9xGRYW8YoPnExGDnEUw1beurCfkNhA
12
12
  kagent/adk/converters/request_converter.py,sha256=iTmTmhlnyRfuYyFi4WmpTSXPz22xjjotbe750j-CvYA,1072
13
13
  kagent/adk/models/__init__.py,sha256=mqD0JhS9kT1rMpFNLq5-qnjstpp6lzT9xADaOfjrUKY,78
14
14
  kagent/adk/models/_openai.py,sha256=EpZTqxAEaKhgi-98sqyQhArckWwoGh-C34fC8MyClHk,17187
15
- kagent_adk-0.6.21.dist-info/METADATA,sha256=oPN2egxeoRZpz_hOoBSH1f8GgDSjRbe6pczg3UhfiSc,1014
16
- kagent_adk-0.6.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
- kagent_adk-0.6.21.dist-info/entry_points.txt,sha256=a1Q2Inc9L0dvXWEkwnCdf9cfXdpX5Dl2Q6DhNWNjhxw,50
18
- kagent_adk-0.6.21.dist-info/RECORD,,
15
+ kagent_adk-0.7.0.dist-info/METADATA,sha256=hnbBr2v7iGKlmQq2KRpZcGt1ZWNr0yrMxighe_3a4gk,1013
16
+ kagent_adk-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ kagent_adk-0.7.0.dist-info/entry_points.txt,sha256=a1Q2Inc9L0dvXWEkwnCdf9cfXdpX5Dl2Q6DhNWNjhxw,50
18
+ kagent_adk-0.7.0.dist-info/RECORD,,