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

.Net: Bug: OllamaPromptExecutionSettings with GetChatMessageContentsAsync = System.InvalidCastException: #10374

Open
mphacker opened this issue Feb 3, 2025 · 1 comment
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@mphacker
Copy link

mphacker commented Feb 3, 2025

Describe the bug
System.InvalidCastException: 'Unable to cast object of type 'System.Double' to type 'System.Nullable`1[System.Int32]'.' when using OllamaPromptExecutionSettings with GetChatMessageContentsAsync

To Reproduce
Steps to reproduce the behavior:

  1. create an instance of OllamaPromptExecutionSettings and set the Temperature and NumPredict properties.
  2. Execute var chatResponse = await chatCompletionService.GetChatMessageContentsAsync(ChatHistory,settings);
  3. Error is thrown

Expected behavior
Response from local LLM.

Screenshots
N/A

Platform

  • Language: C#
  • Source: Ollama connector: NuGet 1.35.0-alpha, SK: NuGet: 1.35.0
  • AI model: Ollama local
  • IDE: Visual Studio
  • OS: Windows

Additional context
If I remove the settings parameter from the GetchatMessageContentsAsync I get a valid response from the LLM.

@mphacker mphacker added the bug Something isn't working label Feb 3, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Feb 3, 2025
@github-actions github-actions bot changed the title Bug: OllamaPromptExecutionSettings with GetChatMessageContentsAsync = System.InvalidCastException: .Net: Bug: OllamaPromptExecutionSettings with GetChatMessageContentsAsync = System.InvalidCastException: Feb 3, 2025
@sphenry sphenry removed the triage label Feb 4, 2025
@sphenry
Copy link
Member

sphenry commented Feb 4, 2025

@RogerBarreto can you take a look?

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
None yet
Development

No branches or pull requests

4 participants