Skip to content

Commit ffe9f14

Browse files
committed
apply suggestions
1 parent baa5725 commit ffe9f14

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ For SAP internal development, you can also use `SNAPSHOT` builds from the [inter
159159

160160
The AI SDK leverages the destination concept from the SAP Cloud SDK to manage the connection to AI Core.
161161
This opens up a wide range of possibilities to customize the connection, including adding custom headers.
162+
The following shows how to add custom headers to all requests sent to AI Core.
162163

163164
```java
164165
var service = new AiCoreService();
@@ -170,18 +171,19 @@ var destination =
170171
// AI Core client
171172
service = service.withBaseDestination(destination);
172173
DeploymentApi client = new DeploymentApi(service);
173-
174-
// Orchestration client
175-
OrchestrationClient client = new OrchestrationClient(destination);
176-
177-
// OpenAI client
178-
OpenAiClient client2 = OpenAiClient.withCustomDestination(destination);
179174
```
180175

181176
For more information, please refer to the [AI Core connectivity guide](https://sap.github.io/ai-sdk/docs/java/guides/connecting-to-ai-core) and the [SAP Cloud SDK documentation](https://sap.github.io/cloud-sdk/docs/java/features/connectivity/http-destinations).
182177

183-
There is also a convenient method to add custom headers to single calls through the orchestration or OpenAI client.
184-
For more information, see the respective documentation of the [OrchestrationClient](https://sap.github.io/ai-sdk/docs/java/orchestration/chat-completion#custom-headers) and [OpenAIClient](https://sap.github.io/ai-sdk/docs/java/foundation-models/openai/chat-completion#custom-headers).
178+
There is also a convenient method to add custom headers to single calls through the Orchestration or OpenAI client.
179+
180+
```java
181+
var client = new OrchestrationClient();
182+
183+
var result = client.withHeader("my-header-key", "my-header-value").chatCompletion(prompt, config);
184+
```
185+
186+
For more information on this feature, see the respective documentation of the [OrchestrationClient](https://sap.github.io/ai-sdk/docs/java/orchestration/chat-completion#custom-headers) and [OpenAIClient](https://sap.github.io/ai-sdk/docs/java/foundation-models/openai/chat-completion#custom-headers).
185187

186188
### _"There's a vulnerability warning `CVE-2021-41251`?"_
187189

0 commit comments

Comments
 (0)