mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-09 15:17:59 -05:00
fix(backend): Fix json to_dict method on string value
This commit is contained in:
@@ -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.",
|
||||
)
|
||||
|
||||
@@ -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.",
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user