mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
experiment pool init
This commit is contained in:
parent
808d65b4c3
commit
d1198dc58d
1 changed files with 3 additions and 10 deletions
|
|
@ -9,20 +9,13 @@ from metagpt.logs import logger
|
|||
|
||||
async def main():
|
||||
req = "Simple task."
|
||||
resp = "Simple echo."
|
||||
|
||||
# 1. Find experiences.
|
||||
exps = await exp_manager.query_exps(req)
|
||||
if exps:
|
||||
logger.info(f"Experiences already exist for the request `{req}`: {exps}")
|
||||
return
|
||||
|
||||
# 2. Create a new experience if none exist
|
||||
exp_manager.create_exp(Experience(req=req, resp="Simple echo.", entry_type=EntryType.MANUAL))
|
||||
exp_manager.create_exp(Experience(req=req, resp=resp, entry_type=EntryType.MANUAL))
|
||||
logger.info(f"New experience created for the request `{req}`.")
|
||||
|
||||
# 3. Find again
|
||||
exps = await exp_manager.query_exps(req)
|
||||
logger.info(f"Updated experiences: {exps}")
|
||||
logger.info(f"Got experiences: {exps}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue