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

fix ollama function call bug #1095

Conversation

GuanyiLi-Craig
Copy link

fix ollama function calling bug.

Copy link
Contributor

@CorrM CorrM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes needed

"function": _function_def,
}
)
if tool_calls_result.invalid_json_format:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole scope should be wrapped inside if tool_calls_result.tool_calls is not None:
so it will make sure it is a tool call and it's not a structured_output, then check one of two states:

  • Invalid json format but its func call
  • Valid function call else

So if i edit the original code i will make these changes:

  • LINE 140: if tool_calls_result.tool_calls is not None:
  • LINE 144: else:

@CorrM
Copy link
Contributor

CorrM commented Aug 31, 2024

@GuanyiLi-Craig there some changes needed

@jacobweiss2305
Copy link
Contributor

Closing for now. We will need to update this to the Model class

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

Successfully merging this pull request may close these issues.

3 participants