A simple example that demonstrates how to use the function call feature of the OpenAI API
- openai
- streamlit
- python-dotenv
- Clone the current repository
$ git clone https://github.com/Simoon-F/openai-function-calling-use-exaples
- Enter the project root directory
$ cd openai-function-calling-use-exaples
-
Create the
.env
file and add your api key -
Set up environment variables:
-
Create a
.env
file in the root of the project. -
Add your Open AI API key to the .env file:
OPENAI_API_KEY=your Open AI api key AMAP_API_KEY=your AMAP api key
-
TIPS:
If there is no AMAP_API_KEY, you can comment out the relevant code.
- Run Project
$ streamlit run main.py