Skip to content

Commit 32aafd0

Browse files
committed
use agent api key
1 parent faed7c0 commit 32aafd0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/agentex/lib/adk/utils/_modules/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66

77
def create_async_agentex_client(**kwargs):
8-
agent_id = refreshed_environment_variables.AGENT_ID
8+
#agent_id = refreshed_environment_variables.AGENT_ID
99
default_headers = {
10-
"x-agent-identity": agent_id
10+
"x-agent-identity": os.environ["AGENT_API_KEY"]
1111
}
1212
return AsyncAgentex(default_headers=default_headers, **kwargs)

src/agentex/lib/sdk/fastacp/base/base_acp_server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,15 @@ async def _register_agent(self, env_vars: EnvironmentVariables):
393393
if response.status_code == 200:
394394
agent = response.json()
395395
agent_id, agent_name = agent["id"], agent["name"]
396+
print(agent)
397+
agent_api_key = agent["agent_api_key"]
396398

397399
os.environ["AGENT_ID"] = agent_id
398400
os.environ["AGENT_NAME"] = agent_name
401+
os.environ["AGENT_API_KEY"] = agent_api_key
399402
#refreshed_environment_variables.AGENT_ID = agent_id
400403
#refreshed_environment_variables.AGENT_NAME = agent_name
404+
#refreshed_environment_variables.AGENT_API_KEY = agent_api_key
401405

402406
logger.info(
403407
f"Successfully registered agent '{agent_name}' with Agentex server with acp_url: {full_acp_url}. Registration data: {registration_data}"

0 commit comments

Comments
 (0)