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
Ollama add OkhttpClient inject #911
Ollama add OkhttpClient inject #911
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Martin7-1 thanks a lot!
Please avoid adding OkHttpClient
to Ollama*Model
API as we plan to move away from okhttp pretty soon.
Instead, I would propose to allow the user to do the following (we already have this in OpenAiChatModel
):
OllamaChatModel.builder()
...
.defaultHeaders(Map.of("Authorization", "Bearer ..."))
.build();
WDYT?
@langchain4j I think it's a good idea! Will change soon. |
@langchain4j Hi! I've change it without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Martin7-1 thank you!
langchain4j-ollama/src/main/java/dev/langchain4j/model/ollama/OllamaClient.java
Outdated
Show resolved
Hide resolved
langchain4j-ollama/src/main/java/dev/langchain4j/model/ollama/OllamaClient.java
Outdated
Show resolved
Hide resolved
@Martin7-1 regarding testing, we can do manual testing here if there is no easy way to automate it. |
Ok. I will add some tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Martin7-1 thank you a lot!
@Martin7-1 Could you please add this new parameter to https://github.com/langchain4j/langchain4j-spring/blob/main/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/AutoConfig.java? |
@langchain4j ok. I've done it in langchain4j-spring#21. |
Context
see #586
Change
Add
OkhttpClient
injection inOllama
modelsChecklist
Before submitting this PR, please check the following points:
Checklist for adding new embedding store integration