Skip to content

feat(convo): add fields to conversation API#736

Open
1Ninad wants to merge 12 commits intodapr:mainfrom
1Ninad:feat-add-conversation-api-fields
Open

feat(convo): add fields to conversation API#736
1Ninad wants to merge 12 commits intodapr:mainfrom
1Ninad:feat-add-conversation-api-fields

Conversation

@1Ninad
Copy link
Copy Markdown

@1Ninad 1Ninad commented Mar 10, 2026

Description

Adds the Conversation API client to the JS SDK. Includes the two new request fields (responseFormat, promptCacheRetention) and two new response fields (model, usage). Unit tests cover all new fields for both HTTP and gRPC protocols.

Issue reference

closes #732

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

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

@1Ninad 1Ninad requested review from a team as code owners March 10, 2026 03:42
@1Ninad
Copy link
Copy Markdown
Author

1Ninad commented Mar 11, 2026

Hi @WhitWaldo @sicoyle, could you please review the PR and share your feedback when you get a chance?
Thanks.

@WhitWaldo
Copy link
Copy Markdown
Contributor

It'll probably be next week.

@sicoyle
Copy link
Copy Markdown

sicoyle commented Mar 13, 2026

Hi! 👋 thanks!! if you can run these commands pls and be sure to always sign your commits with git commit -sm "blah" in future so DCO build step is always happy :)

In your local branch, run: git rebase HEAD~1 --signoff
Force push your changes to overwrite the branch: git push --force-with-lease origin feat-add-conversation-api-fields

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds the Conversation API client to the Dapr JS SDK, supporting both HTTP and gRPC protocols (gRPC throws GRPCNotSupportedError). The implementation includes two new request fields (responseFormat, promptCacheRetention) and two new response fields (model, usage) as specified in issue #732.

Changes:

  • New HTTP and gRPC conversation client implementations with camelCase-to-snake_case mapping for the Dapr API
  • New types for conversation messages, inputs, options, and responses including token usage tracking
  • Public exports and DaprClient integration with unit tests for both protocols

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/implementation/Client/HTTPClient/conversation.ts HTTP conversation client with request/response field mapping
src/implementation/Client/GRPCClient/conversation.ts gRPC stub that throws GRPCNotSupportedError
src/implementation/Client/DaprClient.ts Wires conversation client into DaprClient for both protocols
src/interfaces/Client/IClientConversation.ts Interface for conversation client
src/types/conversation/ConversationMessage.type.ts Message types with role-based union
src/types/conversation/ConversationInput.type.ts Input type with messages and scrubPII
src/types/conversation/ConversationOptions.type.ts Options type with new responseFormat and promptCacheRetention fields
src/types/conversation/ConversationResponse.type.ts Response type with new model and usage fields
src/index.ts Public exports for all new conversation types
test/unit/protocols/http/conversation.test.ts HTTP conversation unit tests
test/unit/protocols/grpc/conversation.test.ts gRPC conversation unit test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d1bf38a) to head (7c540e3).
⚠️ Report is 36 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #736   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            6         6           
  Branches         1         1           
=========================================
  Hits             6         6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@1Ninad 1Ninad force-pushed the feat-add-conversation-api-fields branch from 9249254 to bfb89ba Compare March 14, 2026 00:17
@1Ninad
Copy link
Copy Markdown
Author

1Ninad commented Mar 16, 2026

@sicoyle I've updated pubsub.ts to address CI failure. Please review and let me know your feedback.

@WhitWaldo
Copy link
Copy Markdown
Contributor

@1Ninad You're going to ultimately need to sign your commits before we can merge this as well. I'll try to get this reviewed this week.

1Ninad and others added 5 commits March 17, 2026 02:50
Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
Fix by Copilot

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ninad Kale <145228622+1Ninad@users.noreply.github.com>
Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
…wire format

Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
@1Ninad 1Ninad force-pushed the feat-add-conversation-api-fields branch from ea6f8dc to 177b248 Compare March 16, 2026 21:21
@1Ninad
Copy link
Copy Markdown
Author

1Ninad commented Mar 17, 2026

@1Ninad You're going to ultimately need to sign your commits before we can merge this as well. I'll try to get this reviewed this week.

Done

@1Ninad
Copy link
Copy Markdown
Author

1Ninad commented Mar 23, 2026

Hi @sicoyle @WhitWaldo, could you please review this and let me know if any changes are required? Thanks.

@sicoyle
Copy link
Copy Markdown

sicoyle commented Mar 27, 2026

Hi @sicoyle @WhitWaldo, could you please review this and let me know if any changes are required? Thanks.

If you could add some tests to make the codecov build step happy then that would be great @1Ninad 🙏

yaron2 and others added 3 commits March 31, 2026 09:28
Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
@1Ninad 1Ninad force-pushed the feat-add-conversation-api-fields branch from e826ba6 to 16202ef Compare April 2, 2026 15:05
@1Ninad
Copy link
Copy Markdown
Author

1Ninad commented Apr 3, 2026

Hi @sicoyle @WhitWaldo, looks like the E2E failures might not be related to this PR.
Would appreciate guidance on whether this is a known flaky test or if there's something specific I should look at.

@WhitWaldo
Copy link
Copy Markdown
Contributor

It's probably flaky - one of my many goals this release. I'll review and get this merged soon.

@1Ninad
Copy link
Copy Markdown
Author

1Ninad commented Apr 4, 2026

It's probably flaky - one of my many goals this release. I'll review and get this merged soon.

Thank you 👍

Copy link
Copy Markdown
Contributor

@WhitWaldo WhitWaldo left a comment

Choose a reason for hiding this comment

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

First of all - thank you for putting this PR together!

Several of the types do not match what's in the prototypes. I've linked to their relevant bits for your convenience. While I'm perfectly fine referring to the statistics as input/output tokens instead of prom[t/completion tokens, we shouldn't seek to flatten any of the options or responses at this time until the API is in a stable place.

Unfortunately, this means the test will also need some changes, so I didn't review that until it's synced up.

Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
@1Ninad 1Ninad requested a review from WhitWaldo April 5, 2026 12:54
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.

[1.17] Add Conversation API new fields

5 participants