openai-function-calling-use-examples
openai-function-calling-use-examples copied to clipboard
A simple example that demonstrates how to use the function call feature of the OpenAI API
OpenAi Function Calling Use Examples
A simple example that demonstrates how to use the function call feature of the OpenAI API
Example
Libraries that need to be installed
- openai
- streamlit
- python-dotenv
installation
- 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
.envfile and add your api key -
Set up environment variables:
-
Create a
.envfile 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
