Skip to content

feat: add resp format, model, prompt cache, usage metrics to conversation api#9241

Merged
cicoyle merged 29 commits into
dapr:masterfrom
sicoyle:feat-convo-api-more-fields
Jan 19, 2026
Merged

feat: add resp format, model, prompt cache, usage metrics to conversation api#9241
cicoyle merged 29 commits into
dapr:masterfrom
sicoyle:feat-convo-api-more-fields

Conversation

@sicoyle

@sicoyle sicoyle commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Description

This PR reviews the fields in the Conversation API from a Dapr Agents perspective, evaluates which ones we actually need, and aligns our API more closely with OpenAI’s where it makes sense (ie adding fields/commenting on ones we can add in future). Specifically, I’ve:

  • Updated the meaning of the metadata field. This is not component metadata (as some quickstarts/docs currently imply), but rather additional metadata passed through to the LLM provider. I do need feedback on this please.
  • Identified two fields we don’t use at all (context_id and parameters) and marked them with TODO comments for removal once the API is stable for in future.
  • Added a response_format field, which is required for Dapr Agents when using the Conversation API to request responses in a specific JSON schema.
  • Bumped the LangChain package version.

Still TODO:

  • Update integration tests to reflect these changes.
  • Open contrib PR bubbling these fields over to the LLM providers and fully test out these fields for the different conversation components
  • I will likely open a separate PR or just add in usage metrics fields too on the response

Opening to get early feedback on the changes.

Issue reference

Please reference the issue this PR will close: #[issue number]

Checklist

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

@sicoyle sicoyle changed the title feat: new fields and tweaks for conversation api [WIP splitting this up] feat: new fields and tweaks for conversation api Jan 6, 2026
@sicoyle

sicoyle commented Jan 6, 2026

Copy link
Copy Markdown
Contributor Author

ignore this please as I am WIP splitting this into different PRs

Signed-off-by: Samantha Coyle <[email protected]>
@sicoyle sicoyle changed the title [WIP splitting this up] feat: new fields and tweaks for conversation api feat: new fields and tweaks for conversation api Jan 8, 2026
@sicoyle sicoyle changed the title feat: new fields and tweaks for conversation api feat: add resp format, timeout, model override to conversation api Jan 8, 2026
@sicoyle
sicoyle marked this pull request as ready for review January 9, 2026 14:19
@sicoyle
sicoyle requested review from a team as code owners January 9, 2026 14:19
@sicoyle sicoyle changed the title feat: add resp format, timeout, model override to conversation api feat: add resp format and model override to conversation api Jan 12, 2026
Signed-off-by: Samantha Coyle <[email protected]>
@sicoyle sicoyle changed the title feat: add resp format and model override to conversation api feat: add resp format to conversation api Jan 12, 2026
Signed-off-by: Samantha Coyle <[email protected]>
@sicoyle sicoyle changed the title feat: add resp format to conversation api feat: add resp format to conversation api + model in response Jan 12, 2026
Signed-off-by: Samantha Coyle <[email protected]>
Comment thread dapr/proto/runtime/v1/ai.proto Outdated
Comment thread tests/integration/suite/daprd/conversation/alpha2/grpc/basic.go Outdated
Comment on lines +294 to +295
// The model used for the conversation.
optional string model = 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this not be at the ConversationResponseAlpha2 level?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread dapr/proto/runtime/v1/ai.proto Outdated
Comment on lines +75 to +82
// Set of 16 key-value pairs that can be attached to the conversation.
// This can be useful for storing additional information about the object in a structured format,
// and querying for objects via API or the dashboard.
// Keys are strings with a maximum length of 64 characters.
// Values are strings with a maximum length of 512 characters.

// TODO: decide because this is a design decision that I need input on.
// Langchain that we use keeps this as map[string]any, but openai uses map[string]string, so which to go with?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NOTE: I can leave this alone for now and circle back to this decision but keeping for now at least for discussion here.

Comment on lines +294 to +295
// The model used for the conversation.
optional string model = 2;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sicoyle

sicoyle commented Jan 16, 2026

Copy link
Copy Markdown
Contributor Author

Merged the prompt cache and usage metrics PR from #9265
into this branch. Now there’s only one PR to update the contrib reference on, which also reduces conflicts since everything is consolidated into a single PR.

Signed-off-by: Samantha Coyle <[email protected]>
@sicoyle sicoyle changed the title feat: add resp format to conversation api + model in response feat: add resp format, model, prompt cache, usage metrics to conversation api Jan 16, 2026
@sicoyle

sicoyle commented Jan 16, 2026

Copy link
Copy Markdown
Contributor Author

ready for review pls :)

JoshVanL
JoshVanL previously approved these changes Jan 19, 2026
@JoshVanL JoshVanL added automerge Allows DaprBot to automerge and update PR if all approvals are in place autoupdate DaprBot will keep the Pull Request up to date with master branch labels Jan 19, 2026
cicoyle
cicoyle previously approved these changes Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Allows DaprBot to automerge and update PR if all approvals are in place autoupdate DaprBot will keep the Pull Request up to date with master branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants