You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all! I'm trying to run the tutorial from functionary here after launching a vLLM server. The code returns:
INFO: 127.0.0.1:48176 - "POST /v1/chat/completions HTTP/1.1" 200 OK
UNKNOWN FINISH REASON: 'tool_calls'. If you see this message, report it as an issue to https://github.com/rgbkrk/chatlab/issues
USER: What is the price of the car named 'Rhino'?
Any thoughts on what could be the problem? Thanks!
What I Did
import chatlab
import asyncio
def get_car_price(car_name: str):
"""this function is used to get the price of the car given the name
:param car_name: name of the car to get the price
"""
car_price = {
"rhino": {"price": "$20000"},
"elephant": {"price": "$25000"}
}
for key in car_price:
if key in car_name.lower():
return {"price": car_price[key]}
return {"price": "unknown"}
chat = chatlab.Chat(model="meetkai/functionary-small-v2.2", base_url="http://localhost:8000/v1", api_key="functionary")
chat.register(get_car_price)
asyncio.run(chat.submit("What is the price of the car named 'Rhino'?", stream=False))
for message in chat.messages:
role = message["role"].upper()
if "function_call" in message:
func_name = message["function_call"]["name"]
func_param = message["function_call"]["arguments"]
print(f"{role}: call function: {func_name}, arguments:{func_param}")
else:
content = message["content"]
print(f"{role}: {content}")
The text was updated successfully, but these errors were encountered:
Description
Hi all! I'm trying to run the tutorial from functionary here after launching a vLLM server. The code returns:
Any thoughts on what could be the problem? Thanks!
What I Did
The text was updated successfully, but these errors were encountered: