Skip to content

Commit a1ad02a

Browse files
committed
Update action_node.py
1 parent a01156d commit a1ad02a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

metagpt/actions/action_node.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,22 +541,22 @@ async def code_fill(
541541
result = {field_name: extracted_code}
542542
return result
543543

544-
async def single_fill(self, context: str) -> Dict[str, str]:
544+
async def single_fill(self, context: str, images: Optional[Union[str, list[str]]] = None) -> Dict[str, str]:
545545
field_name = self.get_field_name()
546546
prompt = context
547-
content = await self.llm.aask(prompt)
547+
content = await self.llm.aask(prompt, images=images)
548548
result = {field_name: content}
549549
return result
550550

551-
async def xml_fill(self, context: str) -> Dict[str, Any]:
551+
async def xml_fill(self, context: str, images: Optional[Union[str, list[str]]] = None) -> Dict[str, Any]:
552552
"""
553553
Fill context with XML tags and convert according to field types, including string, integer, boolean, list and dict types
554554
"""
555555
field_names = self.get_field_names()
556556
field_types = self.get_field_types()
557557

558558
extracted_data: Dict[str, Any] = {}
559-
content = await self.llm.aask(context)
559+
content = await self.llm.aask(context, images=images)
560560

561561
for field_name in field_names:
562562
pattern = rf"<{field_name}>(.*?)</{field_name}>"
@@ -635,12 +635,12 @@ async def fill(
635635

636636
elif mode == FillMode.XML_FILL.value:
637637
context = self.xml_compile(context=self.context)
638-
result = await self.xml_fill(context)
638+
result = await self.xml_fill(context, images=images)
639639
self.instruct_content = self.create_class()(**result)
640640
return self
641641

642642
elif mode == FillMode.SINGLE_FILL.value:
643-
result = await self.single_fill(context)
643+
result = await self.single_fill(context, images=images)
644644
self.instruct_content = self.create_class()(**result)
645645
return self
646646

0 commit comments

Comments
 (0)