ScaleLLM icon indicating copy to clipboard operation
ScaleLLM copied to clipboard

does the current openai-copatible-API support function calls?

Open lyj555 opened this issue 1 year ago • 1 comments

like format

    response = client.chat.completions.create(
        model=model,
        messages=[
            {
                "role": "system",
                "content": "You are a helpful assistant that helps decide whether the customer comment violates the community guidelines. Reviews should not be offensive, abusive, or contain any personal information.",
            },
            {
                "role": "user",
                "content": "customer comment: " + content,
            }
        ],
        tools=[
            {
                "type": "function",
                "function": {
                    "name": "respond_to_comment",
                    "parameters": {
                        "type": "object",
                        "properties": {
                            "is_safe": {
                                "type": "boolean",
                            },
                        },
                        "required": ["is_safe"],
                    },
                },
            }
        ],
        max_tokens=20,
    )

lyj555 avatar Apr 10 '24 06:04 lyj555

Hello, at the moment, function calling isn't supported, but it's on our roadmap. It's worth noting that there are few open-source models with this capability currently available. As far as I know, fine-tuning is necessary to enable function calling.

guocuimi avatar Apr 14 '24 04:04 guocuimi