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
[FEATURE] Allow setting up customized http client to the underlying API #969
Comments
Implementation: #911 |
I think this feature is very useful, and we can implement a monitoring tool similar to Langsmith's based on Okhttp's interceptor mechanism, so I expect he'll be able to smash more models to be supported, such as OpenAI's.
|
We plan to get rid of okhttp as default http client in the near future, so please do not implement anything okhttp-specific. |
Can you give us the direction of future evolution? Are there any plans to support Kotlin Multiplatform? |
@madroidmaq this is planned in #1044 |
Is your feature request related to a problem? Please describe.
Currently, it is impossible to provide the customized
http client
using the availablelangchain4j
builders because theOkHttpClient
instantiation is hardcoded in numerous places, e.g.OllamaClient
:As stated above, only the
timeout
property is passed down to thehttp client
usingOllamaChatModel.builder().timeout(...)
method. There are numerous cases, where developers need to override some other properties of the underlyinghttp client
, e.g. most often but not only disabling: the ssl verification (https://stackoverflow.com/questions/25509296/trusting-all-certificates-with-okhttp).Describe the solution you'd like
Expose the builder method to pass the
http client
down to the underlying API, e.g. for ollama:The text was updated successfully, but these errors were encountered: