refactor: Update artifact handling in Component class
This commit is contained in:
parent
87d6b146b6
commit
33331dced8
1 changed files with 6 additions and 5 deletions
|
|
@ -114,6 +114,12 @@ class Component(CustomComponent):
|
|||
if not isinstance(custom_repr, str):
|
||||
custom_repr = str(custom_repr)
|
||||
raw = result
|
||||
if self.status is None:
|
||||
artifact_value = raw
|
||||
else:
|
||||
artifact_value = self.status
|
||||
raw = self.status
|
||||
|
||||
if hasattr(raw, "data") and raw is not None:
|
||||
raw = raw.data
|
||||
if raw is None:
|
||||
|
|
@ -123,11 +129,6 @@ class Component(CustomComponent):
|
|||
raw = raw.model_dump()
|
||||
if raw is None and isinstance(result, (dict, Data, str)):
|
||||
raw = result.data if isinstance(result, Data) else result
|
||||
if self.status is None:
|
||||
artifact_value = raw
|
||||
else:
|
||||
artifact_value = self.status
|
||||
raw = self.status
|
||||
artifact_type = get_artifact_type(artifact_value, result)
|
||||
raw = post_process_raw(raw, artifact_type)
|
||||
artifact = {"repr": custom_repr, "raw": raw, "type": artifact_type}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue