ollama icon indicating copy to clipboard operation
ollama copied to clipboard

Tools support in ChatCompletion endpoints

Open pamelafox opened this issue 1 year ago • 7 comments

We'd love tools support so we can use ollama with our existing OpenAI-using apps. Not sure if that's possible across the board with all models.

pamelafox avatar Feb 08 '24 22:02 pamelafox

+1

carsonkahn-external avatar Feb 09 '24 02:02 carsonkahn-external

Does that mean we should implement something similar to OpenAI's Assistant API? Like code interpreter, retreival, etc., right?

Tanmaypatil123 avatar Feb 11 '24 18:02 Tanmaypatil123

My request is only that the chat completion endpoint support the tools parameter (and related tool_choice): https://platform.openai.com/docs/api-reference/chat#chat/create-functions

I do see that assistants also support tools, but that would be a much bigger feature.

pamelafox avatar Feb 13 '24 04:02 pamelafox

My request is only that the chat completion endpoint support the tools parameter (and related tool_choice): https://platform.openai.com/docs/api-reference/chat#chat/create-functions

I do see that assistants also support tools, but that would be a much bigger feature.

+1 updated link https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools

maxbaines avatar Feb 28 '24 14:02 maxbaines

+1 Mistral model

https://docs.mistral.ai/guides/function-calling/

rh-id avatar Mar 07 '24 05:03 rh-id

https://docs.mistral.ai/guides/function-calling/

is the tools argument defined in the same way in Mistral and OpenAI ?

# mistral
response = client.chat(model=model, messages=messages, tools=tools, tool_choice="auto")
..
#openai
        response = client.chat.completions.create(
            model=model,
            messages=messages,
            tools=tools,
            tool_choice=tool_choice,
        )

grigio avatar Mar 07 '24 21:03 grigio

new function calling model:

https://huggingface.co/NousResearch/Hermes-2-Pro-Mistral-7B

I suggest looking at the llama cpp python implementation for functionary (a chat handler).

Benjoyo avatar Mar 14 '24 13:03 Benjoyo

+1

humcqc avatar May 29 '24 18:05 humcqc

any updates ? A must to have feature IMO

jboz avatar Jun 13 '24 17:06 jboz

Thanks for the issue! Merging with #4386!

jmorganca avatar Jun 25 '24 04:06 jmorganca