This is a Python script that takes the URL of a webpage as a prompt, uses OpenAI's Davinci engine to generate text from the prompt, and converts the resulted text to speech using Azure's Text-to-Speech API. The script is built using streamlit
to display the results in a web interface.
- An OpenAI API key: you can get it from OpenAI's website.
- An Azure API key: you can get it from Azure's website.
- The
requests
library: you can install it usingpip install requests
. - The
streamlit
library: you can install it usingpip install streamlit
.
- Clone or download the repository.
- Replace
YOUR_OPENAI_API_KEY
andYOUR_AZURE_API_KEY
in the code with your own API keys. - Run the script using
streamlit run app.py
. - Enter the URL of the prompt page in the input field.
- Set the limit for the number of characters (max tokens) to be generated by the OpenAI engine.
- The resulted text will be displayed in the web interface.
- You can listen to the text-to-speech output by playing the audio player.
- You can also download the audio file by clicking the "Download audio file" button.
We welcome contributions to this project! If you have an idea for a feature or bug fix, follow these steps to contribute:
- Fork the repository.
- Create a new branch for your changes.
- Commit your changes to the new branch.
- Push the branch to your forked repository.
- Submit a pull request to the original repository.
Make sure to follow the code style and add test cases for any new code. If you have any questions, don't hesitate to ask the repository maintainers.