You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For now (as of version 0.29.1), it is not possible to specify a proxy when building a client for Mistral Ai (either usual or streaming). That makes the client almost unusable behind a corporate proxy (the way to circumvent that would require to configure system environment proxy variables, jeopardizing all other http client that would not need to pass through that proxy).
The idea would be to add that missing "proxy" method (here is and example of what it may look like with a streaming client) :
StreamingChatLanguageModel model = MistralAiStreamingChatModel.builder()
.proxy(new Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(PROXY_URL, PROXY_PORT)))
.apiKey(API_KEY)
.baseUrl(BASE_URL)
.modelName(MODEL_NAME)
.build();
Alternatives and workarounds while the feature is missing
Since there is no way to retreive (and then configure) the underlying http client before the actual http call, I did not find a way to get around that limitation.
Of course I see 2 workarounds that are not very promising
no use of langchain4j and basic http InputStream / outputStream implementation
system (jvm) proxy settings, that would create a big risk on other http clients hosted on the same jvm (would require a big overhaul of legacy code, and therefore a lot of regression testing). Of course if you have a brand new platform to play with, that is not an issue.
I could not find any other resource on that matter.
If someone has found another way, I would love to have some feedback 😁 .
The text was updated successfully, but these errors were encountered:
Context
For now (as of version 0.29.1), it is not possible to specify a proxy when building a client for Mistral Ai (either usual or streaming). That makes the client almost unusable behind a corporate proxy (the way to circumvent that would require to configure system environment proxy variables, jeopardizing all other http client that would not need to pass through that proxy).
Expected enhancement
Something that would look like what can be done in langchain4j-examples with the OpenAI client (and some others:
https://github.com/langchain4j/langchain4j-examples/blob/main/other-examples/src/main/java/ProxyExample.java
The idea would be to add that missing "proxy" method (here is and example of what it may look like with a streaming client) :
Alternatives and workarounds while the feature is missing
Since there is no way to retreive (and then configure) the underlying http client before the actual http call, I did not find a way to get around that limitation.
Of course I see 2 workarounds that are not very promising
I could not find any other resource on that matter.
If someone has found another way, I would love to have some feedback 😁 .
The text was updated successfully, but these errors were encountered: