The Agora Conversational AI extension enables developers to build voice assistants powered by Dify Agent.
Author: plutoless
Version: 0.0.6
Type: extension
This extension provides an endpoint to make Dify agents work with Agora’s Conversational AI Engine to easily turn your Dify agents into voice assistants.
APP
To turn a Dify agent into a voice assistant, choose one from your agent library.
Agora App ID
In the Agora Console, get your Agora App ID and enable the Conversational AI Engine service.
Agora RESTful Customer ID
In the Agora Console, get the Agora RESTful Customer ID.
Agora RESTful Customer Secret
In the Agora Console, get the Agora RESTful Customer Secret.
TTS Vendor
The TTS vendor to use for voice synthesis. Choose one from the list below.
TTS Vendor Params
The parameters for the TTS vendor. The parameters are different for each vendor, please refer to the vendor's documentation for more information.
Azure
JSON1{
2 "key": "<your api key>",
3 "region": "eastasia",
4 "voice_name": "en-US-AndrewMultilingualNeural"
5}
ElevenLabs
JSON1{
2 "key": "<your api key>",
3 "model_id": "eleven_flash_v2_5",
4 "voice_id": "pNInz6obpgDQGcFmaJgB"
5}
Greeting Message
The message to greet the user when the conversation starts.
Failure Message
The message to tell the user when the conversation fails.
Agora App Certificate
The Agora App Certificate to use for RTC service. Get it from Agora Console. Only needed when security token is enabled for your Agora project.
API Key
The API Key to protect your Dify endpoint.
Once you finish the configuration, you'll fnd the APl in the endpoint as follows:
https://qv90***.ai-plugin.io/convoai-web/<file>
Replace <file>
with index.html
,
Then you may navigate to the following URL to access the integrated Conversational Al web page.
https://qv90***.ai-plugin.io/convoai-web/index.html
You can also use the API directly without the web page. The API endpoint is:
API Endpoint: https://qv90***.ai-plugin.io/convoai-start
key | value |
---|---|
base_url | The base url of the extension |
channel | The channel id of the extension |
Example cURL:
Bash1curl 'https://qv90***.ai-plugin.io/convoai/convoai-start' \ 2 -H 'accept: application/json, text/plain, */*' \ 3 -H 'accept-language: zh,en;q=0.9,zh-CN;q=0.8' \ 4 -H 'cache-control: no-cache' \ 5 -H 'content-type: application/json' \ 6 --data-raw '{"base_url":"https://qv90***.ai-plugin.io","channel":"jh0y8fgk7"}'
API Endpoint: https://qv90***.ai-plugin.io/convoai-stop
key | value |
---|---|
agent_id | The agent id of the extension |
Example cURL:
Bash1curl 'https://qv90***.ai-plugin.io/convoai/convoai-stop' \ 2 -H 'accept: application/json, text/plain, */*' \ 3 -H 'accept-language: zh,en;q=0.9,zh-CN;q=0.8' \ 4 -H 'cache-control: no-cache' \ 5 -H 'content-type: application/json' \ 6 --data-raw '{"agent_id":"1NT29X0ZX0JYPJ96CCL8F4Y4VUEGR566"}'