almazkun / chat-gpt-function-call

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chat-gpt-function-call

Quick example on how to use OpenAI Function Call API with ChatGPT. https://platform.openai.com/docs/assistants/tools/function-calling

Setup

  1. Provide your OpenAI API key in the .env file.

    cp '.env copy' .env
  2. Activate the virtual environment.

    pipenv install
    pipenv shell
  3. Run the script.

    python main.py

Example

python main.py
You: hi!
Assistant: Hello! To assist you, please provide me with your session ID.
You: e901e9102ej091d21ndnnd1n2d
Assistant: Order 2: Status - Shipped
Order 3: Status - Cancelled
You:

About

License:MIT License


Languages

Language:Python 100.0%