Examples: add automatic function calling helper#621
Open
XinyueZ wants to merge 6 commits intoollama:mainfrom
Open
Examples: add automatic function calling helper#621XinyueZ wants to merge 6 commits intoollama:mainfrom
XinyueZ wants to merge 6 commits intoollama:mainfrom
Conversation
- Rename `ollama_automatic_function_calling` to `ollama_chat_automatic_function_calling` - Add `options` parameter with default None - Pass `options` to client function call - Update docstring to clarify client_fn parameter - Remove duplicate import statement
- Move `think` parameter after `messages` for better parameter ordering - Add `options` dict with temperature, top_p, and top_k settings - Add comment showing think parameter accepts "low", true, or false
- Remove duplicate `from ollama import ChatResponse, chat` import - Initialize `messages` as empty list instead of getting from kwargs - Remove `reserved` set and `chat_kwargs` filtering logic - Add `think` parameter to client function call - Reformat client_fn call with explicit parameters on separate lines
- Add `messages` as explicit parameter instead of initializing empty list - Extract `tools` from kwargs for conditional tool_map initialization - Only initialize tool_map when both tool_map is None and tools exist - Add reserved parameters set and filter chat_kwargs - Remove hardcoded `think` parameter from client call - Add null check for tool_map before accessing in tool execution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consider making the automatic function calling helper idea official.