Skip to content

feat: Convenience for custom headers for orchestration and OpenAI#550

Merged
Jonas-Isr merged 17 commits intomainfrom
feat-custom-headers
Sep 4, 2025
Merged

feat: Convenience for custom headers for orchestration and OpenAI#550
Jonas-Isr merged 17 commits intomainfrom
feat-custom-headers

Conversation

@Jonas-Isr
Copy link
Member

@Jonas-Isr Jonas-Isr commented Aug 21, 2025

Context

AI/ai-sdk-java-backlog#300

This PR introduces withHeader methods for OrchestrationClient and OpenAiClient. These methods either take tow strings (key and value of the header) or a Header object and return a new client where this header will be added to each call made from this client. This allows for convenient ways of adding custom headers to single calls (or groups thereof).

var client = new OrchestrationClient();

var result = client.withHeader("foo", "bar").chatCompletion(prompt, config);

Feature scope:

  • added withHeader methods to OrchestrationClient
  • added withHeader methods to OpenAiClient

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

@Jonas-Isr Jonas-Isr added the please-review Request to review a pull-request label Aug 22, 2025
Jonas-Isr and others added 5 commits August 26, 2025 16:40
# Conflicts:
#	docs/release_notes.md
…onmodels/openai/OpenAiClient.java

Co-authored-by: Alexander Dümont <22489773+newtork@users.noreply.github.com>
@Jonas-Isr Jonas-Isr merged commit 974375a into main Sep 4, 2025
7 checks passed
@Jonas-Isr Jonas-Isr merged commit 974375a into main Sep 4, 2025
7 checks passed
@Jonas-Isr Jonas-Isr deleted the feat-custom-headers branch September 4, 2025 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

please-review Request to review a pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants