Merge branch 'dev' of https://github.com/geekan/MetaGPT into geekan/dev

This commit is contained in:
莘权 马 2023-12-26 19:13:13 +08:00
commit dce4696f17
57 changed files with 281 additions and 706 deletions

View file

@ -21,10 +21,6 @@ class OpenAIText2Image:
"""
self._llm = LLM()
def __del__(self):
if self._llm:
self._llm.close()
async def text_2_image(self, text, size_type="1024x1024"):
"""Text to image

View file

@ -4,7 +4,7 @@
import json
from pathlib import Path
from metagpt.provider.openai_api import OpenAIGPTAPI as GPTAPI
from metagpt.provider.openai_api import OpenAILLM as GPTAPI
ICL_SAMPLE = """Interface definition:
```text
@ -278,11 +278,11 @@ class UTGenerator:
question += self.build_api_doc(node, path, method)
self.ask_gpt_and_save(question, tag, summary)
def gpt_msgs_to_code(self, messages: list) -> str:
async def gpt_msgs_to_code(self, messages: list) -> str:
"""Choose based on different calling methods"""
result = ""
if self.chatgpt_method == "API":
result = GPTAPI().ask_code(msgs=messages)
result = await GPTAPI().aask_code(msgs=messages)
return result