uv pip install SpeechRecognition -i https://pypi.tuna.tsinghua.edu.cn/simple
uv add SpeechRecognition
http://127.0.0.1:18000/llama3/test/invoke
{
"input": {
"text": "what is java"
}
}
To use the chat functionality, send a POST request to the following endpoint:
POST /chat/{session_id}
{
"text": "Your message here"
}
{
"response": "Chatbot's response"
}
To view historical messages, send a GET request to the following endpoint:
GET /history/{session_id}
{
"history": [
{"role": "user", "content": "User's message"},
{"role": "assistant", "content": "Chatbot's response"}
]
}
To use the speech-to-text functionality, send a POST request to the following endpoint:
POST /transcribe
The request body should contain the audio file to be transcribed.
{
"text": "Transcribed text"
}
To use the text-to-speech functionality, send a POST request to the following endpoint:
POST /synthesize
{
"text": "Text to be converted to speech"
}
{
"message": "Text has been converted to speech",
"file": "output.mp3"
}
To use the audio file to data stream functionality, send a POST request to the following endpoint:
POST /audio_stream
The request body should contain the audio file to be converted to a data stream.
{
"audio_stream": "Base64 encoded audio stream"
}