Different Python Code for Different OpenAI Models — Davinci VS chatGPT

The aim of this page📝 is to share 2 snippets of python code that can be easily reproduced to run prompts against 2 different OpenAI models

  • ChatGPT
  • Davinci (10x more expensive)

— See https://openai.com/pricing

  • NOTE: the API functions a bit differently, I thought it was just a matter of replacing the name of model but that's not the case
  • I have the following in $profile — the simple thing it does is to concatenate the question into a single string
  • Then, it passes it into the python scripts
  • It works like this, either with the -davinci flag or alone
  • Surely, you could just use an input() to get the prompt interactively

--

--

Infrastructure Support Engineer/Technical Writer (snowplow.io) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavol Kutaj

Infrastructure Support Engineer/Technical Writer (snowplow.io) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com