user_input:
message:
type: string
workflow:
- name: create_system
type: create_messages
config:
message_configs:
- role: system
content: >
You are a helpful assistant that can help the user determine the
weather outside.
Use relevant tools in the correct order to answer the user's
question.
Also inform the user where exactly they are in the world.
inputs: {}
- name: user_messages
type: create_messages
config:
message_configs:
- role: user
content: message
inputs:
message: message
- name: all_messages
type: insert_messages
config:
index: -1
inputs:
messages: create_system.output
new_messages: user_messages.output
- name: get_my_weather
type: tool_generation
config:
model: openai/gpt-4o
tools:
- name: experimental.HTTPRequestTool
init_kwargs:
name: get_location
method: GET
url: https://ipapi.co/json/
description: Get user's location based on IP address
timeout: 5
- name: experimental.HTTPRequestTool
init_kwargs:
name: get_weather
method: GET
url: https://api.open-meteo.com/v1/forecast?hourly=temperature_2m
description: Get current weather data for a location
query_schema: >-
{"properties": {"latitude": {"description": "Latitude coordinate",
"title": "Latitude", "type": "number"}, "longitude":
{"description": "Longitude coordinate", "title": "Longitude",
"type": "number"}}, "required": ["latitude", "longitude"],
"title": "WeatherQuery", "type": "object"}
inputs:
messages: all_messages.output