OpenAI

List of all model namesarrow-up-right

duration = 10
topic = "Using Data in IEPs"

prompt = f"""
You are tasked with creating a {duration} minute lecture that covers "{topic}". 
Give a numbered list of short topics(under 8 words) that you would cover in this lecture:
"""

response1 = openai.ChatCompletion.create(
    model="gpt-4",
    messages=[
          {"role": "system", "content": "You are a one of the best teachers for adult students and seek to be educational and interesting."},
          {"role": "user", "content": prompt},
    ]
)
print(response1)

Pass in image

  • two ways as base64 and url

  • .png, .jpeg, .jpg, .webpage, .gif, up to 20MB, low 512x512

Utils

Errors

Old

Text completion

  • Design quality prompt with instructions and examples

  • Temperature 0 is deterministic for where there is one right answer, 1 is for when many different answers are preferred. Its not "creativity"

Prompt Examples

Conversation, notice we can give the AI assistant an identity

Tips

  • use max_tokens > 256

  • Prefer finish_reason == "stop"

  • Resampling 3-5 times with high temperature then pick samples that use stop as finish reason can be best

  • Provide examples

Last updated