Skip to content

How to add fuctions for Ollama models #1531

Answered by ThomasVitale
ogbozoyan asked this question in Q&A
Discussion options

You must be logged in to vote

You can either pass the function name via the ChatClient API (example: https://github.com/ThomasVitale/llm-apps-java-spring-ai/blob/main/05-function-calling/function-calling-ollama/src/main/java/com/thomasvitale/ai/spring/ChatService.java) or via configuration properties.

If you use properties, based on your example, you would configure the function name as follows, where "testFunction" is the name of the method representing the function you want to make available to the model.

spring:
  ai:
    ollama:
      chat:
        options:
          functions:
            - "testFunction"

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ogbozoyan
Comment options

@ThomasVitale
Comment options

@ogbozoyan
Comment options

@ogbozoyan
Comment options

@ogbozoyan
Comment options

Answer selected by ogbozoyan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants