Add Conversation AI to Java SDK - #1235
Conversation
68d30ee to
9a8926e
Compare
|
@salaboy, @artur-ciocanu please let me know what you think. Working on integration and unit tests in the meanwhile |
|
Great contribution, thanks @siri-varma |
4cb6031 to
75f487f
Compare
|
this is great @siri-varma ! I will start reviewing soon! |
bf70fd4 to
88fe015
Compare
|
For integration tests, we must spin up a mock for third party LLM endpoint. Do we have similar patterns in the current setup? (where dapr is talking to a third party api and receiving responses) |
|
@siri-varma this is looking good, I left some comments that basically highlight my doubts about some JDK general topics. But this is looking really good, are you planning to add integration tests inside the |
|
@salaboy I have tested the code by running it locally and using my OpenAI API Key.
Will get back to you on the integ tests |
|
Yeah check this https://java.testcontainers.org/modules/ollama/ |
|
@salaboy thank you for providing the testcontainer urls. Like how we have url overrides for Scheduler, I was looking one for conversation too because we will have to point dapr to the local llm model. But could not find any I tried looking in the below places and could not find anything. https://github.com/dapr/dapr/blob/2e7c61e933099b9d40fcdefbd57cc3e81069915a/pkg/injector/annotations/annotations.go#L73 |
|
@siri-varma thanks a lot for your contribution. I have reviewed your PR and I have a few comments similar to #1255:
|
artur-ciocanu
left a comment
There was a problem hiding this comment.
@siri-varma thanks a lot for your contribution, I have left a longer comment with some of my thoughts.
Please take a look and let me know what you think.
115b5e7 to
842b0e7
Compare
@artur-ciocanu Addressed all the comments here as well. |
|
@artur-ciocanu , @salaboy All the builds are passing and addressed comments as well. Would you folks be able to do another round of reviews please ? |
cicoyle
left a comment
There was a problem hiding this comment.
Generally this looks great 🌟 - mind adding an example for conversation api to the examples directory in the repo with the mechanical markdown in the README with a sample .java file for users to know how to use the API?
We should also document the high level things that are expected when adding new APIs to the SDK to lower the barrier to entry for future developers and for consistency. Thanks for this PR 🚀 We are nearly there!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1235 +/- ##
============================================
+ Coverage 76.91% 77.42% +0.50%
- Complexity 1592 1764 +172
============================================
Files 145 204 +59
Lines 4843 5368 +525
Branches 562 587 +25
============================================
+ Hits 3725 4156 +431
- Misses 821 899 +78
- Partials 297 313 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR Overview: Conversation AI SDK Integration
This PR introduces the Conversation AI SDK with the Converse API. The implementation is structured into the following categories:
Core Logic
The core logic is implemented in a key class, as detailed below:
- Validates inputs and manages job execution.
API Contracts
The following is the method signature for the Dapr Converse API:
Dapr Converse API
This method interacts with the Dapr Converse API.
conversationComponentNamedaprConversationInputscontextIdscrubPiitemperatureDaprConversationResponseModels
The SDK follows the builder pattern for constructing models, ensuring cleaner and more maintainable object creation.
Tests
The testing strategy includes:
Issue Reference
We ensure that all PRs are linked to a relevant issue where the problem or feature has been discussed before implementation.
This PR closes the following issue: #1101
Checklist ✅
Please confirm the following before merging: