-
Notifications
You must be signed in to change notification settings - Fork 549
Open
Labels
kind/bugSomething isn't workingSomething isn't working
Description
Expected Behavior
Metadata should override any of the matching metadata fields from the component file
Actual Behavior
When calling converse_alpha2, any metadata you pass (e.g., model/key/cacheTTL) is ignored. The runtime still uses whatever is defined in the conversation component YAML; the request-level metadata never overrides the component settings.
Steps to Reproduce the Problem
Here is the modified quickstart I tried
from dapr.clients import DaprClient
from dapr.clients.grpc.conversation import (
ConversationInputAlpha2,
ConversationMessage,
ConversationMessageContent,
ConversationMessageOfUser,
)
with DaprClient() as d:
text_input = "What is dapr in 5 words?"
provider_component = "openai"
inputs = [
ConversationInputAlpha2(
messages=[
ConversationMessage(
of_user=ConversationMessageOfUser(
content=[ConversationMessageContent(text=text_input)]
)
)
],
scrub_pii=True,
),
]
metadata = {
"model": "gpt-4o-mini", # example: only works if the openai component honors this
"cacheTTL": "10m", # example: only if the component supports caching/ttl overrides
"trace-id": "abc123", # arbitrary key; ignored unless component uses it
}
print(f"Input sent: {text_input}")
response = d.converse_alpha2(
name=provider_component,
inputs=inputs,
temperature=0.7,
context_id="chat-123",
metadata=metadata, # ← per-request metadata
)
for output in response.outputs:
print(f"Output response: {output.choices[0].message.content}")
Release Note
RELEASE NOTE:
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingSomething isn't working