Skip to content

Example of using function calling and connecting it to an external API

Notifications You must be signed in to change notification settings

hilmanski/openai-function-calling-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This is an example of how to use Function Calling by OpenAI and connect the response with external API.

Blog post explanation: Connect OpenAI with external API using function calling

Use case

In this sample we're building a shopping assistant, with this flow:

  • It reads user input (natural language)
  • Extract the important data
  • Call an API based on that data
  • Response in natural language

Tools need

Run

  1. Install packages
npm install
  1. Copy env_template to .env and fill in your API keys

  2. Run the program

node index.js

Feel free to adjust the prompt inside the program

About

Example of using function calling and connecting it to an external API

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published