-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree with you initially. But then I realized "responseText" reference is updated with the LLM response from previous step in line 71. Meaning there is no classic distinction user/system/assistant, they get mixed when the second iteration starts.
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:
Definition of Done
Tests cover the scope aboveError handling created / updated & covered by the tests aboveRelease notes updated