Hello Yash Runwal ,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you would like to know how you can get the logprobs with the Chat Completion Model gpt-4-turbo-2024-04-09 with 2024-06-01 api version.
No, you cannot get logprobs
with the Chat Completion Model gpt-4-turbo-2024-04-09
even with the 2024-06-01
API version. The logprobs
parameter is supported for the completions API but not for the chat completions API. This is likely why you are not seeing logprobs
in your response.
If you need logprobs
, you should use the completions API instead of the chat completions API. This is an example of how to construct your payload for the completions API:
import openai
response = openai.Completion.create(
model="gpt-4-turbo-2024-04-09",
prompt="Your prompt here",
max_tokens=100,
logprobs=5,
api_version="2024-06-01"
)
print(response)
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.