Handle the case where provider is a string
Updated example
This commit is contained in:
@@ -1083,8 +1083,10 @@ class BaseWorkflowMixin(ABC):
|
||||
"provider_used": provider_name,
|
||||
}
|
||||
|
||||
# Add metadata to response
|
||||
response_data["metadata"] = metadata
|
||||
# Preserve existing metadata and add workflow metadata
|
||||
if "metadata" not in response_data:
|
||||
response_data["metadata"] = {}
|
||||
response_data["metadata"].update(metadata)
|
||||
|
||||
logger.debug(
|
||||
f"[WORKFLOW_METADATA] {self.get_name()}: Added metadata - "
|
||||
@@ -1102,7 +1104,10 @@ class BaseWorkflowMixin(ABC):
|
||||
"provider_used": "unknown",
|
||||
}
|
||||
|
||||
response_data["metadata"] = metadata
|
||||
# Preserve existing metadata and add workflow metadata
|
||||
if "metadata" not in response_data:
|
||||
response_data["metadata"] = {}
|
||||
response_data["metadata"].update(metadata)
|
||||
|
||||
logger.debug(
|
||||
f"[WORKFLOW_METADATA] {self.get_name()}: Added fallback metadata - "
|
||||
|
||||
Reference in New Issue
Block a user