New OAI Chat Endpoint
choprahetarth opened this issue · 0 comments
choprahetarth commented
You can actually close this issue -- just in case anyone is looking for running it with OAI Chat Completion -
import os
import openai
import requests
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"),
)
def llm(prompt, stop=["\n"]):
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": prompt,
}
],
temperature=0,
max_tokens=100,
top_p=1,
frequency_penalty=0.0,
presence_penalty=0.0,
stop=stop
)
return response.choices[0].message.content