Skip to content

Commit

Permalink
Add Metering Header
Browse files Browse the repository at this point in the history
  • Loading branch information
MatKuhr committed Sep 4, 2024
1 parent faa62af commit d30590f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/com/sap/ai/sdk/core/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ static HttpDestination getDestination(@Nullable final String serviceKey) {
// generated code this is actually necessary, because the generated code assumes this
// path to be present on the destination
.uri(destination.getUri().resolve("/v2"))
.header("AI-Client-Type", "AI SDK Java")
.build();
return destination;
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/test/java/com/sap/ai/sdk/core/CoreTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void getDestinationWithEnvVarSucceedsLocally() {
}
}
""";
assertThat(getDestination(AICORE_SERVICE_KEY).asHttp().getUri().toString())
.isEqualTo("https://api.ai.core/v2");
var result = getDestination(AICORE_SERVICE_KEY).asHttp();
assertThat(result.getUri()).hasToString("https://api.ai.core/v2");
}
}

0 comments on commit d30590f

Please sign in to comment.