# cURL Example for the Weather Bot
# This example demonstrates the API calls without actual function execution.
# First API Call - Simulate user asking for the weather
curl -X POST https://api.gravixlayer.com/v1/inference \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key_here" \
-d '{
"model": "meta-llama/llama-3.1-8b-instruct",
"messages": [{"role": "user", "content": "What'\''s the weather like in Paris, France today?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current temperature in Celsius for a given latitude and longitude.",
"parameters": {
"type": "object",
"properties": {
"latitude": {"type": "number"},
"longitude": {"type": "number"}
},
"required": ["latitude", "longitude"]
}
}
}],
"tool_choice": "auto"
}'
# Second API Call - Simulate model responding with a function call
curl -X POST https://api.gravixlayer.com/v1/inference \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key_here" \
-d '{
"model": "meta-llama/llama-3.1-8b-instruct",
"messages": [
{"role": "user", "content": "What'\''s the weather like in Paris, France today?"},
{"role": "assistant", "content": "The current temperature in Paris is approximately 18.2 degrees Celsius."}
],
"tools": [],
"tool_choice": "auto"
}'