fix(backend): Fix json to_dict method on string value

This commit is contained in:
Zamil Majdy
2025-03-02 09:33:16 +07:00
parent a024b9a398
commit 1e31136358
3 changed files with 2 additions and 6 deletions

View File

@@ -552,7 +552,7 @@ class AIStructuredResponseGeneratorBlock(AIBlockBase):
default="",
description="The system prompt to provide additional context to the model.",
)
conversation_history: list[Any] = SchemaField(
conversation_history: list[dict] = SchemaField(
default=[],
description="The conversation history to provide context for the prompt.",
)

View File

@@ -53,7 +53,7 @@ class SmartDecisionMakerBlock(Block):
default="Thinking carefully step by step decide which function to call. Always choose a function call from the list of function signatures.",
description="The system prompt to provide additional context to the model.",
)
conversation_history: list[Any] = SchemaField(
conversation_history: list[dict] = SchemaField(
default=[],
description="The conversation history to provide context for the prompt.",
)

View File

@@ -11,10 +11,6 @@ from .type import type_match
def to_dict(data) -> dict:
if isinstance(data, BaseModel):
data = data.model_dump()
elif isinstance(data, str):
data = loads(data)
return jsonable_encoder(data)