From 74c978cc1755d4fc007bfa03743375b4b6635ff8 Mon Sep 17 00:00:00 2001 From: Salman Paracha Date: Fri, 16 Jan 2026 23:34:30 -0800 Subject: [PATCH] tried to tweak the instructions but still can't get the agents to render both results --- .../crewai/flight_agent.py | 9 ++++----- .../langchain/weather_agent.py | 10 ++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/demos/use_cases/multi_agent_with_crewai_langchain/crewai/flight_agent.py b/demos/use_cases/multi_agent_with_crewai_langchain/crewai/flight_agent.py index 26305505..77e8352c 100644 --- a/demos/use_cases/multi_agent_with_crewai_langchain/crewai/flight_agent.py +++ b/demos/use_cases/multi_agent_with_crewai_langchain/crewai/flight_agent.py @@ -65,9 +65,7 @@ Your task: 2. Convert technical data into friendly, readable text 3. Use 12-hour time format (e.g., "9:00 AM") 4. Organize flights chronologically by departure time -5. Include terminal/gate info when available - -NOTE: Multi-agent context: If the conversation includes information from other sources, incorporate it naturally.""" +5. Include terminal/gate info when available6. NOTE (Multi-agent context): If the conversation includes information from other sources that are not flight-related, incorporate it naturally.""" def build_flight_crew( @@ -156,14 +154,15 @@ def build_flight_crew( backstory=SYSTEM_PROMPT, tools=[resolve_airport_code_tool, search_flights], llm=llm, - verbose=False, + verbose=True, reasoning=False, ) task = Task( description=( "Answer the user's request based on this conversation:\n{conversation}\n\n" - "CRITICAL: Output ONLY your final answer to the user. Do NOT output:\n" + "CRITICAL: NOTE you are part of a multi-agent setup, so if the conversation includes information from other sources that are not flight-related, incorporate it naturally.\n" + "Output ONLY your final answer to the user. Do NOT show:\n" "- Thought, Action, Action Input, Observation, or any reasoning steps\n" "- Tool names, parameters, or results\n" "- Planning or internal deliberation\n\n" diff --git a/demos/use_cases/multi_agent_with_crewai_langchain/langchain/weather_agent.py b/demos/use_cases/multi_agent_with_crewai_langchain/langchain/weather_agent.py index 04355a44..6246026b 100644 --- a/demos/use_cases/multi_agent_with_crewai_langchain/langchain/weather_agent.py +++ b/demos/use_cases/multi_agent_with_crewai_langchain/langchain/weather_agent.py @@ -29,8 +29,8 @@ logger = logging.getLogger(__name__) LLM_GATEWAY_ENDPOINT = os.getenv( "LLM_GATEWAY_ENDPOINT", "http://host.docker.internal:12000/v1" ) -WEATHER_MODEL = "openai/gpt-4o" -LOCATION_MODEL = "openai/gpt-4o-mini" +WEATHER_MODEL = "gpt-4o" +LOCATION_MODEL = "gpt-4o-mini" openai_client_via_plano = AsyncOpenAI( base_url=LLM_GATEWAY_ENDPOINT, @@ -250,8 +250,7 @@ class WeatherToolInput(BaseModel): ) -WEATHER_SYSTEM_PROMPT = """ - You are a weather assistant in a multi-agent system. You will receive weather data in JSON format with these fields: +WEATHER_SYSTEM_PROMPT = """You are a weather assistant in a multi-agent system. You will receive weather data in JSON format with these fields: - "location": City name - "forecast": Array of weather objects, each with date, day_name, temperature_c, temperature_f, temperature_max_c, temperature_min_c, weather_code, sunrise, sunset @@ -264,8 +263,7 @@ WEATHER_SYSTEM_PROMPT = """ 4. Include temperature in both Celsius and Fahrenheit 5. Describe conditions naturally based on weather_code 6. Use conversational language - - NOTE: Multi-agent context: You are part of a larger system. If the conversation includes additional context or information from other sources, acknowledge and incorporate it naturally into your response. Your primary focus is weather, but be aware of the full conversation context. + 7. NOTE (Multi-agent context): If the conversation includes information from other agents and sources incorporate it naturally. Remember: Only use the provided data. If fields are null, mention data is unavailable."""