cookbook icon indicating copy to clipboard operation
cookbook copied to clipboard

Add OpenAI SDK

Open SonjeVilas opened this issue 8 months ago • 2 comments

This PR adds a Jupyter notebook demonstrating how to call Google Gemini models (e.g., Gemini Pro) using the OpenAI Python SDK interface. Key features:

  • Uses an adapter to translate OpenAI-style requests to Gemini’s API.
  • Supports chat completions and embeddings with minimal code changes.
  • Simplifies testing Gemini for developers familiar with OpenAI’s SDK.

Use Case: Enables quick prototyping, model comparison, and smoother migration between LLM providers.

SonjeVilas avatar Apr 07 '25 17:04 SonjeVilas

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

A more detailed version of this notebook already exists in this repo ./quickstarts/Get_started_OpenAI_Compatibility.ipynb

andycandy avatar Apr 08 '25 18:04 andycandy

Please see the CONTRIBUTING guide for details on submitting new guides, and note that "step 1" is to file a new issue.

As @andycandy pointed out, we have this guide already, and it has the exposition we need in a guide.

markmcd avatar Apr 09 '25 03:04 markmcd