Skip to content

Commit b4b7955

Browse files
author
Yuujee
committed
code format
1 parent 205e383 commit b4b7955

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

camel/societies/workforce/dynamic_agent.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14+
import json
1415

1516
from pydantic import BaseModel, Field
1617

@@ -93,8 +94,11 @@ def generate_prompt(self, task_content: str) -> PromptModel:
9394
)
9495

9596
agent = ChatAgent(system_message=prompt, model=model)
97+
9698
response = agent.step(task_content, response_format=self.PromptModel)
97-
return response.msgs[0].content
99+
content_str = response.msgs[0].content
100+
content_dict = json.loads(content_str)
101+
return self.PromptModel(**content_dict)
98102

99103
def select_tools(self, task_content: str) -> list:
100104
r"""

0 commit comments

Comments
 (0)