refine code

This commit is contained in:
geekan 2024-01-10 15:34:49 +08:00 committed by 莘权 马
parent b0b6fbbba4
commit ba477a93d5
12 changed files with 67 additions and 56 deletions

View file

@ -7,12 +7,12 @@
"""
from typing import Union
from metagpt.llm import LLM
from metagpt.provider.base_llm import BaseLLM
class Moderation:
def __init__(self):
self.llm = LLM()
def __init__(self, llm: BaseLLM):
self.llm = llm
def handle_moderation_results(self, results):
resp = []

View file

@ -16,9 +16,6 @@ from metagpt.provider.base_llm import BaseLLM
class OpenAIText2Image:
def __init__(self, llm: BaseLLM):
"""
:param openai_api_key: OpenAI API key, For more details, checkout: `https://platform.openai.com/account/api-keys`
"""
self.llm = llm
async def text_2_image(self, text, size_type="1024x1024"):