Skip to content
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

Add Conversation AI to Java SDK #1235

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

siri-varma
Copy link

@siri-varma siri-varma commented Mar 6, 2025

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
  • Models
  • Unit Tests

Core Logic

The core logic is implemented in a key class, as detailed below:

Class Description Details
DaprConversationClient Manages the Conversation API. Handles validations and async calls. - Calls the Conversation API asynchronously.
- 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.

Mono<DaprConversationResponse> converse(
    String conversationComponentName,
    List<DaprConversationInput> daprConversationInputs,
    String contextId,
    boolean scrubPii,
    double temperature
);
Parameter Description
conversationComponentName Name of the conversation component.
daprConversationInputs List of prompts that are part of the conversation.
contextId Identifier for an existing chat session (e.g., similar to ChatGPT).
scrubPii Whether to scrub personally identifiable information (PII) from responses.
temperature Controls response randomness (lower = more predictable, higher = more creative).
Returns DaprConversationResponse

Models

The SDK follows the builder pattern for constructing models, ensuring cleaner and more maintainable object creation.


Tests

The testing strategy includes:

  • Unit Tests: Validate individual components and business logic.

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:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@siri-varma siri-varma requested review from a team as code owners March 6, 2025 16:51
@siri-varma siri-varma force-pushed the users/svegiraju/conversation-api-2 branch from 68d30ee to 9a8926e Compare March 6, 2025 16:52
@siri-varma
Copy link
Author

siri-varma commented Mar 6, 2025

@salaboy, @artur-ciocanu please let me know what you think. Working on integration and unit tests in the meanwhile

@yaron2
Copy link
Member

yaron2 commented Mar 6, 2025

Great contribution, thanks @siri-varma

@cicoyle cicoyle added this to the v1.15 milestone Mar 6, 2025
@siri-varma siri-varma force-pushed the users/svegiraju/conversation-api-2 branch from 9a8926e to 4cb6031 Compare March 6, 2025 19:10
Signed-off-by: Siri Varma Vegiraju <[email protected]>
Signed-off-by: sirivarma <[email protected]>
@siri-varma siri-varma force-pushed the users/svegiraju/conversation-api-2 branch from 4cb6031 to 75f487f Compare March 6, 2025 19:11
@salaboy
Copy link
Contributor

salaboy commented Mar 6, 2025

this is great @siri-varma ! I will start reviewing soon!

Signed-off-by: sirivarma <[email protected]>
@siri-varma siri-varma force-pushed the users/svegiraju/conversation-api-2 branch from bf70fd4 to 88fe015 Compare March 7, 2025 04:27
@siri-varma
Copy link
Author

siri-varma commented Mar 7, 2025

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 siri-varma changed the title WIP: Add Conversation AI to Java SDK Add Conversation AI to Java SDK Mar 8, 2025
@salaboy salaboy mentioned this pull request Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants