mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-02 14:45:17 +02:00
refine code
This commit is contained in:
parent
b0b6fbbba4
commit
ba477a93d5
12 changed files with 67 additions and 56 deletions
|
|
@ -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 = []
|
||||
|
|
|
|||
|
|
@ -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"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue