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

Bug: Ollama connector does not send the tools/agents/functions list #9682

Open
raffaeler opened this issue Nov 13, 2024 · 2 comments
Open

Bug: Ollama connector does not send the tools/agents/functions list #9682

raffaeler opened this issue Nov 13, 2024 · 2 comments
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@raffaeler
Copy link

Describe the bug
I am using Semantic Kernel with Ollama and llama 3.2.

When I use the Ollama connector, the functions are not added to http request.
The same code and prompt using Azure OpenAI works correctly.

To Reproduce
OllamaFunctionCalling sample.

Expected behavior
I expect the functions being called.

Platform

  • OS: Windows 11
  • IDE: VS2022
  • Language: C# / .NET 9
  • Source: 1.28 alpha / preview

Details
I tried the same prompt on GPT and then on Ollama hosted locally.
When I use Ollama I specify the following settings:

KernelFunction[] functions = kernel.Plugins
                .SelectMany(p => p).ToArray();
FunctionChoiceBehavior functionOptions = FunctionChoiceBehavior.Required(functions, true); 

OllamaPromptExecutionSettings ollamaPromptExecutionSettings =
    new()
    {
        FunctionChoiceBehavior = functionOptions,
        ModelId = modelName,
        //...
    }

I also tried FunctionChoiceBehavior.Auto() wit no success.

I then passed my own HttpClient with a handler which logs all the http traffic. This is the result:

{"model":"llama3.2","messages":[{"role":"system","content":"","images":null,"tool_calls":null},{"role":"user","content":"What's the weather like in Genoa right now?","images":null,"tool_calls":null}],"options":{"temperature":0.85,"top_p":0.9},"stream":true,"tools":null,"CustomHeaders":{}}
@raffaeler raffaeler added the bug Something isn't working label Nov 13, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Nov 13, 2024
@github-actions github-actions bot changed the title Bug: Ollama connector does not send the tools/agents/functions .Net: Bug: Ollama connector does not send the tools/agents/functions Nov 13, 2024
@raffaeler raffaeler changed the title .Net: Bug: Ollama connector does not send the tools/agents/functions Bug: Ollama connector does not send the tools/agents/functions list Nov 13, 2024
@raffaeler
Copy link
Author

BTW what are the capabilities of this connector? It looks like it does not support multimodality.
In other words, a new prompt contains the image but the http message does not.

@shethaadit
Copy link
Contributor

shethaadit commented Nov 15, 2024

Hi @markwallace-microsoft / @RogerBarreto, I will work on this and try to raise PR soon. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
Status: Bug
Development

No branches or pull requests

4 participants