1. add vision config in config.yaml

2. add imitate_webpage.py in example
3. update vision.py
This commit is contained in:
mannaandpoem 2024-01-15 11:13:35 +08:00
parent 40f5d5e40e
commit f45a368be2
3 changed files with 65 additions and 25 deletions

View file

@ -0,0 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2024/01/15
@Author : mannaandpoem
@File : imitate_webpage.py
"""
from metagpt.roles.code_interpreter import CodeInterpreter
async def main():
prompt = """This is a URL of webpage: https://cn.bing.com/
Firstly, utilize Selenium and WebDriver for rendering.
Secondly, convert image to a webpage including HTML, CSS and JS in one go.
Finally, save webpage in a text file.
Note: All required dependencies and environments have been fully installed and configured."""
ci = CodeInterpreter(goal=prompt, use_tools=True)
await ci.run(prompt)
if __name__ == '__main__':
import asyncio
asyncio.run(main())