https://github.com/simoon-f/openai-function-calling-use-examples
A simple example that demonstrates how to use the function call feature of the OpenAI API
https://github.com/simoon-f/openai-function-calling-use-examples
function-call openai openai-example openai-function openai-function-call openai-function-example
Last synced: 6 months ago
JSON representation
A simple example that demonstrates how to use the function call feature of the OpenAI API
- Host: GitHub
- URL: https://github.com/simoon-f/openai-function-calling-use-examples
- Owner: Simoon-F
- Created: 2023-06-24T02:45:54.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-04T08:12:10.000Z (over 2 years ago)
- Last Synced: 2025-04-23T20:13:56.949Z (11 months ago)
- Topics: function-call, openai, openai-example, openai-function, openai-function-call, openai-function-example
- Language: Python
- Homepage:
- Size: 571 KB
- Stars: 66
- Watchers: 1
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
1. openai
2. streamlit
3. python-dotenv
## installation
1. Clone the current repository
```shell
$ git clone https://github.com/Simoon-F/openai-function-calling-use-exaples
```
2. Enter the project root directory
```shell
$ cd openai-function-calling-use-exaples
```
3. Create the `.env` file and add your api key
4. Set up environment variables:
- Create a `.env` file in the root of the project.
- Add your Open AI API key to the .env file:
```env
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.
5. Run Project
```shell
$ streamlit run main.py
```
## Official Description
[function-calling-and-other-api-updates](https://openai.com/blog/function-calling-and-other-api-updates)
