Skip to content

shweta-29/OpenAI-Function-Calling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

OpenAI Function Calling

A minimal Python demo showing OpenAI function/tool calling with exactly two tools:

  • c_to_f — convert Celsius to Fahrenheit
  • f_to_c — convert Fahrenheit to Celsius

Quick start

  1. Python 3.10+
  2. cp .env.example .env and put your key in OPENAI_API_KEY=...
  3. Install:
    pip install -r requirements.txt
  4. python -m tool_calling.chat

What you’ll learn

  • How to define tool schema (name + JSON params)

  • Letting the model choose which tool to call

  • Executing the Python tool and feeding results back to the model

Try these prompts

  • convert 100F to C

  • what is 37 celsius in fahrenheit?

  • can you convert -10 C to F?

  • i have 212 f — what's that in c?

About

Python demo of OpenAI tool/function calling with two tools (C→F and F→C). Simple CLI REPL, file-based system prompt. Perfect for learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages