rgbkrk / chatlab

⚡️🧪 Fast LLM Tool Calling Experimentation, big and smol
https://chatlab.dev
Other
138 stars 12 forks source link

Unkown Finish Reason: 'tool_calls' #120

Closed JakoLex closed 10 months ago

JakoLex commented 10 months ago

Description

I was just trying to get funtionary with chatlab to work and tried the flip a coin example: Without the chat.register() call or without asking the ai to call the function it works perfectly, but with the "Flip a coin" chat an unknown finish reason "tool_calls" displays.

What I Did

import asyncio
from chatlab import Chat
import os
import random
os.environ['OPENAI_API_KEY'] = "functionary"

def flip_a_coin():
    """this function is used to flip a coin"""
    return random.choice(["heads", "tails"])

chat = Chat(model="meetkai/functionary-7b-v2", base_url="http://localhost:8000/v1")
chat.register(flip_a_coin)
asyncio.run(chat("Flip a coin for me"))

UNKNOWN FINISH REASON: 'tool_calls'. If you see this message, report it as an issue to https://github.com/rgbkrk/chatlab/issues

JakoLex commented 10 months ago

Fixed it: asyncio.run(chat.submit("Please flip a coin for me", stream=0))