Created
May 25, 2024 20:28
-
-
Save renaud/eb9566a0eb44d0f66958c9ed2a882982 to your computer and use it in GitHub Desktop.
OpenAI Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openai import OpenAI | |
client = OpenAI() | |
response = client.chat.completions.create( | |
model="gpt-3.5-turbo-16k", | |
messages=[ | |
{ | |
"role": "system", | |
"content": [ | |
{ | |
"type": "text", | |
"text": "You will be provided with a piece of code, and your task is to explain it in a concise way." | |
} | |
] | |
}, | |
{ | |
"role": "user", | |
"content": [ | |
{ | |
"type": "text", | |
"text": "def f(i):\n if i <= 1:\n return i\n else:\n return (f(i - 1) + f(i - 2))" | |
} | |
] | |
} | |
], | |
temperature=0, | |
max_tokens=256, | |
top_p=1, | |
frequency_penalty=0, | |
presence_penalty=0 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment