From c07cf543bff0f6b734250898ca51d8b37f30bcf2 Mon Sep 17 00:00:00 2001 From: geekan Date: Wed, 3 Jan 2024 14:24:07 +0800 Subject: [PATCH] refine code --- metagpt/strategy/tot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metagpt/strategy/tot.py b/metagpt/strategy/tot.py index e67d272c7..ce94d0de1 100644 --- a/metagpt/strategy/tot.py +++ b/metagpt/strategy/tot.py @@ -5,7 +5,7 @@ from __future__ import annotations import asyncio -from typing import Any, List +from typing import Any, List, Optional from pydantic import BaseModel, ConfigDict, Field @@ -33,7 +33,7 @@ Output a list of jsons following the format: class ThoughtSolverBase(BaseModel): model_config = ConfigDict(arbitrary_types_allowed=True) - thought_tree: ThoughtTree | None = None + thought_tree: Optional[ThoughtTree] = Field(default=None) llm: BaseLLM = Field(default_factory=LLM, exclude=True) config: ThoughtSolverConfig = Field(default_factory=ThoughtSolverConfig)