Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

update format_exps

seehif61506bd3220
diff --git a/metagpt/exp_pool/context_builders/base.py b/metagpt/exp_pool/context_builders/base.py
index e3fe320a6..a261e452e 100644
--- a/metagpt/exp_pool/context_builders/base.py
+++ b/metagpt/exp_pool/context_builders/base.py
@@ -25,7 +25,8 @@ class BaseContextBuilder(BaseModel, ABC):
result = []
for i, exp in enumerate(self.exps, start=1):
- result.append(f"{i}. " + EXP_TEMPLATE.format(req=exp.req, resp=exp.resp, score=exp.metric.score.val))
+ score_val = exp.metric.score.val if exp.metric and exp.metric.score else "N/A"
+ result.append(f"{i}. " + EXP_TEMPLATE.format(req=exp.req, resp=exp.resp, score=score_val))
return "\n".join(result)