Skip to content

feat: [OpenAI] Sample code for Agentic Workflow tutorial #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Jonas-Isr
Copy link
Member

Context

AI/ai-sdk-java-backlog#266

This PR adds sample code for the Java agentic workflow tutorial (link to docs PR is below).

Feature scope:

  • add sample code

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: PR
  • Release notes updated

@Jonas-Isr Jonas-Isr self-assigned this Jun 17, 2025
@Jonas-Isr Jonas-Isr added the please-review Request to review a pull-request label Jun 17, 2025
for (final String systemPrompt : systemPrompts) {

// Combine the pre-defined prompt with the previous answer to get the new input
val input = String.format("{%s}\n {%s}", systemPrompt, responseText);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Preference)

Looks like here we are mixing system prompt with user prompt, which should not be encouraged. I am assuming this is a simplification for the sake of demonstration. But, I would prefer if we distinguish the usage of user and system message correctly.

That said, SpringAi docs also seems to simply concatenate the messages, which is sus to me. Let me know if I missed something.

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.

2 participants