From e64b60ffc5f72a4305c9d63989ec674f46097326 Mon Sep 17 00:00:00 2001 From: DavidLee528 Date: Sun, 12 Oct 2025 21:11:56 +0800 Subject: [PATCH] fix: Update API key handling in TravelPlannerAgent to use configuration directly --- samples/python/agents/travel_planner_agent/agent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/python/agents/travel_planner_agent/agent.py b/samples/python/agents/travel_planner_agent/agent.py index e88927245..82f5fd0b9 100644 --- a/samples/python/agents/travel_planner_agent/agent.py +++ b/samples/python/agents/travel_planner_agent/agent.py @@ -17,10 +17,10 @@ def __init__(self): try: with open('config.json') as f: config = json.load(f) - if not os.getenv(config['api_key']): - print(f'{config["api_key"]} environment variable not set.') + if not config['api_key']: + print('api_key configuration not set.') sys.exit(1) - api_key = os.getenv(config['api_key']) + api_key = config['api_key'] self.model = ChatOpenAI( model=config['model_name'] or 'gpt-4o',