mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-02 16:01:04 +02:00
feat: fix coding
This commit is contained in:
parent
946e6fa8b3
commit
71b4922f55
7 changed files with 23 additions and 33 deletions
|
|
@ -13,7 +13,6 @@ import base64
|
|||
import sys
|
||||
|
||||
sys.path.append(str(Path(__file__).resolve().parent.parent.parent)) # fix-bug: No module named 'metagpt'
|
||||
from metagpt.utils.common import initialize_environment
|
||||
from metagpt.logs import logger
|
||||
from aiofile import async_open
|
||||
from azure.cognitiveservices.speech import AudioConfig, SpeechConfig, SpeechSynthesizer
|
||||
|
|
@ -109,8 +108,6 @@ async def oas3_azsure_tts(text, lang="", voice="", style="", role="", subscripti
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
initialize_environment()
|
||||
|
||||
loop = asyncio.new_event_loop()
|
||||
v = loop.create_task(oas3_azsure_tts("测试,test"))
|
||||
loop.run_until_complete(v)
|
||||
|
|
|
|||
|
|
@ -13,13 +13,10 @@ import sys
|
|||
import connexion
|
||||
|
||||
sys.path.append(str(Path(__file__).resolve().parent.parent.parent)) # fix-bug: No module named 'metagpt'
|
||||
from metagpt.utils.common import initialize_environment
|
||||
|
||||
|
||||
def oas_http_svc():
|
||||
"""Start the OAS 3.0 OpenAPI HTTP service"""
|
||||
initialize_environment()
|
||||
|
||||
app = connexion.AioHttpApp(__name__, specification_dir='../../.well-known/')
|
||||
app.add_api("metagpt_oas3_api.yaml")
|
||||
app.add_api("openapi.yaml")
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import requests
|
|||
from pydantic import BaseModel
|
||||
|
||||
sys.path.append(str(Path(__file__).resolve().parent.parent.parent)) # fix-bug: No module named 'metagpt'
|
||||
from metagpt.utils.common import initialize_environment
|
||||
from metagpt.logs import logger
|
||||
|
||||
|
||||
|
|
@ -104,8 +103,6 @@ async def oas3_metagpt_text_to_image(text, size_type: str = "512x512", model_url
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
initialize_environment()
|
||||
|
||||
v = oas3_metagpt_text_to_image("Panda emoji")
|
||||
data = base64.b64decode(v)
|
||||
with open("tmp.png", mode="wb") as writer:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import requests
|
|||
from pydantic import BaseModel
|
||||
|
||||
sys.path.append(str(Path(__file__).resolve().parent.parent.parent)) # fix-bug: No module named 'metagpt'
|
||||
from metagpt.utils.common import initialize_environment
|
||||
from metagpt.logs import logger
|
||||
|
||||
|
||||
|
|
@ -96,7 +95,5 @@ async def oas3_openai_text_to_image(text, size_type: str = "1024x1024", openai_a
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
initialize_environment()
|
||||
|
||||
v = oas3_openai_text_to_image("Panda emoji")
|
||||
print(v)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue