I’m trying to look into the possibility of combining logprobs and structured outputs, but I moved to the responses api and I can’t seem to get any logprobs at all, just an empty list. Is it just not implemented yet or am I missing something? (If it’s something super obvious, apologies, I’m just returning to work after covid and I’d like to use that excuse.)
completion = client.responses.create(
model="gpt-4o-mini",
input="please return me a short sentence so I can see the logprobs",
top_logprobs = 5,
)
Response(id='resp_68cdb8d37ccc8197a3854e9c346029d10a8185d757490d93', created_at=1758312659.0, error=None, incomplete_details=None, instructions=None, metadata={}, model='gpt-4o-mini-2024-07-18', object='response',
output[ResponseOutputMessage(id='msg_68cdb8d4c9f08197a92de98c207084c70a8185d757490d93', content=[ResponseOutputText(
annotations=[],
text='Sure! Here’s a short sentence: "The cat sat on the mat."',
type='output_text',
logprobs=[])],
role='assistant', status='completed', type='message')], parallel_tool_calls=True, temperature=1.0, tool_choice='auto', tools=[], top_p=1.0, background=False, conversation=None, max_output_tokens=None, max_tool_calls=None, previous_response_id=None, prompt=None, prompt_cache_key=None, reasoning=Reasoning(effort=None, generate_summary=None, summary=None), safety_identifier=None, service_tier='default', status='completed', text=ResponseTextConfig(format=ResponseFormatText(type='text'), verbosity='medium'), top_logprobs=5, truncation='disabled', usage=ResponseUsage(input_tokens=21, input_tokens_details=InputTokensDetails(cached_tokens=0), output_tokens=17, output_tokens_details=OutputTokensDetails(reasoning_tokens=0), total_tokens=38), user=None, billing={'payer': 'developer'}, store=False)
Thanks for your help,
K