mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 01:36:29 +02:00
rag_add_objs catch exception
This commit is contained in:
parent
8e8075317e
commit
08f4e2ad70
1 changed files with 4 additions and 3 deletions
|
|
@ -122,14 +122,15 @@ class RAGExample:
|
|||
|
||||
logger.info("[After add objs]")
|
||||
self.engine.add_objs([player])
|
||||
nodes = await self._retrieve_and_print(question)
|
||||
|
||||
logger.info("[Object Detail]")
|
||||
try:
|
||||
nodes = await self._retrieve_and_print(question)
|
||||
|
||||
logger.info("[Object Detail]")
|
||||
player: Player = nodes[0].metadata["obj"]
|
||||
logger.info(player.name)
|
||||
except Exception as e:
|
||||
logger.info(f"ERROR: nodes is empty, llm don't answer correctly, exception: {e}")
|
||||
logger.error(f"nodes is empty, llm don't answer correctly, exception: {e}")
|
||||
|
||||
async def rag_ini_objs(self):
|
||||
"""This example show how to from objs, will print something like:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue