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
I am trying to use Spring AI in a multi-tenant application. The openAI api key needs to be set on a per request basis according to our user context. I think this functionality was added in #2164 however the documentation uses the OpenAiChatClient class which I cannot find in milestone 7 (appears to be gone after 0.8.1?). How can I set the api key for chat and embedding requests?
The text was updated successfully, but these errors were encountered:
The docs are wrong, there was never such a class. The OpenAiChatAutoConfiguration is not allowing one to override the use of SimpleApiKey.
Unfortunately, the @Bean definition that creates OpenAiChatModel contains many arguments, but that would seem to be the best way to add in your own implementation of the ApiKey interface, by basically reproducing what is here
I realize that isn't convenient. I think that the OpenAiChatModel should have some sort mutate() method (like in RestClient) so that you can get the autoconfigured one and then change a few details such as the implementation of the ApiKey interface used.
I am trying to use Spring AI in a multi-tenant application. The openAI api key needs to be set on a per request basis according to our user context. I think this functionality was added in #2164 however the documentation uses the
OpenAiChatClient
class which I cannot find in milestone 7 (appears to be gone after 0.8.1?). How can I set the api key for chat and embedding requests?The text was updated successfully, but these errors were encountered: