Agent Executor (AX) is Google's open agentic orchestration runtime
Go
Remove AgentService (#186)
Jaana Dogan6d3a5f1798a6
diff --git a/Makefile b/Makefileindex 2808b86..576da57 100644--- a/Makefile+++ b/Makefile@@ -11,8 +11,6 @@ build:@echo "Building ax..."@mkdir -p bin@go build -o bin/ax ./cmd/ax- @echo "Building remote agent example..."- @go build -o bin/remote_agent ./examples/remote_agent@echo "Build complete!"diff --git a/README.md b/README.mdindex 4c56c46..dccf746 100644--- a/README.md+++ b/README.md@@ -47,13 +47,11 @@ graph LRClientRouter["Router"]Controller["AX Controller<br/>(executor, event log, registry)"]- RemoteAgent["Agent<br/>(isolated actor)"]Tool["Tool<br/>(MCP server)"]Env["Environment with<br/>skills, built-in tools<br/>(isolated actor)"]Client -->|resumable stream| RouterRouter --> Controller- Controller <-->|resumable stream| RemoteAgentController --> EnvController --> Tool```@@ -157,42 +155,6 @@ ax exec \--resume```-### 2. Execute with Custom Agents--Most developers want to build their own agents. AX allows running custom agents as remote-or sandbox agents. See [Custom Agents](#custom-agents) for a full list of supported agents.--This example demonstrates how the AX server executes remote agents-through the `AgentService.Connect` RPC.--**Terminal 1** - Start the remote agent server:-```bash-go run examples/remote_agent/main.go-```-The remote agent runs as a gRPC server implementing `AgentService` on port `:50051`.--**Terminal 2** - Start the AX controller server:-```bash-# Ensure the agent is registered as a remote agent in ax.yaml.-cat ax.yaml-# ...-registry:- remote_agents:- - id: "lowercase"- name: "Lowercase Agent"- description: "Converts text to lowercase."- address: "localhost:50051"--ax serve-```-The server exposes the service on port `:8494` by default.--**Terminal 3** - Register the remote agent and execute:-```bash-ax exec \- --server localhost:8494 \- --input "HELLO, CAN YOU LOWERCASE WHAT I JUST SAID?"-```## Usage@@ -264,12 +226,6 @@ planner:timeout: "60s"skills_dir: "./examples/skills"-registry:- remote_agents:- - id: "medical-deep-researcher"- name: "Medical Deep Researcher"- description: "Performs deep medical research using various resources like pubmed and clinicaltrials.gov"- address: "localhost:50051"```Example:@@ -319,29 +275,12 @@ adapts to the user's operating system.For safety and control, any execution initiated by the bash toolrequires explicit user approval via a confirmation flow before running.-### Custom Agents--AX supports multiple ways to bring your own agents into the runtime.--#### Remote agents--Remote agents run outside the AX controller and are-invoked over a protocol boundary.--- [Remote Agent](examples/remote_agent) implements AX's native `AgentService` directly.-- [ADK Agent (Python)](examples/adk_agent) runs a Google ADK agent as a remote agent.--Please note that AX is actively developing its resumable streaming and agent communication protocols; these interfaces will change before a stable release.--If you are implementing an AX-native remote agent, see `AgentService` in `proto/ax.proto`.## What AX is NOT?* A managed service. AX is self-hosted and not a managed service.We aim to make it easy for users to deploy and operate it ontheir Kubernetes clusters.* An agentic framework. AX is agnostic of the framework used to build agents.- We are working with other framework authors (e.g., [ADK](examples/adk_agent))- to provide easy integration with them.* A specific harness like a specific coding agent, e.g. Antigravity.AX provides the serving layer around harnesses and is agnostic of theharness implementation. Soon, we will allow users to bring their owndiff --git a/examples/adk_agent/README.md b/examples/adk_agent/README.mddeleted file mode 100644index 2064bca..0000000--- a/examples/adk_agent/README.md+++ /dev/null@@ -1,5 +0,0 @@-# ADK Agent Example--This directory contains an example of an ADK agent.--For instructions on how to use this agent with the `ADKAgentServicer` and start running it as a server, please refer to the documentation in the [python/adk](../../python/adk/README.md) directory.diff --git a/examples/adk_agent/__init__.py b/examples/adk_agent/__init__.pydeleted file mode 100644index 58d482e..0000000--- a/examples/adk_agent/__init__.py+++ /dev/null@@ -1,13 +0,0 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.diff --git a/examples/adk_agent/agent.py b/examples/adk_agent/agent.pydeleted file mode 100644index 7f27ab1..0000000--- a/examples/adk_agent/agent.py+++ /dev/null@@ -1,59 +0,0 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.--from google.adk.agents import Agent--def get_weather(city: str) -> dict:- """Retrieves the current weather report for a specified city.-- Args:- city (str): The name of the city for which to retrieve the weather report.-- Returns:- dict: status and result or error msg.- """- if "new york" in city.lower() or "nyc" in city.lower():- return {- "status": "success",- "report": (- "The weather in New York is sunny with a temperature of 25 degrees"- " Celsius (77 degrees Fahrenheit)."- ),- }- elif "san francisco" in city.lower() or "sf" in city.lower():- return {- "status": "success",- "report": (- "The weather in San Francisco is foggy with a temperature of 16 degrees"- " Celsius (60.8 degrees Fahrenheit)."- ),- }- else:- return {- "status": "error",- "error_message": f"Weather information for '{city}' is not available.",- }---root_agent = Agent(- name="weather_agent",- model="gemini-3.5-flash",- description=(- "Agent to answer questions about the weather in a city."- ),- instruction=(- "You are a helpful agent who can answer user questions about the weather in a city."- ),- tools=[get_weather],-)diff --git a/examples/remote_agent/README.md b/examples/remote_agent/README.mddeleted file mode 100644index a434518..0000000--- a/examples/remote_agent/README.md+++ /dev/null@@ -1,14 +0,0 @@-# Remote Agent--Remote agents run as gRPC servers implementing the `AXAgentService` interface defined in `proto/ax.proto`. The controller executes remote agents by calling their `Connect` RPC with bidirectional streaming.--See `examples/remote_agent/main.go` for a complete implementation.--**Workflow:**-1. Remote agent starts as gRPC server on a port (e.g., :50051)-2. Declare the remote agent in `ax.yaml` under `registry.remote_agents`-3. Start the server: `ax serve`-4. When the server executes, it calls the agent's `Connect` RPC-5. AX streams input content → Agent processes → Agent streams output back--See `examples/remote_agent/main.go` for a complete implementation.diff --git a/examples/remote_agent/main.go b/examples/remote_agent/main.godeleted file mode 100644index ece1d37..0000000--- a/examples/remote_agent/main.go+++ /dev/null@@ -1,121 +0,0 @@-// Copyright 2026 Google LLC-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-// http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--package main--import (- "context"- "errors"- "fmt"- "log"- "net"- "strings"-- "google.golang.org/grpc"-- "github.com/google/ax/proto"-)--const port = ":50051"--// server implements the AgentService gRPC server.-type server struct {- proto.UnimplementedAgentServiceServer-}--// Connect implements server streaming for agent processing.-// This RPC is called by the controller when a session triggers this agent.-func (s *server) Connect(req *proto.AgentRequest, stream grpc.ServerStreamingServer[proto.AgentResponse]) error {- start := req.GetStart()- if start == nil {- return errors.New("start is required")- }-- var messages []*proto.Message- for _, input := range start.Messages {- textContent := input.GetContent().GetText()- if textContent == nil {- continue- }- messages = append(messages, input)- }- if len(messages) == 0 {- return errors.New("no text inputs, cannot uppercase")- }-- // We don't need to uppercase the whole history.- // Only uppercase the last text message.- lastMsg := messages[len(messages)-1]- responseMsg := &proto.Message{- Role: "assistant",- Content: &proto.Content{- Type: &proto.Content_Text{- Text: &proto.TextContent{- Text: strings.ToLower(lastMsg.GetContent().GetText().Text),- },- },- },- }-- if err := stream.Send(&proto.AgentResponse{- ConversationId: req.ConversationId,- ExecId: req.ExecId,- Type: &proto.AgentResponse_Outputs{- Outputs: &proto.AgentOutputs{- Messages: []*proto.Message{responseMsg},- },- },- }); err != nil {- return err- }-- // Send AgentEnd to signal end of outputs.- if err := stream.Send(&proto.AgentResponse{- ConversationId: req.ConversationId,- ExecId: req.ExecId,- Type: &proto.AgentResponse_End{- End: &proto.AgentEnd{},- },- }); err != nil {- return err- }-- return nil-}--// HealthCheck checks if the agent is healthy.-func (s *server) HealthCheck(ctx context.Context, req *proto.HealthCheckRequest) (*proto.HealthCheckResponse, error) {- log.Println("Health check requested")-- return &proto.HealthCheckResponse{- Healthy: true,- Message: "Agent is healthy",- }, nil-}--func main() {- fmt.Printf("Listening on port: %s\n", port)- lis, err := net.Listen("tcp", port)- if err != nil {- log.Fatalf("Failed to listen: %v", err)- }-- grpcServer := grpc.NewServer()- proto.RegisterAgentServiceServer(grpcServer, &server{})-- fmt.Println("\nAgent server is running...")- if err := grpcServer.Serve(lis); err != nil {- log.Fatalf("Failed to serve: %v", err)- }-}diff --git a/internal/agent/remote.go b/internal/agent/remote.godeleted file mode 100644index 2d72225..0000000--- a/internal/agent/remote.go+++ /dev/null@@ -1,125 +0,0 @@-// Copyright 2026 Google LLC-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-// http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--package agent--import (- "context"- "fmt"- "io"-- "google.golang.org/grpc"- "google.golang.org/grpc/credentials/insecure"- "google.golang.org/grpc/metadata"-- "github.com/google/ax/proto"-)--// RemoteAgent is a gRPC client that implements the Agent interface.-// It communicates with remote agent services over gRPC.-type RemoteAgent struct {- cfg RemoteAgentConfig-}--// RemoteAgentConfig configures a remote agent client.-type RemoteAgentConfig struct {- Address string // gRPC server address (e.g., "localhost:50051")- Reconnect bool // Whether to automatically reconnect on failures- MaxRetries int // Maximum number of retry attempts (0 = infinite)- DialOpts []grpc.DialOption // gRPC dial options for customizing the connection-}--// NewRemoteAgent creates a new remote agent client.-func NewRemoteAgent(config RemoteAgentConfig) (*RemoteAgent, error) {- if config.Address == "" {- return nil, fmt.Errorf("agent address cannot be empty")- }- return &RemoteAgent{cfg: config}, nil-}--// connect establishes a gRPC connection to the remote agent.-func (a *RemoteAgent) connect() (*grpc.ClientConn, error) {- // Use provided dial options, or default to insecure credentials- opts := a.cfg.DialOpts- if len(opts) == 0 {- opts = []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}- }-- conn, err := grpc.NewClient(a.cfg.Address, opts...)- if err != nil {- return nil, fmt.Errorf("failed to dial: %w", err)- }- return conn, nil-}--// Connect handles processing of input content with the remote agent.-func (a *RemoteAgent) Connect(ctx context.Context, conversationID string, execID string, start *proto.AgentStart, e Executor, o OutputHandler) error {- ctx = metadata.AppendToOutgoingContext(ctx, "execution-id", execID)-- conn, err := a.connect()- if err != nil {- return fmt.Errorf("failed to connect: %w", err)- }- defer conn.Close()-- client := proto.NewAgentServiceClient(conn)- stream, err := client.Connect(ctx, &proto.AgentRequest{- ConversationId: conversationID,- ExecId: execID,- Start: start,- })- if err != nil {- return fmt.Errorf("failed to create stream: %w", err)- }-- // Receive outputs and call handler for each- for {- resp, err := stream.Recv()- if err == io.EOF {- // Stream completed successfully- return nil- }- if err != nil {- return fmt.Errorf("failed to receive content: %w", err)- }-- switch msg := resp.Type.(type) {- case *proto.AgentResponse_Outputs:- if resp.ConversationId != conversationID {- return fmt.Errorf("received outputs for different conversation id: %s != %s", resp.ConversationId, conversationID)- }- if resp.ExecId != execID {- return fmt.Errorf("received outputs for different execution id: %s != %s", resp.ExecId, execID)- }- if err := o(msg.Outputs); err != nil {- return fmt.Errorf("handler error: %w", err)- }- case *proto.AgentResponse_End:- if resp.ConversationId != conversationID {- return fmt.Errorf("received end for different conversation id: %s != %s", resp.ConversationId, conversationID)- }- if resp.ExecId != execID {- return fmt.Errorf("received end for different execution id: %s != %s", resp.ExecId, execID)- }- return nil- default:- return fmt.Errorf("unknown message type: %T", msg)- }- }-}--// Close gracefully shuts down the remote agent connection.-func (a *RemoteAgent) Close() error {- return nil-}diff --git a/internal/agent/remote_test.go b/internal/agent/remote_test.godeleted file mode 100644index 07a8b84..0000000--- a/internal/agent/remote_test.go+++ /dev/null@@ -1,160 +0,0 @@-// Copyright 2026 Google LLC-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-// http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--package agent--import (- "context"- "net"- "sync"- "testing"-- "google.golang.org/grpc"- "google.golang.org/grpc/credentials/insecure"-- "github.com/google/ax/proto"-)--type mockAgentServiceServer struct {- proto.UnimplementedAgentServiceServer- mu sync.Mutex- lastReq *proto.AgentRequest- response []*proto.AgentResponse-}--func (s *mockAgentServiceServer) Connect(req *proto.AgentRequest, stream grpc.ServerStreamingServer[proto.AgentResponse]) error {- s.mu.Lock()- s.lastReq = req- s.mu.Unlock()-- for _, resp := range s.response {- if err := stream.Send(resp); err != nil {- return err- }- }- return nil-}--func TestRemoteAgent_Connect(t *testing.T) {- lis, err := net.Listen("tcp", "localhost:0")- if err != nil {- t.Fatalf("failed to listen: %v", err)- }- defer lis.Close()-- srv := grpc.NewServer()- defer srv.Stop()-- mockServer := &mockAgentServiceServer{- response: []*proto.AgentResponse{- {- ConversationId: "conv-1",- ExecId: "exec-1",- Type: &proto.AgentResponse_Outputs{- Outputs: &proto.AgentOutputs{- Messages: []*proto.Message{- {- Role: "assistant",- Content: &proto.Content{- Type: &proto.Content_Text{- Text: &proto.TextContent{Text: "Response line 1"},- },- },- },- },- },- },- },- {- ConversationId: "conv-1",- ExecId: "exec-1",- Type: &proto.AgentResponse_End{- End: &proto.AgentEnd{},- },- },- },- }- proto.RegisterAgentServiceServer(srv, mockServer)-- go func() {- if err := srv.Serve(lis); err != nil && err != grpc.ErrServerStopped {- t.Errorf("failed to serve: %v", err)- }- }()-- addr := lis.Addr().String()- remoteAgent, err := NewRemoteAgent(RemoteAgentConfig{- Address: addr,- DialOpts: []grpc.DialOption{- grpc.WithTransportCredentials(insecure.NewCredentials()),- },- })- if err != nil {- t.Fatalf("failed to create remote agent: %v", err)- }- defer remoteAgent.Close()-- var outputs []*proto.AgentOutputs- outputHandler := func(outgoing *proto.AgentOutputs) error {- outputs = append(outputs, outgoing)- return nil- }-- start := &proto.AgentStart{- AgentId: "test-agent",- Messages: []*proto.Message{- {- Role: "user",- Content: &proto.Content{- Type: &proto.Content_Text{- Text: &proto.TextContent{Text: "Request text"},- },- },- },- },- }-- err = remoteAgent.Connect(context.Background(), "conv-1", "exec-1", start, nil, outputHandler)- if err != nil {- t.Fatalf("RemoteAgent.Connect failed: %v", err)- }-- mockServer.mu.Lock()- lastReq := mockServer.lastReq- mockServer.mu.Unlock()-- if lastReq == nil {- t.Fatal("server did not receive request")- }- if lastReq.ConversationId != "conv-1" {- t.Errorf("expected conversation ID 'conv-1', got %q", lastReq.ConversationId)- }- if lastReq.ExecId != "exec-1" {- t.Errorf("expected exec ID 'exec-1', got %q", lastReq.ExecId)- }- if lastReq.Start.AgentId != "test-agent" {- t.Errorf("expected agent ID 'test-agent', got %q", lastReq.Start.AgentId)- }-- if len(outputs) != 1 {- t.Fatalf("expected exactly 1 output from handler, got %d", len(outputs))- }- if len(outputs[0].Messages) != 1 {- t.Fatalf("expected exactly 1 message in outputs, got %d", len(outputs[0].Messages))- }- gotText := outputs[0].Messages[0].GetContent().GetText().GetText()- if gotText != "Response line 1" {- t.Errorf("expected response text 'Response line 1', got %q", gotText)- }-}diff --git a/proto/ax.pb.go b/proto/ax.pb.goindex 5d10b47..4819b1b 100644--- a/proto/ax.pb.go+++ b/proto/ax.pb.go@@ -15,7 +15,7 @@// Code generated by protoc-gen-go. DO NOT EDIT.// versions:// protoc-gen-go v1.36.11-// protoc v5.28.2+// protoc v7.34.1// source: proto/ax.protopackage proto@@ -1372,10 +1372,7 @@ const file_proto_ax_proto_rawDesc = "" +"\x19CANCEL_REASON_UNSPECIFIED\x10\x00\x12 \n" +"\x1cCANCEL_REASON_USER_REQUESTED\x10\x01\x12\x19\n" +"\x15CANCEL_REASON_TIMEOUT\x10\x02\x12 \n" +- "\x1cCANCEL_REASON_INTERNAL_ERROR\x10\x032\x80\x01\n" +- "\fAgentService\x120\n" +- "\aConnect\x12\x10.ax.AgentRequest\x1a\x11.ax.AgentResponse0\x01\x12>\n" +- "\vHealthCheck\x12\x16.ax.HealthCheckRequest\x1a\x17.ax.HealthCheckResponse2H\n" ++ "\x1cCANCEL_REASON_INTERNAL_ERROR\x10\x032H\n" +"\x0eHarnessService\x126\n" +"\aConnect\x12\x12.ax.HarnessRequest\x1a\x13.ax.HarnessResponse(\x010\x012@\n" +"\x11ControllerService\x12+\n" +@@ -1440,18 +1437,14 @@ var file_proto_ax_proto_depIdxs = []int32{15, // 15: ax.HarnessResponse.end:type_name -> ax.HarnessEnd7, // 16: ax.ExecRequest.inputs:type_name -> ax.Message7, // 17: ax.ExecResponse.outputs:type_name -> ax.Message- 5, // 18: ax.AgentService.Connect:input_type -> ax.AgentRequest- 9, // 19: ax.AgentService.HealthCheck:input_type -> ax.HealthCheckRequest- 13, // 20: ax.HarnessService.Connect:input_type -> ax.HarnessRequest- 17, // 21: ax.ControllerService.Exec:input_type -> ax.ExecRequest- 19, // 22: ax.ConversationService.DeleteConversation:input_type -> ax.DeleteConversationRequest- 6, // 23: ax.AgentService.Connect:output_type -> ax.AgentResponse- 10, // 24: ax.AgentService.HealthCheck:output_type -> ax.HealthCheckResponse- 16, // 25: ax.HarnessService.Connect:output_type -> ax.HarnessResponse- 18, // 26: ax.ControllerService.Exec:output_type -> ax.ExecResponse- 20, // 27: ax.ConversationService.DeleteConversation:output_type -> ax.DeleteConversationResponse- 23, // [23:28] is the sub-list for method output_type- 18, // [18:23] is the sub-list for method input_type+ 13, // 18: ax.HarnessService.Connect:input_type -> ax.HarnessRequest+ 17, // 19: ax.ControllerService.Exec:input_type -> ax.ExecRequest+ 19, // 20: ax.ConversationService.DeleteConversation:input_type -> ax.DeleteConversationRequest+ 16, // 21: ax.HarnessService.Connect:output_type -> ax.HarnessResponse+ 18, // 22: ax.ControllerService.Exec:output_type -> ax.ExecResponse+ 20, // 23: ax.ConversationService.DeleteConversation:output_type -> ax.DeleteConversationResponse+ 21, // [21:24] is the sub-list for method output_type+ 18, // [18:21] is the sub-list for method input_type18, // [18:18] is the sub-list for extension type_name18, // [18:18] is the sub-list for extension extendee0, // [0:18] is the sub-list for field type_name@@ -1483,7 +1476,7 @@ func file_proto_ax_proto_init() {NumEnums: 2,NumMessages: 19,NumExtensions: 0,- NumServices: 4,+ NumServices: 3,},GoTypes: file_proto_ax_proto_goTypes,DependencyIndexes: file_proto_ax_proto_depIdxs,diff --git a/proto/ax.proto b/proto/ax.protoindex 57d6688..4e40893 100644--- a/proto/ax.proto+++ b/proto/ax.proto@@ -83,20 +83,6 @@ message HealthCheckResponse {string message = 2;}-// AgentService defines the gRPC service for agent communication.-// This protocol enables a bidirectional communication between the-// controller and the agent. Agents can start new agentic calls via-// the controller within the same execution boundary by using the channel.-//-// WARNING: There will be significant changes to this protocol as-// we are solidifying resumption on the wire.-service AgentService {- // Connect is used by agents to connect to the controller.- rpc Connect(AgentRequest) returns (stream AgentResponse);-- // HealthCheck checks if the agent is healthy and responsive- rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse);-}message HarnessStart {// Per-execution harness configuration.diff --git a/proto/ax_grpc.pb.go b/proto/ax_grpc.pb.goindex fca5623..36ab2a5 100644--- a/proto/ax_grpc.pb.go+++ b/proto/ax_grpc.pb.go@@ -14,8 +14,8 @@// Code generated by protoc-gen-go-grpc. DO NOT EDIT.// versions:-// - protoc-gen-go-grpc v1.5.1-// - protoc v5.28.2+// - protoc-gen-go-grpc v1.6.0+// - protoc v7.34.1// source: proto/ax.protopackage proto@@ -32,170 +32,6 @@ import (// Requires gRPC-Go v1.64.0 or later.const _ = grpc.SupportPackageIsVersion9-const (- AgentService_Connect_FullMethodName = "/ax.AgentService/Connect"- AgentService_HealthCheck_FullMethodName = "/ax.AgentService/HealthCheck"-)--// AgentServiceClient is the client API for AgentService service.-//-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.-//-// AgentService defines the gRPC service for agent communication.-// This protocol enables a bidirectional communication between the-// controller and the agent. Agents can start new agentic calls via-// the controller within the same execution boundary by using the channel.-//-// WARNING: There will be significant changes to this protocol as-// we are solidifying resumption on the wire.-type AgentServiceClient interface {- // Connect is used by agents to connect to the controller.- Connect(ctx context.Context, in *AgentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[AgentResponse], error)- // HealthCheck checks if the agent is healthy and responsive- HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)-}--type agentServiceClient struct {- cc grpc.ClientConnInterface-}--func NewAgentServiceClient(cc grpc.ClientConnInterface) AgentServiceClient {- return &agentServiceClient{cc}-}--func (c *agentServiceClient) Connect(ctx context.Context, in *AgentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[AgentResponse], error) {- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)- stream, err := c.cc.NewStream(ctx, &AgentService_ServiceDesc.Streams[0], AgentService_Connect_FullMethodName, cOpts...)- if err != nil {- return nil, err- }- x := &grpc.GenericClientStream[AgentRequest, AgentResponse]{ClientStream: stream}- if err := x.ClientStream.SendMsg(in); err != nil {- return nil, err- }- if err := x.ClientStream.CloseSend(); err != nil {- return nil, err- }- return x, nil-}--// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.-type AgentService_ConnectClient = grpc.ServerStreamingClient[AgentResponse]--func (c *agentServiceClient) HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)- out := new(HealthCheckResponse)- err := c.cc.Invoke(ctx, AgentService_HealthCheck_FullMethodName, in, out, cOpts...)- if err != nil {- return nil, err- }- return out, nil-}--// AgentServiceServer is the server API for AgentService service.-// All implementations must embed UnimplementedAgentServiceServer-// for forward compatibility.-//-// AgentService defines the gRPC service for agent communication.-// This protocol enables a bidirectional communication between the-// controller and the agent. Agents can start new agentic calls via-// the controller within the same execution boundary by using the channel.-//-// WARNING: There will be significant changes to this protocol as-// we are solidifying resumption on the wire.-type AgentServiceServer interface {- // Connect is used by agents to connect to the controller.- Connect(*AgentRequest, grpc.ServerStreamingServer[AgentResponse]) error- // HealthCheck checks if the agent is healthy and responsive- HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)- mustEmbedUnimplementedAgentServiceServer()-}--// UnimplementedAgentServiceServer must be embedded to have-// forward compatible implementations.-//-// NOTE: this should be embedded by value instead of pointer to avoid a nil-// pointer dereference when methods are called.-type UnimplementedAgentServiceServer struct{}--func (UnimplementedAgentServiceServer) Connect(*AgentRequest, grpc.ServerStreamingServer[AgentResponse]) error {- return status.Errorf(codes.Unimplemented, "method Connect not implemented")-}-func (UnimplementedAgentServiceServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {- return nil, status.Errorf(codes.Unimplemented, "method HealthCheck not implemented")-}-func (UnimplementedAgentServiceServer) mustEmbedUnimplementedAgentServiceServer() {}-func (UnimplementedAgentServiceServer) testEmbeddedByValue() {}--// UnsafeAgentServiceServer may be embedded to opt out of forward compatibility for this service.-// Use of this interface is not recommended, as added methods to AgentServiceServer will-// result in compilation errors.-type UnsafeAgentServiceServer interface {- mustEmbedUnimplementedAgentServiceServer()-}--func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer) {- // If the following call pancis, it indicates UnimplementedAgentServiceServer was- // embedded by pointer and is nil. This will cause panics if an- // unimplemented method is ever invoked, so we test this at initialization- // time to prevent it from happening at runtime later due to I/O.- if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {- t.testEmbeddedByValue()- }- s.RegisterService(&AgentService_ServiceDesc, srv)-}--func _AgentService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {- m := new(AgentRequest)- if err := stream.RecvMsg(m); err != nil {- return err- }- return srv.(AgentServiceServer).Connect(m, &grpc.GenericServerStream[AgentRequest, AgentResponse]{ServerStream: stream})-}--// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.-type AgentService_ConnectServer = grpc.ServerStreamingServer[AgentResponse]--func _AgentService_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {- in := new(HealthCheckRequest)- if err := dec(in); err != nil {- return nil, err- }- if interceptor == nil {- return srv.(AgentServiceServer).HealthCheck(ctx, in)- }- info := &grpc.UnaryServerInfo{- Server: srv,- FullMethod: AgentService_HealthCheck_FullMethodName,- }- handler := func(ctx context.Context, req interface{}) (interface{}, error) {- return srv.(AgentServiceServer).HealthCheck(ctx, req.(*HealthCheckRequest))- }- return interceptor(ctx, in, info, handler)-}--// AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service.-// It's only intended for direct use with grpc.RegisterService,-// and not to be introspected or modified (even as a copy)-var AgentService_ServiceDesc = grpc.ServiceDesc{- ServiceName: "ax.AgentService",- HandlerType: (*AgentServiceServer)(nil),- Methods: []grpc.MethodDesc{- {- MethodName: "HealthCheck",- Handler: _AgentService_HealthCheck_Handler,- },- },- Streams: []grpc.StreamDesc{- {- StreamName: "Connect",- Handler: _AgentService_Connect_Handler,- ServerStreams: true,- },- },- Metadata: "proto/ax.proto",-}-const (HarnessService_Connect_FullMethodName = "/ax.HarnessService/Connect")@@ -252,7 +88,7 @@ type HarnessServiceServer interface {type UnimplementedHarnessServiceServer struct{}func (UnimplementedHarnessServiceServer) Connect(grpc.BidiStreamingServer[HarnessRequest, HarnessResponse]) error {- return status.Errorf(codes.Unimplemented, "method Connect not implemented")+ return status.Error(codes.Unimplemented, "method Connect not implemented")}func (UnimplementedHarnessServiceServer) mustEmbedUnimplementedHarnessServiceServer() {}func (UnimplementedHarnessServiceServer) testEmbeddedByValue() {}@@ -265,7 +101,7 @@ type UnsafeHarnessServiceServer interface {}func RegisterHarnessServiceServer(s grpc.ServiceRegistrar, srv HarnessServiceServer) {- // If the following call pancis, it indicates UnimplementedHarnessServiceServer was+ // If the following call panics, it indicates UnimplementedHarnessServiceServer was// embedded by pointer and is nil. This will cause panics if an// unimplemented method is ever invoked, so we test this at initialization// time to prevent it from happening at runtime later due to I/O.@@ -358,7 +194,7 @@ type ControllerServiceServer interface {type UnimplementedControllerServiceServer struct{}func (UnimplementedControllerServiceServer) Exec(*ExecRequest, grpc.ServerStreamingServer[ExecResponse]) error {- return status.Errorf(codes.Unimplemented, "method Exec not implemented")+ return status.Error(codes.Unimplemented, "method Exec not implemented")}func (UnimplementedControllerServiceServer) mustEmbedUnimplementedControllerServiceServer() {}func (UnimplementedControllerServiceServer) testEmbeddedByValue() {}@@ -371,7 +207,7 @@ type UnsafeControllerServiceServer interface {}func RegisterControllerServiceServer(s grpc.ServiceRegistrar, srv ControllerServiceServer) {- // If the following call pancis, it indicates UnimplementedControllerServiceServer was+ // If the following call panics, it indicates UnimplementedControllerServiceServer was// embedded by pointer and is nil. This will cause panics if an// unimplemented method is ever invoked, so we test this at initialization// time to prevent it from happening at runtime later due to I/O.@@ -458,7 +294,7 @@ type ConversationServiceServer interface {type UnimplementedConversationServiceServer struct{}func (UnimplementedConversationServiceServer) DeleteConversation(context.Context, *DeleteConversationRequest) (*DeleteConversationResponse, error) {- return nil, status.Errorf(codes.Unimplemented, "method DeleteConversation not implemented")+ return nil, status.Error(codes.Unimplemented, "method DeleteConversation not implemented")}func (UnimplementedConversationServiceServer) mustEmbedUnimplementedConversationServiceServer() {}func (UnimplementedConversationServiceServer) testEmbeddedByValue() {}@@ -471,7 +307,7 @@ type UnsafeConversationServiceServer interface {}func RegisterConversationServiceServer(s grpc.ServiceRegistrar, srv ConversationServiceServer) {- // If the following call pancis, it indicates UnimplementedConversationServiceServer was+ // If the following call panics, it indicates UnimplementedConversationServiceServer was// embedded by pointer and is nil. This will cause panics if an// unimplemented method is ever invoked, so we test this at initialization// time to prevent it from happening at runtime later due to I/O.diff --git a/proto/content.pb.go b/proto/content.pb.goindex 1cae4f6..807eb73 100644--- a/proto/content.pb.go+++ b/proto/content.pb.go@@ -15,7 +15,7 @@// Code generated by protoc-gen-go. DO NOT EDIT.// versions:// protoc-gen-go v1.36.11-// protoc v5.28.2+// protoc v7.34.1// source: proto/content.protopackage protodiff --git a/python/adk/README.md b/python/adk/README.mddeleted file mode 100644index 589aad1..0000000--- a/python/adk/README.md+++ /dev/null@@ -1,96 +0,0 @@-# AX ADK Agent Server Wrapper--This directory contains a Python gRPC wrapper designed to expose any [Google ADK](https://github.com/google/adk) agent as an `AgentService` compatible with the **Agent eXecutor (AX)** runtime.--The wrapper uses `grpc.aio` to run a fully asynchronous, high-performance gRPC server and processes incoming start messages independently within isolated sessions.-------## Setup Instructions--### 1. Create & Activate a Virtual Environment--It is recommended to use a Python virtual environment (`.venv`) to avoid package conflicts. From the root of the repository, run:--```bash-# Create the virtual environment-python3 -m venv .venv--# Activate the environment (Linux/macOS)-source .venv/bin/activate--# Activate the environment (Windows)-.venv\Scripts\activate-```--### 2. Install Dependencies--Install the required libraries (including `grpcio`, `google-genai`, and `google-adk`) using the provided requirements file:--```bash-pip install -r python/adk/requirements.txt-```-------## Running the Server--The server loads a target agent file dynamically. By default, it is configured to load the example ADK weather agent at `examples/adk_agent/agent.py`.--### 1. Configure API Credentials--Since the example ADK agent utilizes Gemini models, you need to supply a Gemini API key if using the example ADK agent:--```bash-export GEMINI_API_KEY="your-gemini-api-key-here"-```--### 2. Start the Server--Run the server using your Python virtual environment (from the project root):--```bash-python -m python.adk.adk_agent_server [options]-```--#### Available CLI Options:-- `--agent_file`: Path to the Python file containing your ADK `root_agent` (default: `examples/adk_agent/agent.py`)-- `--port`: Port number to bind the gRPC server to (default: `50051`)-- `--debug`: Enable debug mode to log all incoming and outgoing gRPC messages (default: `False`)--#### Examples:--```bash-# Start with default weather agent on port 50051-python -m python.adk.adk_agent_server--# Start with debug logging enabled-python -m python.adk.adk_agent_server --debug--# Start with a custom agent file on a custom port with debug mode-python -m python.adk.adk_agent_server --agent_file path/to/your_agent.py --port 50055 --debug-```--Once started, the server will print:-```-Loading agent from examples/adk_agent/agent.py...-Agent loaded successfully.-Server started on port 50051-```-------## Integrating with AX--To use your running ADK agent in an AX conversation, ensure that the agent is registered in your `ax.yaml` configuration. Example:--```yaml-registry:- remote_agents:- - id: "weather-agent"- name: "Weather agent"- description: "Agent to answer questions about the weather in a city."- address: "localhost:50051"- metadata:- version: "1.0"-```diff --git a/python/adk/__init__.py b/python/adk/__init__.pydeleted file mode 100644index 47cc7f8..0000000--- a/python/adk/__init__.py+++ /dev/null@@ -1,15 +0,0 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.--"""ADK Agent Server and utilities."""diff --git a/python/adk/adk_agent_server.py b/python/adk/adk_agent_server.pydeleted file mode 100644index 1bf4235..0000000--- a/python/adk/adk_agent_server.py+++ /dev/null@@ -1,178 +0,0 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.--import sys-import os-from concurrent import futures-import grpc-import asyncio-import importlib.util-import uuid--from python.proto import ax_pb2-from python.proto import ax_pb2_grpc-from python.proto import content_pb2-from google.adk.agents import Agent, InvocationContext-from google.adk.sessions import Session, InMemorySessionService-from google.genai import types-from google.adk.runners import Runner, Event-from .content_conversion import ax_content_to_adk_part, adk_part_to_ax_content--class ADKAgentServicer(ax_pb2_grpc.AgentServiceServicer):- def __init__(self, agent, debug=False):- self.agent = agent- self.debug = debug- self.session_service = InMemorySessionService()- self.runner = Runner(session_service=self.session_service, agent=self.agent, app_name=self.agent.name)-- async def Connect(self, request_iterator, context):- try:- async for request in request_iterator:- if self.debug:- print(f"\n{'='*80}\n[DEBUG] Incoming Request (conversation_id: {request.conversation_id}, exec_id: {request.exec_id})\n{'='*80}\n{request}\n{'-'*80}")-- # Use UUID as session id to ensure calls to ADK agents are stateless and isolated.- session = await self.session_service.create_session(app_name=self.agent.name, user_id="AX_USER", session_id=str(uuid.uuid4()))- conversation_id = request.conversation_id- exec_id = request.exec_id- if not request.HasField('start'):- raise ValueError(f"Expect start message, got: {request}")-- if not request.start.messages:- raise ValueError(f"Empty messages in start request")- messages = request.start.messages-- # Separate historical messages from the latest active query.- # Only execute/reply to the last message.- historical_messages = messages[:-1]- latest_message = messages[-1]-- # Hydrate past history into the session without executing them- for msg in historical_messages:- part = ax_content_to_adk_part(msg.content)- if not part:- print(f"[WARNING] Skipping message with unsupported content type: {msg.content}")- continue- content = types.Content(role=msg.role, parts=[part])- event = Event(- invocation_id=str(uuid.uuid4()),- author=self.agent.name,- content=content- )- await self.session_service.append_event(session, event)-- # Execute only the latest query- part = ax_content_to_adk_part(latest_message.content)- if not part:- print(f"[WARNING] Skipping message with unsupported content type: {latest_message.content}")- else:- content = types.Content(role=latest_message.role, parts=[part])- async for event in self.runner.run_async(session_id=session.id, user_id=session.user_id, new_message=content):- if event.content and event.content.parts:- for part in event.content.parts:- ax_content = adk_part_to_ax_content(part)- if ax_content:- response_msg = ax_pb2.Message(role="assistant", content=ax_content)- # Sub agents should always send back the same IDs.- yield_msg = ax_pb2.AgentMessage(- conversation_id=conversation_id,- exec_id=exec_id,- outputs=ax_pb2.AgentOutputs(messages=[response_msg])- )- if self.debug:- print(f"[DEBUG] Yielding AgentMessage Response Chunk:\n{yield_msg}\n{'-'*80}")- yield yield_msg-- # Clean up/delete the stateless session to free resources- await self.session_service.delete_session(- app_name=self.agent.name,- user_id=session.user_id,- session_id=session.id- )-- # Send End- end_msg = ax_pb2.AgentMessage(- conversation_id=conversation_id,- exec_id=exec_id,- end=ax_pb2.AgentEnd()- )- if self.debug:- print(f"[DEBUG] Sending End AgentMessage:\n{end_msg}\n{'='*80}\n")- yield end_msg- except Exception as e:- import logging- logging.exception(f"CRITICAL ERROR in Connect: {e}")- raise e-- async def HealthCheck(self, request, context):- return ax_pb2.HealthCheckResponse(healthy=True, message="ADK Agent Wrapper is healthy")--class ADKAgentServer:- def __init__(self, agent_file, port="50051", debug=False):- self.agent_file = agent_file- self.port = port- self.debug = debug- self.server = None- self.agent = None-- def load_agent(self):- print(f"Loading agent from {self.agent_file}...")- spec = importlib.util.spec_from_file_location("agent_module", self.agent_file)- if spec is None or spec.loader is None:- raise FileNotFoundError(f"Could not find or load agent file: {self.agent_file}")- agent_module = importlib.util.module_from_spec(spec)- spec.loader.exec_module(agent_module)-- self.agent = getattr(agent_module, "root_agent", None)- if not self.agent:- raise ValueError(f"No root_agent found in {self.agent_file}")- print("Agent loaded successfully.")-- async def start(self):- if not self.agent:- self.load_agent()-- self.server = grpc.aio.server()- ax_pb2_grpc.add_AgentServiceServicer_to_server(ADKAgentServicer(self.agent, debug=self.debug), self.server)- # TODO: Implement auth here and in other places in AX for a stable release.- self.server.add_insecure_port(f'[::]:{self.port}')- await self.server.start()- print(f"Server started on port {self.port}")-- async def wait_for_termination(self):- if self.server:- await self.server.wait_for_termination()-- async def stop(self, grace=None):- if self.server:- await self.server.stop(grace)--async def main():- import argparse- parser = argparse.ArgumentParser()- parser.add_argument("--agent_file", default="examples/adk_agent/agent.py")- parser.add_argument("--port", default="50051")- parser.add_argument("--debug", action="store_true", help="Log all incoming and outgoing gRPC messages")- args = parser.parse_args()-- server = ADKAgentServer(args.agent_file, args.port, debug=args.debug)- await server.start()- try:- await server.wait_for_termination()- except KeyboardInterrupt:- print("Shutting down...")- await server.stop()--if __name__ == '__main__':- asyncio.run(main())diff --git a/python/adk/adk_agent_server_test.py b/python/adk/adk_agent_server_test.pydeleted file mode 100644index 8f82bde..0000000--- a/python/adk/adk_agent_server_test.py+++ /dev/null@@ -1,265 +0,0 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.--"""-How to run these tests:--From the root directory of the project, with the virtual environment activated:- python3 -m unittest python/adk/adk_agent_server_test.py-"""---import unittest-from unittest.mock import MagicMock, AsyncMock, patch-import asyncio-import sys-import os--from python.proto import ax_pb2-from python.proto import content_pb2-from google.genai import types-from google.adk.runners import Event--from python.adk.adk_agent_server import ADKAgentServicer, ADKAgentServer---class TestADKAgentServicer(unittest.IsolatedAsyncioTestCase):- def setUp(self):- self.mock_agent = MagicMock()- self.mock_agent.name = "WeatherAgent"- self.servicer = ADKAgentServicer(self.mock_agent, debug=False)-- # Mock Session Service- self.servicer.session_service = AsyncMock()- # Mock Runner- self.servicer.runner = MagicMock()-- async def test_health_check(self):- request = MagicMock()- context = MagicMock()- response = await self.servicer.HealthCheck(request, context)- self.assertTrue(response.healthy)- self.assertEqual(response.message, "ADK Agent Wrapper is healthy")-- async def test_connect_missing_start_field(self):- # Message missing the 'start' field- request = ax_pb2.AgentMessage(- conversation_id="conv-123",- exec_id="exec-456"- )-- async def mock_iterator():- yield request-- context = MagicMock()- with self.assertRaises(ValueError) as ctx:- async for _ in self.servicer.Connect(mock_iterator(), context):- pass- self.assertIn("Expect start message", str(ctx.exception))-- async def test_connect_empty_start_messages(self):- # Message with 'start' field but empty messages list- start_req = ax_pb2.AgentStart(messages=[])- request = ax_pb2.AgentMessage(- conversation_id="conv-123",- exec_id="exec-456",- start=start_req- )-- async def mock_iterator():- yield request-- context = MagicMock()- with self.assertRaises(ValueError) as ctx:- async for _ in self.servicer.Connect(mock_iterator(), context):- pass- self.assertIn("Empty messages in start request", str(ctx.exception))-- async def test_connect_successful_flow(self):- # 1. Setup inputs: 1 history message, 1 active prompt message- hist_msg = ax_pb2.Message(- role="user",- content=content_pb2.Content(text=content_pb2.TextContent(text="Hello history"))- )- active_msg = ax_pb2.Message(- role="user",- content=content_pb2.Content(text=content_pb2.TextContent(text="What's the weather?"))- )- start_req = ax_pb2.AgentStart(messages=[hist_msg, active_msg])- request = ax_pb2.AgentMessage(- conversation_id="conv-123",- exec_id="exec-456",- start=start_req- )-- async def mock_iterator():- yield request-- # 2. Mock Session creation- mock_session = MagicMock()- mock_session.id = "session-id-789"- mock_session.user_id = "AX_USER"- self.servicer.session_service.create_session.return_value = mock_session-- # 3. Mock Runner.run_async return sequence- async def mock_run_async(session_id, user_id, new_message):- # Yield event 1- yield Event(- invocation_id="inv-0",- author="WeatherAgent",- content=types.Content(role="model", parts=[types.Part(text="The weather is ")])- )- # Yield event 2- yield Event(- invocation_id="inv-1",- author="WeatherAgent",- content=types.Content(role="model", parts=[types.Part(text="sunny!")])- )-- self.servicer.runner.run_async = mock_run_async-- # 4. Consume generator output- responses = []- context = MagicMock()- async for response in self.servicer.Connect(mock_iterator(), context):- responses.append(response)-- # 5. Assertions- # Expect 3 response messages: Response Chunk 1, Response Chunk 2, and End Message- self.assertEqual(len(responses), 3)-- # Verify Session Service calls- self.servicer.session_service.create_session.assert_called_once()- self.assertEqual(self.servicer.session_service.append_event.call_count, 1) # Hydrated 1 history message- self.servicer.session_service.delete_session.assert_called_once_with(- app_name="WeatherAgent",- user_id="AX_USER",- session_id="session-id-789"- )-- # Verify first response chunk- self.assertEqual(responses[0].conversation_id, "conv-123")- self.assertEqual(responses[0].exec_id, "exec-456")- self.assertEqual(responses[0].outputs.messages[0].content.text.text, "The weather is ")-- # Verify second response chunk- self.assertEqual(responses[1].conversation_id, "conv-123")- self.assertEqual(responses[1].exec_id, "exec-456")- self.assertEqual(responses[1].outputs.messages[0].content.text.text, "sunny!")-- # Verify final End response message- self.assertEqual(responses[2].conversation_id, "conv-123")- self.assertEqual(responses[2].exec_id, "exec-456")- self.assertTrue(responses[2].HasField("end"))-- async def test_connect_with_thought_content(self):- # 1. Setup inputs- active_msg = ax_pb2.Message(- role="user",- content=content_pb2.Content(text=content_pb2.TextContent(text="Show me your thoughts"))- )- start_req = ax_pb2.AgentStart(messages=[active_msg])- request = ax_pb2.AgentMessage(- conversation_id="conv-123",- exec_id="exec-456",- start=start_req- )-- async def mock_iterator():- yield request-- # 2. Mock Session creation- mock_session = MagicMock()- mock_session.id = "session-id-789"- mock_session.user_id = "AX_USER"- self.servicer.session_service.create_session.return_value = mock_session-- # 3. Mock Runner.run_async returning a thought part- mock_part = MagicMock()- mock_part.text = "Thinking..."- mock_part.thought = True-- mock_content = MagicMock()- mock_content.role = "model"- mock_content.parts = [mock_part]-- mock_event = MagicMock()- mock_event.invocation_id = "inv-0"- mock_event.author = "WeatherAgent"- mock_event.content = mock_content-- async def mock_run_async(session_id, user_id, new_message):- yield mock_event-- self.servicer.runner.run_async = mock_run_async-- # 4. Consume generator output- responses = []- context = MagicMock()- async for response in self.servicer.Connect(mock_iterator(), context):- responses.append(response)-- # 5. Assertions- # Expect 2 response messages: Thought response chunk, and End Message- self.assertEqual(len(responses), 2)-- # Verify first response chunk contains ThoughtContent- self.assertEqual(responses[0].conversation_id, "conv-123")- self.assertEqual(responses[0].exec_id, "exec-456")-- message = responses[0].outputs.messages[0]- self.assertEqual(message.role, "assistant")- self.assertTrue(message.content.HasField("thought"))- self.assertEqual(len(message.content.thought.summary), 1)- self.assertEqual(message.content.thought.summary[0].text.text, "Thinking...")-- # Verify Session Service delete is called- self.servicer.session_service.delete_session.assert_called_once_with(- app_name="WeatherAgent",- user_id="AX_USER",- session_id="session-id-789"- )---class TestADKAgentServer(unittest.TestCase):- def setUp(self):- self.server = ADKAgentServer(agent_file="dummy_path.py")-- @patch("importlib.util.spec_from_file_location")- @patch("importlib.util.module_from_spec")- def test_load_agent_missing_root_agent(self, mock_module_from_spec, mock_spec_from_file):- # Configure mock module to lack root_agent attribute- mock_module = MagicMock()- del mock_module.root_agent- mock_module_from_spec.return_value = mock_module-- with self.assertRaises(ValueError) as ctx:- self.server.load_agent()- self.assertIn("No root_agent found in", str(ctx.exception))-- @patch("importlib.util.spec_from_file_location")- @patch("importlib.util.module_from_spec")- def test_load_agent_success(self, mock_module_from_spec, mock_spec_from_file):- # Configure mock module with a valid root_agent attribute- mock_agent = MagicMock()- mock_module = MagicMock()- mock_module.root_agent = mock_agent- mock_module_from_spec.return_value = mock_module-- self.server.load_agent()- self.assertEqual(self.server.agent, mock_agent)---if __name__ == "__main__":- unittest.main()diff --git a/python/adk/content_conversion.py b/python/adk/content_conversion.pydeleted file mode 100644index d973377..0000000--- a/python/adk/content_conversion.py+++ /dev/null@@ -1,99 +0,0 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.--from google.genai import types-from python.proto import content_pb2--def ax_content_to_adk_part(content: content_pb2.Content) -> types.Part:- """Converts a AX Content to ADK Part."""- # TODO - Conversion logic for more content types- active_type = content.WhichOneof('type')-- if active_type == 'text':- if content.text.text:- return types.Part(text=content.text.text)-- elif active_type == 'thought':- if content.thought.summary:- texts = []- for s in content.thought.summary:- if s.WhichOneof('type') == 'text':- texts.append(s.text.text)- text = "".join(texts)- if text:- part = types.Part(text=text)- part.thought = True- return part-- elif active_type == 'confirmation':- decision = content.confirmation.WhichOneof('decision')- if decision == 'approval':- return types.Part(- function_response=types.FunctionResponse(- id=content.confirmation.id,- name="adk_request_confirmation",- response={"confirmed": True}- )- )- elif decision == 'decline':- return types.Part(- function_response=types.FunctionResponse(- id=content.confirmation.id,- name="adk_request_confirmation",- response={"confirmed": False}- )- )- else:- return types.Part(- function_call=types.FunctionCall(- id=content.confirmation.id,- name="adk_request_confirmation",- args={- "prompt": content.confirmation.question- }- )- )-- return None--def adk_part_to_ax_content(part: types.Part) -> content_pb2.Content:- """Converts an ADK Part to a AX Content."""- # TODO - Conversion logic for more content types- if getattr(part, 'text', None):- if getattr(part, 'thought', None):- thought_summary = content_pb2.ThoughtSummaryContent(- text=content_pb2.TextContent(text=part.text)- )- return content_pb2.Content(- thought=content_pb2.ThoughtContent(- summary=[thought_summary]- )- )- else:- return content_pb2.Content(- text=content_pb2.TextContent(text=part.text)- )- elif part.function_call and part.function_call.name == "adk_request_confirmation":- args = part.function_call.args- tool_conf = args.get("toolConfirmation")- question = tool_conf.get("hint") if isinstance(tool_conf, dict) else None- if question is None:- question = str(args)- return content_pb2.Content(- confirmation=content_pb2.ConfirmationContent(- id=part.function_call.id,- question=question- )- )- return Nonediff --git a/python/adk/content_conversion_test.py b/python/adk/content_conversion_test.pydeleted file mode 100644index c349e6a..0000000--- a/python/adk/content_conversion_test.py+++ /dev/null@@ -1,124 +0,0 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.--import unittest-import sys-import os-from unittest.mock import MagicMock--from python.proto import content_pb2-from google.genai import types-from .content_conversion import ax_content_to_adk_part, adk_part_to_ax_content--class TestContentConversion(unittest.TestCase):-- def test_ax_content_to_adk_part_text(self):- content = content_pb2.Content(text=content_pb2.TextContent(text="hello"))- part = ax_content_to_adk_part(content)- self.assertEqual(part.text, "hello")- self.assertFalse(getattr(part, 'thought', False))-- def test_ax_content_to_adk_part_thought(self):- thought_summary = content_pb2.ThoughtSummaryContent(- text=content_pb2.TextContent(text="Thinking...")- )- content = content_pb2.Content(- thought=content_pb2.ThoughtContent(- summary=[thought_summary]- )- )- part = ax_content_to_adk_part(content)- self.assertEqual(part.text, "Thinking...")- self.assertTrue(getattr(part, 'thought', False))-- def test_adk_part_to_ax_content_text(self):- part = MagicMock()- part.text = "hello"- part.thought = False- part.function_call = None- content = adk_part_to_ax_content(part)- self.assertEqual(content.text.text, "hello")-- def test_adk_part_to_ax_content_thought(self):- part = MagicMock()- part.text = "Thinking..."- part.thought = True- part.function_call = None- content = adk_part_to_ax_content(part)- self.assertTrue(content.HasField("thought"))- self.assertEqual(len(content.thought.summary), 1)- self.assertEqual(content.thought.summary[0].text.text, "Thinking...")-- def test_ax_content_to_adk_part_confirmation_request(self):- content = content_pb2.Content(- confirmation=content_pb2.ConfirmationContent(- id="conf-123",- question="Are you sure?"- )- )- part = ax_content_to_adk_part(content)- self.assertIsNotNone(part.function_call)- self.assertEqual(part.function_call.name, "adk_request_confirmation")- self.assertEqual(part.function_call.args["prompt"], "Are you sure?")- self.assertEqual(part.function_call.id, "conf-123")- self.assertNotIn("id", part.function_call.args)-- def test_ax_content_to_adk_part_confirmation_approval(self):- content = content_pb2.Content(- confirmation=content_pb2.ConfirmationContent(- id="conf-123",- approval=content_pb2.ApprovalDecision(approved=True)- )- )- part = ax_content_to_adk_part(content)- self.assertIsNotNone(part.function_response)- self.assertEqual(part.function_response.name, "adk_request_confirmation")- self.assertEqual(part.function_response.id, "conf-123")- self.assertEqual(part.function_response.response["confirmed"], True)-- def test_ax_content_to_adk_part_confirmation_decline(self):- content = content_pb2.Content(- confirmation=content_pb2.ConfirmationContent(- id="conf-123",- decline=content_pb2.DeclineDecision(declined=True)- )- )- part = ax_content_to_adk_part(content)- self.assertIsNotNone(part.function_response)- self.assertEqual(part.function_response.name, "adk_request_confirmation")- self.assertEqual(part.function_response.id, "conf-123")- self.assertEqual(part.function_response.response["confirmed"], False)-- def test_adk_part_to_ax_content_confirmation(self):- class MockFunctionCall:- def __init__(self, name, args, id):- self.name = name- self.args = args- self.id = id-- part = MagicMock()- part.text = None- part.thought = False- part.function_call = MockFunctionCall(- name="adk_request_confirmation",- args={"toolConfirmation": {"hint": "Are you sure?"}},- id="conf-123"- )- content = adk_part_to_ax_content(part)- self.assertTrue(content.HasField("confirmation"))- self.assertEqual(content.confirmation.id, "conf-123")- self.assertEqual(content.confirmation.question, "Are you sure?")--if __name__ == "__main__":- unittest.main()diff --git a/python/adk/requirements.txt b/python/adk/requirements.txtdeleted file mode 100644index 6427790..0000000--- a/python/adk/requirements.txt+++ /dev/null@@ -1,5 +0,0 @@-grpcio-grpcio-tools-google-genai-google-adk-authlibdiff --git a/python/proto/ax_pb2.py b/python/proto/ax_pb2.pyindex d9e2ce0..0a7b121 100644--- a/python/proto/ax_pb2.py+++ b/python/proto/ax_pb2.py@@ -14,13 +14,23 @@# -*- coding: utf-8 -*-# Generated by the protocol buffer compiler. DO NOT EDIT!+# NO CHECKED-IN PROTOBUF GENCODE# source: proto/ax.proto-# Protobuf Python Version: 4.25.1+# Protobuf Python Version: 6.33.5"""Generated protocol buffer code."""from google.protobuf import descriptor as _descriptorfrom google.protobuf import descriptor_pool as _descriptor_pool+from google.protobuf import runtime_version as _runtime_versionfrom google.protobuf import symbol_database as _symbol_databasefrom google.protobuf.internal import builder as _builder+_runtime_version.ValidateProtobufRuntimeVersion(+ _runtime_version.Domain.PUBLIC,+ 6,+ 33,+ 5,+ '',+ 'proto/ax.proto'+)# @@protoc_insertion_point(imports)_sym_db = _symbol_database.Default()@@ -30,18 +40,18 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__from proto import content_pb2 as proto_dot_content__pb2-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eproto/ax.proto\x12\x02\x61x\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13proto/content.proto\"S\n\nAgentStart\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x14\n\x0c\x61gent_config\x18\x02 \x01(\x0c\x12\x1d\n\x08messages\x18\x03 \x03(\x0b\x32\x0b.ax.Message\"-\n\x0c\x41gentOutputs\x12\x1d\n\x08messages\x18\x01 \x03(\x0b\x32\x0b.ax.Message\"\n\n\x08\x41gentEnd\"W\n\x0c\x41gentRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x0f\n\x07\x65xec_id\x18\x02 \x01(\t\x12\x1d\n\x05start\x18\x03 \x01(\x0b\x32\x0e.ax.AgentStart\"\x83\x01\n\rAgentResponse\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x0f\n\x07\x65xec_id\x18\x02 \x01(\t\x12#\n\x07outputs\x18\x03 \x01(\x0b\x32\x10.ax.AgentOutputsH\x00\x12\x1b\n\x03\x65nd\x18\x04 \x01(\x0b\x32\x0c.ax.AgentEndH\x00\x42\x06\n\x04type\"L\n\x07Message\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x1c\n\x07\x63ontent\x18\x02 \x01(\x0b\x32\x0b.ax.Content\x12\x15\n\rinternal_only\x18\x03 \x01(\x08\"\x83\x01\n\x11\x43onversationEvent\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x0b\n\x03seq\x18\x02 \x01(\x05\x12\x0f\n\x07\x65xec_id\x18\x03 \x01(\t\x12\x1d\n\x08messages\x18\x04 \x03(\x0b\x32\x0b.ax.Message\x12\x18\n\x05state\x18\x05 \x01(\x0e\x32\t.ax.State\"\xcd\x01\n\x0e\x45xecutionEvent\x12\x0f\n\x07\x65xec_id\x18\x01 \x01(\t\x12\x10\n\x08\x61gent_id\x18\x02 \x01(\t\x12\x14\n\x0c\x61gent_config\x18\x03 \x01(\x0c\x12\x1b\n\x06inputs\x18\x04 \x03(\x0b\x32\x0b.ax.Message\x12\x1c\n\x07outputs\x18\x05 \x03(\x0b\x32\x0b.ax.Message\x12\x18\n\x05state\x18\x06 \x01(\x0e\x32\t.ax.State\x12-\n\ttimestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x14\n\x12HealthCheckRequest\"7\n\x13HealthCheckResponse\x12\x0f\n\x07healthy\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"E\n\x0cHarnessStart\x12\x16\n\x0eharness_config\x18\x01 \x01(\x0c\x12\x1d\n\x08messages\x18\x02 \x03(\x0b\x32\x0b.ax.Message\"1\n\rHarnessCancel\x12 \n\x06reason\x18\x01 \x01(\x0e\x32\x10.ax.CancelReason\"\x8d\x01\n\x0eHarnessRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x12\n\nharness_id\x18\x02 \x01(\t\x12!\n\x05start\x18\x03 \x01(\x0b\x32\x10.ax.HarnessStartH\x00\x12#\n\x06\x63\x61ncel\x18\x04 \x01(\x0b\x32\x11.ax.HarnessCancelH\x00\x42\x06\n\x04type\"/\n\x0eHarnessOutputs\x12\x1d\n\x08messages\x18\x01 \x03(\x0b\x32\x0b.ax.Message\"=\n\nHarnessEnd\x12\x18\n\x05state\x18\x01 \x01(\x0e\x32\t.ax.State\x12\x15\n\rerror_message\x18\x02 \x01(\t\"x\n\x0fHarnessResponse\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12%\n\x07outputs\x18\x02 \x01(\x0b\x32\x12.ax.HarnessOutputsH\x00\x12\x1d\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x0e.ax.HarnessEndH\x00\x42\x06\n\x04type\"}\n\x0b\x45xecRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x1b\n\x06inputs\x18\x02 \x03(\x0b\x32\x0b.ax.Message\x12\x10\n\x08last_seq\x18\x03 \x01(\x05\x12\x10\n\x08\x61gent_id\x18\x04 \x01(\t\x12\x14\n\x0c\x61gent_config\x18\x05 \x01(\x0c\"9\n\x0c\x45xecResponse\x12\x1c\n\x07outputs\x18\x01 \x03(\x0b\x32\x0b.ax.Message\x12\x0b\n\x03seq\x18\x02 \x01(\x05\"4\n\x19\x44\x65leteConversationRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\"\x1c\n\x1a\x44\x65leteConversationResponse*l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n\rSTATE_PENDING\x10\x01\x12\x10\n\x0cSTATE_FAILED\x10\x02\x12\x13\n\x0fSTATE_COMPLETED\x10\x03\x12\x12\n\x0eSTATE_CANCELED\x10\x04*\x8c\x01\n\x0c\x43\x61ncelReason\x12\x1d\n\x19\x43\x41NCEL_REASON_UNSPECIFIED\x10\x00\x12 \n\x1c\x43\x41NCEL_REASON_USER_REQUESTED\x10\x01\x12\x19\n\x15\x43\x41NCEL_REASON_TIMEOUT\x10\x02\x12 \n\x1c\x43\x41NCEL_REASON_INTERNAL_ERROR\x10\x03\x32\x80\x01\n\x0c\x41gentService\x12\x30\n\x07\x43onnect\x12\x10.ax.AgentRequest\x1a\x11.ax.AgentResponse0\x01\x12>\n\x0bHealthCheck\x12\x16.ax.HealthCheckRequest\x1a\x17.ax.HealthCheckResponse2H\n\x0eHarnessService\x12\x36\n\x07\x43onnect\x12\x12.ax.HarnessRequest\x1a\x13.ax.HarnessResponse(\x01\x30\x01\x32@\n\x11\x43ontrollerService\x12+\n\x04\x45xec\x12\x0f.ax.ExecRequest\x1a\x10.ax.ExecResponse0\x01\x32j\n\x13\x43onversationService\x12S\n\x12\x44\x65leteConversation\x12\x1d.ax.DeleteConversationRequest\x1a\x1e.ax.DeleteConversationResponseB\x1cZ\x1agithub.com/google/ax/protob\x06proto3')+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eproto/ax.proto\x12\x02\x61x\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13proto/content.proto\"S\n\nAgentStart\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x14\n\x0c\x61gent_config\x18\x02 \x01(\x0c\x12\x1d\n\x08messages\x18\x03 \x03(\x0b\x32\x0b.ax.Message\"-\n\x0c\x41gentOutputs\x12\x1d\n\x08messages\x18\x01 \x03(\x0b\x32\x0b.ax.Message\"\n\n\x08\x41gentEnd\"W\n\x0c\x41gentRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x0f\n\x07\x65xec_id\x18\x02 \x01(\t\x12\x1d\n\x05start\x18\x03 \x01(\x0b\x32\x0e.ax.AgentStart\"\x83\x01\n\rAgentResponse\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x0f\n\x07\x65xec_id\x18\x02 \x01(\t\x12#\n\x07outputs\x18\x03 \x01(\x0b\x32\x10.ax.AgentOutputsH\x00\x12\x1b\n\x03\x65nd\x18\x04 \x01(\x0b\x32\x0c.ax.AgentEndH\x00\x42\x06\n\x04type\"L\n\x07Message\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x1c\n\x07\x63ontent\x18\x02 \x01(\x0b\x32\x0b.ax.Content\x12\x15\n\rinternal_only\x18\x03 \x01(\x08\"\xaf\x01\n\x11\x43onversationEvent\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x0b\n\x03seq\x18\x02 \x01(\x05\x12\x0f\n\x07\x65xec_id\x18\x03 \x01(\t\x12\x12\n\nharness_id\x18\x04 \x01(\t\x12\x16\n\x0eharness_config\x18\x05 \x01(\x0c\x12\x1d\n\x08messages\x18\x06 \x03(\x0b\x32\x0b.ax.Message\x12\x18\n\x05state\x18\x07 \x01(\x0e\x32\t.ax.State\"\x14\n\x12HealthCheckRequest\"7\n\x13HealthCheckResponse\x12\x0f\n\x07healthy\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"E\n\x0cHarnessStart\x12\x16\n\x0eharness_config\x18\x01 \x01(\x0c\x12\x1d\n\x08messages\x18\x02 \x03(\x0b\x32\x0b.ax.Message\"1\n\rHarnessCancel\x12 \n\x06reason\x18\x01 \x01(\x0e\x32\x10.ax.CancelReason\"\x8d\x01\n\x0eHarnessRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x12\n\nharness_id\x18\x02 \x01(\t\x12!\n\x05start\x18\x03 \x01(\x0b\x32\x10.ax.HarnessStartH\x00\x12#\n\x06\x63\x61ncel\x18\x04 \x01(\x0b\x32\x11.ax.HarnessCancelH\x00\x42\x06\n\x04type\"/\n\x0eHarnessOutputs\x12\x1d\n\x08messages\x18\x01 \x03(\x0b\x32\x0b.ax.Message\"=\n\nHarnessEnd\x12\x18\n\x05state\x18\x01 \x01(\x0e\x32\t.ax.State\x12\x15\n\rerror_message\x18\x02 \x01(\t\"x\n\x0fHarnessResponse\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12%\n\x07outputs\x18\x02 \x01(\x0b\x32\x12.ax.HarnessOutputsH\x00\x12\x1d\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x0e.ax.HarnessEndH\x00\x42\x06\n\x04type\"}\n\x0b\x45xecRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x1b\n\x06inputs\x18\x02 \x03(\x0b\x32\x0b.ax.Message\x12\x10\n\x08last_seq\x18\x03 \x01(\x05\x12\x10\n\x08\x61gent_id\x18\x04 \x01(\t\x12\x14\n\x0c\x61gent_config\x18\x05 \x01(\x0c\"9\n\x0c\x45xecResponse\x12\x1c\n\x07outputs\x18\x01 \x03(\x0b\x32\x0b.ax.Message\x12\x0b\n\x03seq\x18\x02 \x01(\x05\"4\n\x19\x44\x65leteConversationRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\"\x1c\n\x1a\x44\x65leteConversationResponse*l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n\rSTATE_PENDING\x10\x01\x12\x10\n\x0cSTATE_FAILED\x10\x02\x12\x13\n\x0fSTATE_COMPLETED\x10\x03\x12\x12\n\x0eSTATE_CANCELED\x10\x04*\x8c\x01\n\x0c\x43\x61ncelReason\x12\x1d\n\x19\x43\x41NCEL_REASON_UNSPECIFIED\x10\x00\x12 \n\x1c\x43\x41NCEL_REASON_USER_REQUESTED\x10\x01\x12\x19\n\x15\x43\x41NCEL_REASON_TIMEOUT\x10\x02\x12 \n\x1c\x43\x41NCEL_REASON_INTERNAL_ERROR\x10\x03\x32H\n\x0eHarnessService\x12\x36\n\x07\x43onnect\x12\x12.ax.HarnessRequest\x1a\x13.ax.HarnessResponse(\x01\x30\x01\x32@\n\x11\x43ontrollerService\x12+\n\x04\x45xec\x12\x0f.ax.ExecRequest\x1a\x10.ax.ExecResponse0\x01\x32j\n\x13\x43onversationService\x12S\n\x12\x44\x65leteConversation\x12\x1d.ax.DeleteConversationRequest\x1a\x1e.ax.DeleteConversationResponseB\x1cZ\x1agithub.com/google/ax/protob\x06proto3')_globals = globals()_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.ax_pb2', _globals)-if _descriptor._USE_C_DESCRIPTORS == False:- _globals['DESCRIPTOR']._options = None+if not _descriptor._USE_C_DESCRIPTORS:+ _globals['DESCRIPTOR']._loaded_options = None_globals['DESCRIPTOR']._serialized_options = b'Z\032github.com/google/ax/proto'- _globals['_STATE']._serialized_start=1712- _globals['_STATE']._serialized_end=1820- _globals['_CANCELREASON']._serialized_start=1823- _globals['_CANCELREASON']._serialized_end=1963+ _globals['_STATE']._serialized_start=1548+ _globals['_STATE']._serialized_end=1656+ _globals['_CANCELREASON']._serialized_start=1659+ _globals['_CANCELREASON']._serialized_end=1799_globals['_AGENTSTART']._serialized_start=76_globals['_AGENTSTART']._serialized_end=159_globals['_AGENTOUTPUTS']._serialized_start=161@@ -55,39 +65,35 @@ if _descriptor._USE_C_DESCRIPTORS == False:_globals['_MESSAGE']._serialized_start=443_globals['_MESSAGE']._serialized_end=519_globals['_CONVERSATIONEVENT']._serialized_start=522- _globals['_CONVERSATIONEVENT']._serialized_end=653- _globals['_EXECUTIONEVENT']._serialized_start=656- _globals['_EXECUTIONEVENT']._serialized_end=861- _globals['_HEALTHCHECKREQUEST']._serialized_start=863- _globals['_HEALTHCHECKREQUEST']._serialized_end=883- _globals['_HEALTHCHECKRESPONSE']._serialized_start=885- _globals['_HEALTHCHECKRESPONSE']._serialized_end=940- _globals['_HARNESSSTART']._serialized_start=942- _globals['_HARNESSSTART']._serialized_end=1011- _globals['_HARNESSCANCEL']._serialized_start=1013- _globals['_HARNESSCANCEL']._serialized_end=1062- _globals['_HARNESSREQUEST']._serialized_start=1065- _globals['_HARNESSREQUEST']._serialized_end=1206- _globals['_HARNESSOUTPUTS']._serialized_start=1208- _globals['_HARNESSOUTPUTS']._serialized_end=1255- _globals['_HARNESSEND']._serialized_start=1257- _globals['_HARNESSEND']._serialized_end=1318- _globals['_HARNESSRESPONSE']._serialized_start=1320- _globals['_HARNESSRESPONSE']._serialized_end=1440- _globals['_EXECREQUEST']._serialized_start=1442- _globals['_EXECREQUEST']._serialized_end=1567- _globals['_EXECRESPONSE']._serialized_start=1569- _globals['_EXECRESPONSE']._serialized_end=1626- _globals['_DELETECONVERSATIONREQUEST']._serialized_start=1628- _globals['_DELETECONVERSATIONREQUEST']._serialized_end=1680- _globals['_DELETECONVERSATIONRESPONSE']._serialized_start=1682- _globals['_DELETECONVERSATIONRESPONSE']._serialized_end=1710- _globals['_AGENTSERVICE']._serialized_start=1966- _globals['_AGENTSERVICE']._serialized_end=2094- _globals['_HARNESSSERVICE']._serialized_start=2096- _globals['_HARNESSSERVICE']._serialized_end=2168- _globals['_CONTROLLERSERVICE']._serialized_start=2170- _globals['_CONTROLLERSERVICE']._serialized_end=2234- _globals['_CONVERSATIONSERVICE']._serialized_start=2236- _globals['_CONVERSATIONSERVICE']._serialized_end=2342+ _globals['_CONVERSATIONEVENT']._serialized_end=697+ _globals['_HEALTHCHECKREQUEST']._serialized_start=699+ _globals['_HEALTHCHECKREQUEST']._serialized_end=719+ _globals['_HEALTHCHECKRESPONSE']._serialized_start=721+ _globals['_HEALTHCHECKRESPONSE']._serialized_end=776+ _globals['_HARNESSSTART']._serialized_start=778+ _globals['_HARNESSSTART']._serialized_end=847+ _globals['_HARNESSCANCEL']._serialized_start=849+ _globals['_HARNESSCANCEL']._serialized_end=898+ _globals['_HARNESSREQUEST']._serialized_start=901+ _globals['_HARNESSREQUEST']._serialized_end=1042+ _globals['_HARNESSOUTPUTS']._serialized_start=1044+ _globals['_HARNESSOUTPUTS']._serialized_end=1091+ _globals['_HARNESSEND']._serialized_start=1093+ _globals['_HARNESSEND']._serialized_end=1154+ _globals['_HARNESSRESPONSE']._serialized_start=1156+ _globals['_HARNESSRESPONSE']._serialized_end=1276+ _globals['_EXECREQUEST']._serialized_start=1278+ _globals['_EXECREQUEST']._serialized_end=1403+ _globals['_EXECRESPONSE']._serialized_start=1405+ _globals['_EXECRESPONSE']._serialized_end=1462+ _globals['_DELETECONVERSATIONREQUEST']._serialized_start=1464+ _globals['_DELETECONVERSATIONREQUEST']._serialized_end=1516+ _globals['_DELETECONVERSATIONRESPONSE']._serialized_start=1518+ _globals['_DELETECONVERSATIONRESPONSE']._serialized_end=1546+ _globals['_HARNESSSERVICE']._serialized_start=1801+ _globals['_HARNESSSERVICE']._serialized_end=1873+ _globals['_CONTROLLERSERVICE']._serialized_start=1875+ _globals['_CONTROLLERSERVICE']._serialized_end=1939+ _globals['_CONVERSATIONSERVICE']._serialized_start=1941+ _globals['_CONVERSATIONSERVICE']._serialized_end=2047# @@protoc_insertion_point(module_scope)diff --git a/python/proto/ax_pb2_grpc.py b/python/proto/ax_pb2_grpc.pyindex b46662d..e67bdd8 100644--- a/python/proto/ax_pb2_grpc.py+++ b/python/proto/ax_pb2_grpc.py@@ -15,128 +15,31 @@# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!"""Client and server classes corresponding to protobuf-defined services."""import grpc+import warningsfrom proto import ax_pb2 as proto_dot_ax__pb2+GRPC_GENERATED_VERSION = '1.81.1'+GRPC_VERSION = grpc.__version__+_version_not_supported = False-class AgentServiceStub(object):- """AgentService defines the gRPC service for agent communication.- This protocol enables a bidirectional communication between the- controller and the agent. Agents can start new agentic calls via- the controller within the same execution boundary by using the channel.+try:+ from grpc._utilities import first_version_is_lower+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)+except ImportError:+ _version_not_supported = True- WARNING: There will be significant changes to this protocol as- we are solidifying resumption on the wire.- """+if _version_not_supported:+ raise RuntimeError(+ f'The grpc package installed is at version {GRPC_VERSION},'+ + ' but the generated code in proto/ax_pb2_grpc.py depends on'+ + f' grpcio>={GRPC_GENERATED_VERSION}.'+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'+ )- def __init__(self, channel):- """Constructor.-- Args:- channel: A grpc.Channel.- """- self.Connect = channel.unary_stream(- '/ax.AgentService/Connect',- request_serializer=proto_dot_ax__pb2.AgentRequest.SerializeToString,- response_deserializer=proto_dot_ax__pb2.AgentResponse.FromString,- )- self.HealthCheck = channel.unary_unary(- '/ax.AgentService/HealthCheck',- request_serializer=proto_dot_ax__pb2.HealthCheckRequest.SerializeToString,- response_deserializer=proto_dot_ax__pb2.HealthCheckResponse.FromString,- )---class AgentServiceServicer(object):- """AgentService defines the gRPC service for agent communication.- This protocol enables a bidirectional communication between the- controller and the agent. Agents can start new agentic calls via- the controller within the same execution boundary by using the channel.-- WARNING: There will be significant changes to this protocol as- we are solidifying resumption on the wire.- """-- def Connect(self, request, context):- """Connect is used by agents to connect to the controller.- """- context.set_code(grpc.StatusCode.UNIMPLEMENTED)- context.set_details('Method not implemented!')- raise NotImplementedError('Method not implemented!')-- def HealthCheck(self, request, context):- """HealthCheck checks if the agent is healthy and responsive- """- context.set_code(grpc.StatusCode.UNIMPLEMENTED)- context.set_details('Method not implemented!')- raise NotImplementedError('Method not implemented!')---def add_AgentServiceServicer_to_server(servicer, server):- rpc_method_handlers = {- 'Connect': grpc.unary_stream_rpc_method_handler(- servicer.Connect,- request_deserializer=proto_dot_ax__pb2.AgentRequest.FromString,- response_serializer=proto_dot_ax__pb2.AgentResponse.SerializeToString,- ),- 'HealthCheck': grpc.unary_unary_rpc_method_handler(- servicer.HealthCheck,- request_deserializer=proto_dot_ax__pb2.HealthCheckRequest.FromString,- response_serializer=proto_dot_ax__pb2.HealthCheckResponse.SerializeToString,- ),- }- generic_handler = grpc.method_handlers_generic_handler(- 'ax.AgentService', rpc_method_handlers)- server.add_generic_rpc_handlers((generic_handler,))--- # This class is part of an EXPERIMENTAL API.-class AgentService(object):- """AgentService defines the gRPC service for agent communication.- This protocol enables a bidirectional communication between the- controller and the agent. Agents can start new agentic calls via- the controller within the same execution boundary by using the channel.-- WARNING: There will be significant changes to this protocol as- we are solidifying resumption on the wire.- """-- @staticmethod- def Connect(request,- target,- options=(),- channel_credentials=None,- call_credentials=None,- insecure=False,- compression=None,- wait_for_ready=None,- timeout=None,- metadata=None):- return grpc.experimental.unary_stream(request, target, '/ax.AgentService/Connect',- proto_dot_ax__pb2.AgentRequest.SerializeToString,- proto_dot_ax__pb2.AgentResponse.FromString,- options, channel_credentials,- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)- @staticmethod- def HealthCheck(request,- target,- options=(),- channel_credentials=None,- call_credentials=None,- insecure=False,- compression=None,- wait_for_ready=None,- timeout=None,- metadata=None):- return grpc.experimental.unary_unary(request, target, '/ax.AgentService/HealthCheck',- proto_dot_ax__pb2.HealthCheckRequest.SerializeToString,- proto_dot_ax__pb2.HealthCheckResponse.FromString,- options, channel_credentials,- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)---class HarnessServiceStub(object):+class HarnessServiceStub:"""Missing associated documentation comment in .proto file."""def __init__(self, channel):@@ -149,10 +52,10 @@ class HarnessServiceStub(object):'/ax.HarnessService/Connect',request_serializer=proto_dot_ax__pb2.HarnessRequest.SerializeToString,response_deserializer=proto_dot_ax__pb2.HarnessResponse.FromString,- )+ _registered_method=True)-class HarnessServiceServicer(object):+class HarnessServiceServicer:"""Missing associated documentation comment in .proto file."""def Connect(self, request_iterator, context):@@ -177,10 +80,11 @@ def add_HarnessServiceServicer_to_server(servicer, server):generic_handler = grpc.method_handlers_generic_handler('ax.HarnessService', rpc_method_handlers)server.add_generic_rpc_handlers((generic_handler,))+ server.add_registered_method_handlers('ax.HarnessService', rpc_method_handlers)# This class is part of an EXPERIMENTAL API.-class HarnessService(object):+class HarnessService:"""Missing associated documentation comment in .proto file."""@staticmethod@@ -194,14 +98,24 @@ class HarnessService(object):wait_for_ready=None,timeout=None,metadata=None):- return grpc.experimental.stream_stream(request_iterator, target, '/ax.HarnessService/Connect',+ return grpc.experimental.stream_stream(+ request_iterator,+ target,+ '/ax.HarnessService/Connect',proto_dot_ax__pb2.HarnessRequest.SerializeToString,proto_dot_ax__pb2.HarnessResponse.FromString,- options, channel_credentials,- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)---class ControllerServiceStub(object):+ options,+ channel_credentials,+ insecure,+ call_credentials,+ compression,+ wait_for_ready,+ timeout,+ metadata,+ _registered_method=True)+++class ControllerServiceStub:"""Missing associated documentation comment in .proto file."""def __init__(self, channel):@@ -214,10 +128,10 @@ class ControllerServiceStub(object):'/ax.ControllerService/Exec',request_serializer=proto_dot_ax__pb2.ExecRequest.SerializeToString,response_deserializer=proto_dot_ax__pb2.ExecResponse.FromString,- )+ _registered_method=True)-class ControllerServiceServicer(object):+class ControllerServiceServicer:"""Missing associated documentation comment in .proto file."""def Exec(self, request, context):@@ -240,10 +154,11 @@ def add_ControllerServiceServicer_to_server(servicer, server):generic_handler = grpc.method_handlers_generic_handler('ax.ControllerService', rpc_method_handlers)server.add_generic_rpc_handlers((generic_handler,))+ server.add_registered_method_handlers('ax.ControllerService', rpc_method_handlers)# This class is part of an EXPERIMENTAL API.-class ControllerService(object):+class ControllerService:"""Missing associated documentation comment in .proto file."""@staticmethod@@ -257,14 +172,24 @@ class ControllerService(object):wait_for_ready=None,timeout=None,metadata=None):- return grpc.experimental.unary_stream(request, target, '/ax.ControllerService/Exec',+ return grpc.experimental.unary_stream(+ request,+ target,+ '/ax.ControllerService/Exec',proto_dot_ax__pb2.ExecRequest.SerializeToString,proto_dot_ax__pb2.ExecResponse.FromString,- options, channel_credentials,- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)---class ConversationServiceStub(object):+ options,+ channel_credentials,+ insecure,+ call_credentials,+ compression,+ wait_for_ready,+ timeout,+ metadata,+ _registered_method=True)+++class ConversationServiceStub:"""Missing associated documentation comment in .proto file."""def __init__(self, channel):@@ -277,10 +202,10 @@ class ConversationServiceStub(object):'/ax.ConversationService/DeleteConversation',request_serializer=proto_dot_ax__pb2.DeleteConversationRequest.SerializeToString,response_deserializer=proto_dot_ax__pb2.DeleteConversationResponse.FromString,- )+ _registered_method=True)-class ConversationServiceServicer(object):+class ConversationServiceServicer:"""Missing associated documentation comment in .proto file."""def DeleteConversation(self, request, context):@@ -303,10 +228,11 @@ def add_ConversationServiceServicer_to_server(servicer, server):generic_handler = grpc.method_handlers_generic_handler('ax.ConversationService', rpc_method_handlers)server.add_generic_rpc_handlers((generic_handler,))+ server.add_registered_method_handlers('ax.ConversationService', rpc_method_handlers)# This class is part of an EXPERIMENTAL API.-class ConversationService(object):+class ConversationService:"""Missing associated documentation comment in .proto file."""@staticmethod@@ -320,8 +246,18 @@ class ConversationService(object):wait_for_ready=None,timeout=None,metadata=None):- return grpc.experimental.unary_unary(request, target, '/ax.ConversationService/DeleteConversation',+ return grpc.experimental.unary_unary(+ request,+ target,+ '/ax.ConversationService/DeleteConversation',proto_dot_ax__pb2.DeleteConversationRequest.SerializeToString,proto_dot_ax__pb2.DeleteConversationResponse.FromString,- options, channel_credentials,- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)+ options,+ channel_credentials,+ insecure,+ call_credentials,+ compression,+ wait_for_ready,+ timeout,+ metadata,+ _registered_method=True)diff --git a/python/proto/content_pb2.py b/python/proto/content_pb2.pyindex c20ef7b..27a5937 100644--- a/python/proto/content_pb2.py+++ b/python/proto/content_pb2.py@@ -14,13 +14,23 @@# -*- coding: utf-8 -*-# Generated by the protocol buffer compiler. DO NOT EDIT!+# NO CHECKED-IN PROTOBUF GENCODE# source: proto/content.proto-# Protobuf Python Version: 4.25.1+# Protobuf Python Version: 6.33.5"""Generated protocol buffer code."""from google.protobuf import descriptor as _descriptorfrom google.protobuf import descriptor_pool as _descriptor_pool+from google.protobuf import runtime_version as _runtime_versionfrom google.protobuf import symbol_database as _symbol_databasefrom google.protobuf.internal import builder as _builder+_runtime_version.ValidateProtobufRuntimeVersion(+ _runtime_version.Domain.PUBLIC,+ 6,+ 33,+ 5,+ '',+ 'proto/content.proto'+)# @@protoc_insertion_point(imports)_sym_db = _symbol_database.Default()@@ -34,8 +44,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13proto/content._globals = globals()_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.content_pb2', _globals)-if _descriptor._USE_C_DESCRIPTORS == False:- _globals['DESCRIPTOR']._options = None+if not _descriptor._USE_C_DESCRIPTORS:+ _globals['DESCRIPTOR']._loaded_options = None_globals['DESCRIPTOR']._serialized_options = b'Z\032github.com/google/ax/proto'_globals['_MEDIARESOLUTION']._serialized_start=2638_globals['_MEDIARESOLUTION']._serialized_end=2736diff --git a/python/proto/content_pb2_grpc.py b/python/proto/content_pb2_grpc.pyindex fe9b2e7..f6b95ba 100644--- a/python/proto/content_pb2_grpc.py+++ b/python/proto/content_pb2_grpc.py@@ -15,4 +15,24 @@# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!"""Client and server classes corresponding to protobuf-defined services."""import grpc+import warnings++GRPC_GENERATED_VERSION = '1.81.1'+GRPC_VERSION = grpc.__version__+_version_not_supported = False++try:+ from grpc._utilities import first_version_is_lower+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)+except ImportError:+ _version_not_supported = True++if _version_not_supported:+ raise RuntimeError(+ f'The grpc package installed is at version {GRPC_VERSION},'+ + ' but the generated code in proto/content_pb2_grpc.py depends on'+ + f' grpcio>={GRPC_GENERATED_VERSION}.'+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'+ )