def get_completion(prompt, model="gpt-4o-mini", temperature=0):
messages = [{"role": "user", "content": prompt}]
response = client.chat.completions.create(
model=model,
messages=messages,
temperature=temperature, # this is the degree of randomness of the model's output
)
return response.choices[0].message.content
get_completion("tell me a joke", temperature = 1, model="gpt-4o-mini")
Describe the bug 描述bug 免费api key中的 gpt-4o-mini 模型 temperature 参数失效
To Reproduce 复现方法 Steps to reproduce the behavior:
from openai import OpenAI
client = OpenAI(
fill in your own API key here
)
def get_completion(prompt, model="gpt-4o-mini", temperature=0): messages = [{"role": "user", "content": prompt}] response = client.chat.completions.create( model=model, messages=messages, temperature=temperature, # this is the degree of randomness of the model's output ) return response.choices[0].message.content
get_completion("tell me a joke", temperature = 1, model="gpt-4o-mini")
Screenshots 截图 每次都返回同样的结果,gpt-3.5-turbo 会返回不同结果