"description":"The city and state, e.g. San Francisco, CA",
},
"format":{
"type":"string",
"enum":["celsius","fahrenheit"],
"description":"The temperature unit to use. Infer this from the users location.",
},
},
"required":["location","format"],
},
},
},
{
"type":"function",
"function":{
"name":"get_n_day_weather_forecast",
"description":"Get an N-day weather forecast",
"parameters":{
"type":"object",
"properties":{
"location":{
"type":"string",
"description":"The city and state, e.g. San Francisco, CA",
},
"format":{
"type":"string",
"enum":["celsius","fahrenheit"],
"description":"The temperature unit to use. Infer this from the users location.",
},
"num_days":{
"type":"integer",
"description":"The number of days to forecast",
},
},
"required":["location","format","num_days"],
},
},
},
]
@pytest.mark.asyncio
@pytest.mark.private
asyncdeftest_flash_llama_grammar_no_tools(
flash_llama_grammar_tools,response_snapshot
):
response=awaitflash_llama_grammar_tools.chat(
max_tokens=100,
seed=1,
messages=[
{
"role":"system",
"content":"Youre a helpful assistant! Answer the users question best you can.",
},
{
"role":"user",
"content":"What is the weather like in Brooklyn, New York?",
},
],
)
assert(
response.choices[0].message.content
=="As of today, there is a Update available for the Brooklyn, New York, area. According to the latest forecast, it's warm with high temperatures throughout the day. It's forecasted at 75°F for today and 77°F for tomorrow. However, in autumn, the weather typically changes drastically, becoming cooler and wetter. You can find the current weather forecast for the area through your local weather service. Additionally"