mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
feat: +pic2txt
This commit is contained in:
parent
9dc8d7307b
commit
742ff0e80a
11 changed files with 137 additions and 1 deletions
|
|
@ -0,0 +1,28 @@
|
|||
import pytest
|
||||
|
||||
from metagpt.actions.requirement_analysis.requirement.pic2txt import Pic2Txt
|
||||
from metagpt.const import TEST_DATA_PATH
|
||||
from metagpt.utils.common import aread
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_pic2txt(context):
|
||||
images = [
|
||||
TEST_DATA_PATH / "requirements/pic/1.png",
|
||||
TEST_DATA_PATH / "requirements/pic/2.png",
|
||||
TEST_DATA_PATH / "requirements/pic/3.png",
|
||||
TEST_DATA_PATH / "requirements/pic/4.png",
|
||||
TEST_DATA_PATH / "requirements/pic/5.png",
|
||||
]
|
||||
textual_user_requirements = await aread(filename=TEST_DATA_PATH / "requirements/1.original_requirement.txt")
|
||||
acknowledge = await aread(filename=TEST_DATA_PATH / "requirements/1.acknowledge.md")
|
||||
|
||||
action = Pic2Txt(context=context)
|
||||
rsp = await action.run(
|
||||
image_paths=images, textual_user_requirement=textual_user_requirements, acknowledge=acknowledge
|
||||
)
|
||||
assert rsp
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pytest.main([__file__, "-s"])
|
||||
Loading…
Add table
Add a link
Reference in a new issue