Skip to content

Conversation

AgentSchmecker
Copy link
Contributor

@AgentSchmecker AgentSchmecker commented Dec 7, 2024

This PR should apply the following:

  • Extend ToolCalls to be used in Chat API Context (i.e extend the ChatRequest/Response models to use Tools)
  • Separate chat and generate server call logic as they have diverged a lot
  • When calling ChatAPI with Tools, automatically call the server side callback method and return the results as new request to the ollama api using the TOOL user.
  • Create a test sampling the implicit tool call
  • Add implicit tool-calling for streamed chatAPI requests
  • Add documentation for this feature
  • Cleanup Endpoint-Caller Superclass

@AgentSchmecker AgentSchmecker force-pushed the feature/toolextension_for_chat_model branch from f98a80b to c4b7830 Compare December 7, 2024 00:19
@AgentSchmecker AgentSchmecker marked this pull request as ready for review December 9, 2024 22:41
@AgentSchmecker
Copy link
Contributor Author

When merging this PR, the chat Requests can be sent to Ollama and all registered Tools will be injected automatically to the requests. In case the assistant responds with a tool call, the corresponding callback method is called directly and the result is added to chat history with the 'tool' user. This new request is resent to the chat API that now has all required information to create an answer to the original question.

@amithkoujalgi please feel free to review the PR.

@amithkoujalgi amithkoujalgi merged commit 8b3417e into ollama4j:main Dec 17, 2024
@amithkoujalgi
Copy link
Collaborator

Thanks a lot for the PR @AgentSchmecker! Looks good 👍🏼

@AgentSchmecker AgentSchmecker deleted the feature/toolextension_for_chat_model branch December 17, 2024 08:12
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