chore(deps): Update and centralize dependencies (#436)

* chore(deps): Update and centralize dependencies

* Update treesitter to 0.22.2
* Update kotlin to 1.9.23
* Update jackson to 2.17.0
* Update gradle-intellij-plugin to 1.17.3
* Update gradle to 8.7
* Use BOMs where possible
* Centralize dependencies in version catalog
* Allow Dependabot to update other modules (add treesitter and buildSrc/src/main/kotlin, remove core)

* fix: preload credentials only once for all headers
This commit is contained in:
Rene Leonhardt 2024-04-06 12:41:02 +02:00 committed by GitHub
parent 52ceaa6a26
commit 7f505e2c30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 71 additions and 32 deletions

View file

@ -216,10 +216,10 @@ public class CompletionRequestProvider {
List<OpenAIChatCompletionMessage> messages,
boolean streamRequest) {
var requestBuilder = new Request.Builder().url(customConfiguration.getUrl().trim());
var credential = CredentialsStore.INSTANCE.getCredential(CUSTOM_SERVICE_API_KEY);
for (var entry : customConfiguration.getHeaders().entrySet()) {
String value = entry.getValue();
var credential = CredentialsStore.INSTANCE.getCredential(CUSTOM_SERVICE_API_KEY);
if (value.contains("$CUSTOM_SERVICE_API_KEY") && credential != null) {
if (credential != null && value.contains("$CUSTOM_SERVICE_API_KEY")) {
value = value.replace("$CUSTOM_SERVICE_API_KEY", credential);
}
requestBuilder.addHeader(entry.getKey(), value);