Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unkown Finish Reason: 'tool_calls' #120

Closed
JakoLex opened this issue Dec 14, 2023 · 1 comment
Closed

Unkown Finish Reason: 'tool_calls' #120

JakoLex opened this issue Dec 14, 2023 · 1 comment

Comments

@JakoLex
Copy link

JakoLex commented Dec 14, 2023

  • ChatLab version: 1.1.1
  • Python version: 3.10.4
  • Operating System: Win 11

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
Copy link
Author

JakoLex commented Dec 16, 2023

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

@JakoLex JakoLex closed this as completed Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant