Skip to content

armgit / ax

Public Imported from GitHub
0

Agent Executor (AX) is Google's open agentic orchestration runtime

Go

Remove agent_id from the Python framework

Jaana Dogan5c4365d3e324
diff --git a/python/example_agent.py b/python/example_agent.py
index 9f0282b..fee97ef 100644
--- a/python/example_agent.py
+++ b/python/example_agent.py
@@ -41,7 +41,6 @@ def health_check():
if __name__ == "__main__":
agent = Agent(
- agent_id="python-agent",
process_func=process,
health_check_func=health_check
)
diff --git a/python/gar.py b/python/gar.py
index 5db6e3e..51273d3 100644
--- a/python/gar.py
+++ b/python/gar.py
@@ -33,13 +33,12 @@ class Agent:
yield Content(role="assistant", type="text",
mimetype="text/plain", data=f"Processed: {content.data}")
- agent = Agent(agent_id="my-agent", process_func=process)
+ agent = Agent(process_func=process)
agent.serve(port=50051)
"""
def __init__(
self,
- agent_id: str,
process_func: Callable,
health_check_func: Optional[Callable] = None
):
@@ -47,11 +46,9 @@ class Agent:
Initialize an agent.
Args:
- agent_id: Unique identifier for this agent
process_func: Function that takes (session_id: str, inputs: list) and yields Content responses
health_check_func: Optional function that returns (healthy: bool, message: str, metadata: dict)
"""
- self.agent_id = agent_id
self.process_func = process_func
self.health_check_func = health_check_func
@@ -112,7 +109,7 @@ class Agent:
)
server.add_insecure_port(f'[::]:{port}')
server.start()
- print(f"Agent '{self.agent_id}' listening on port {port}")
+ print(f"Agent listening on port {port}")
try:
server.wait_for_termination()
@@ -123,7 +120,6 @@ class Agent:
# Convenience function for quick agent creation
def create_agent(
- agent_id: str,
process_func: Callable,
health_check_func: Optional[Callable] = None,
port: int = 50051
@@ -132,10 +128,9 @@ def create_agent(
Create and start an agent in one call.
Args:
- agent_id: Unique identifier for this agent
process_func: Function that takes (session_id: str, inputs: list) and yields Content responses
health_check_func: Optional function that returns (healthy: bool, message: str, metadata: dict)
port: Port to listen on (default: 50051)
"""
- agent = Agent(agent_id, process_func, health_check_func)
+ agent = Agent(process_func, health_check_func)
agent.serve(port=port)