Skip to content

Commit

Permalink
Add OpenAI multi modal services (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
PengHongyiNTU authored Jul 4, 2024
1 parent 66126d8 commit e73b9b8
Show file tree
Hide file tree
Showing 5 changed files with 1,172 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/sphinx_doc/en/source/tutorial/204-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ The following table outlines the various Service functions by type. These functi
| Multi Modality | `dashscope_text_to_image` | Convert text to image using Dashscope API. |
| | `dashscope_image_to_text` | Convert image to text using Dashscope API. |
| | `dashscope_text_to_audio` | Convert text to audio using Dashscope API. |
| | `openai_text_to_image` | Convert text to image using OpenAI API
| | `openai_edit_image` | Edit an image based on the provided mask and prompt using OpenAI API
| | `openai_create_image_variation` | Create variations of an image using OpenAI API
| | `openai_image_to_text` | Convert text to image using OpenAI API
| | `openai_text_to_audio` | Convert text to audio using OpenAI API
| | `openai_audio_to_text` | Convert audio to text using OpenAI API


| *More services coming soon* | | More service functions are in development and will be added to AgentScope to further enhance its capabilities. |

About each service function, you can find detailed information in the
Expand Down
6 changes: 6 additions & 0 deletions docs/sphinx_doc/zh_CN/source/tutorial/204-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
| 多模态 | `dashscope_text_to_image` | 使用 DashScope API 将文本生成图片。 |
| | `dashscope_image_to_text` | 使用 DashScope API 根据图片生成文字。 |
| | `dashscope_text_to_audio` | 使用 DashScope API 根据文本生成音频。 |
| | `openai_text_to_image` | 使用 OpenAI API根据文本生成图片。
| | `openai_edit_image` | 使用 OpenAI API 根据提供的遮罩和提示编辑图像。
| | `openai_create_image_variation` | 使用 OpenAI API 创建图像的变体。
| | `openai_image_to_text` | 使用 OpenAI API 根据图片生成文字。
| | `openai_text_to_audio` | 使用 OpenAI API 根据文本生成音频。
| | `openai_audio_to_text` | 使用OpenAI API将音频转换为文本。
| *更多服务即将推出* | | 正在开发更多服务功能,并将添加到 AgentScope 以进一步增强其能力。 |

关于详细的参数、预期输入格式、返回类型,请参阅[API文档](https://modelscope.github.io/agentscope/)
Expand Down
15 changes: 15 additions & 0 deletions src/agentscope/service/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
dashscope_text_to_image,
dashscope_text_to_audio,
)
from .multi_modality.openai_services import (
openai_audio_to_text,
openai_text_to_audio,
openai_text_to_image,
openai_image_to_text,
openai_edit_image,
openai_create_image_variation,
)

from .service_response import ServiceResponse
from .service_toolkit import ServiceToolkit
from .service_toolkit import ServiceFactory
Expand Down Expand Up @@ -86,6 +95,12 @@ def get_help() -> None:
"dashscope_image_to_text",
"dashscope_text_to_image",
"dashscope_text_to_audio",
"openai_audio_to_text",
"openai_text_to_audio",
"openai_text_to_image",
"openai_image_to_text",
"openai_edit_image",
"openai_create_image_variation",
# to be deprecated
"ServiceFactory",
]
Loading

0 comments on commit e73b9b8

Please sign in to comment.