Skip to content

Prompt Fetching#4

Merged
Andrew Kent (realark) merged 3 commits into
mainfrom
ark/BRA-3165-prompt-fetching-api-outline
Oct 23, 2025
Merged

Prompt Fetching#4
Andrew Kent (realark) merged 3 commits into
mainfrom
ark/BRA-3165-prompt-fetching-api-outline

Conversation

@realark
Copy link
Copy Markdown
Collaborator

@realark Andrew Kent (realark) commented Oct 21, 2025

Example:

{ // simple example
    var prompt = braintrust.promptLoader().load("kind-greeter-69d2");
    var response =
            openAIClient
                    .chat()
                    .completions()
                    .create(
                            buildChatCompletionsPrompt(
                                    prompt, Map.of("name", "Sam Malone")));
    System.out.println("got response: %s".formatted(response.choices().get(0).message()));
}
{ // more complex prompt options
    var prompt =
            braintrust
                    .promptLoader()
                    .load(
                            PromptLoadRequest.builder()
                                    .projectName("andrew-misc")
                                    .promptSlug("unkind-greeter-fd4c")
                                    .version("cbbc711da9f7d445")
                                    .defaults("model", "gpt-3.5-turbo")
                                    .build());
    var response =
            openAIClient
                    .chat()
                    .completions()
                    .create(
                            buildChatCompletionsPrompt(
                                    prompt, Map.of("name", "Frasier Crane")));
    System.out.println("got response: %s".formatted(response));
}

@realark Andrew Kent (realark) force-pushed the ark/BRA-3165-prompt-fetching-api-outline branch 3 times, most recently from f07856f to 7fc149d Compare October 21, 2025 16:12
@realark Andrew Kent (realark) force-pushed the ark/BRA-3165-prompt-fetching-api-outline branch from de33568 to 5a7dc09 Compare October 21, 2025 17:57
@realark Andrew Kent (realark) changed the title api outline Prompt Fetching Oct 21, 2025
@realark Andrew Kent (realark) force-pushed the ark/BRA-3165-prompt-fetching-api-outline branch from eca8268 to da5a759 Compare October 23, 2025 01:26
@realark Andrew Kent (realark) marked this pull request as ready for review October 23, 2025 01:32
@realark Andrew Kent (realark) force-pushed the ark/BRA-3165-prompt-fetching-api-outline branch 3 times, most recently from d4ad8d3 to c61b40b Compare October 23, 2025 17:23
@realark Andrew Kent (realark) force-pushed the ark/BRA-3165-prompt-fetching-api-outline branch from 22e1e26 to 7eab143 Compare October 23, 2025 20:01
@realark Andrew Kent (realark) added the enhancement New feature or request label Oct 23, 2025
@realark Andrew Kent (realark) merged commit 026c090 into main Oct 23, 2025
1 check passed
@realark Andrew Kent (realark) deleted the ark/BRA-3165-prompt-fetching-api-outline branch October 23, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant