Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 1.17 KB

README.md

File metadata and controls

24 lines (16 loc) · 1.17 KB

GitHub Models Samples for OpenAI Python SDK

This folder contains samples that leverage the OpenAI Python SDK with the GitHub Models endpoint. Samples are available as Jupyter notebooks and as Python scripts.

Jupyter Notebooks

To run these notebooks, click on a link below to open it in Codespaces and select a Python3 kernel.

Python Scripts

To run these scripts, open your terminal and run a command like:

python3 samples/python/openai/basic.py
  • basic.py: basic call to the gpt-4o-mini chat completion API
  • chat_with_image_file.py: image file as input
  • multi_turn.py: multi-turn conversation with the chat completion API
  • streaming.py: generate a response in streaming mode, token by token
  • tools.py: run specific actions depending on the context of the conversation with the functions API