mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-05 14:55:18 +02:00
feat: +x-prerequisite
This commit is contained in:
parent
9b890275c4
commit
13eddeae2f
2 changed files with 11 additions and 7 deletions
|
|
@ -4,9 +4,11 @@ entities:
|
|||
- name: text_to_speech
|
||||
description: Text-to-speech
|
||||
id: text_to_speech.text_to_speech
|
||||
requisite:
|
||||
- AZURE_TTS_SUBSCRIPTION_KEY
|
||||
- AZURE_TTS_REGION
|
||||
x-prerequisite:
|
||||
- name: AZURE_TTS_SUBSCRIPTION_KEY
|
||||
description: "For more details, check out: [Azure Text-to_Speech](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts)"
|
||||
- name: AZURE_TTS_REGION
|
||||
description: "For more details, check out: [Azure Text-to_Speech](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts)"
|
||||
arguments:
|
||||
text: 'The text used for voice conversion. Required.'
|
||||
lang: 'The value can contain a language code such as en (English), or a locale such as en-US (English - United States). The optional parameter are "English", "Chinese". Default value: "Chinese".'
|
||||
|
|
@ -27,9 +29,11 @@ entities:
|
|||
- name: text_to_image
|
||||
description: Create a drawing based on the text.
|
||||
id: text_to_image.text_to_image
|
||||
requisite:
|
||||
- OPENAI_API_KEY
|
||||
- METAGPT_TEXT_TO_IMAGE_MODEL
|
||||
x-prerequisite:
|
||||
- name: OPENAI_API_KEY
|
||||
description: "OpenAI API key, For more details, checkout: `https://platform.openai.com/account/api-keys`"
|
||||
- name: METAGPT_TEXT_TO_IMAGE_MODEL_URL
|
||||
description: "Model url."
|
||||
arguments:
|
||||
text: 'The text used for image conversion. Required.'
|
||||
size_type: 'Default value: "512x512".'
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ def text_to_image(text, size_type: str = "512x512", openai_api_key="", model_url
|
|||
"""
|
||||
initialize_environment()
|
||||
image_declaration = "data:image/png;base64,"
|
||||
if os.environ.get("METAGPT_TEXT_TO_IMAGE_MODEL") or model_url:
|
||||
if os.environ.get("METAGPT_TEXT_TO_IMAGE_MODEL_URL") or model_url:
|
||||
data = oas3_metagpt_text_to_image(text, size_type, model_url)
|
||||
return image_declaration + data if data else ""
|
||||
if os.environ.get("OPENAI_API_KEY") or openai_api_key:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue