I was testing gpt-4o and gemini. However, with the same input message, gemini returns empty content. Here is related code:
openai_client = openai.OpenAI(api_key=secrets[“openai_key”])
gemini_client = openai.OpenAI(api_key=secrets[“gemini_key”], base_url=“https://generativelanguage.googleapis.com/v1beta/openai/”)
response = client.chat.completions.create(
model=model,
messages=messages,
tools=tools
)
Here is the output from gpt-4o:
gpt-4o-2024-11-20: ChatCompletion(id=‘chatcmpl-B66Tw9logz254LsrUx6lxPRoSaQxv’, choices=[Choice(finish_reason=‘stop’, index=0, logprobs=None, message=ChatCompletionMessage(content=‘{\n “tags”: [\n {\n “tag”: “sys_human_follow_up”,\n “reason”: “Assistant mentioned escalating the issue to a special team for further assistance and stated they will assist the user shortly.”\n }\n ]\n}’, refusal=None, role=‘assistant’, audio=None, function_call=None, tool_calls=None))], created=1740794584, model=‘gpt-4o-2024-11-20’, object=‘chat.completion’, service_tier=‘default’, system_fingerprint=‘fp_1d7c5f52ce’, usage=CompletionUsage(completion_tokens=51, prompt_tokens=619, total_tokens=670, completion_tokens_details=CompletionTokensDetails(audio_tokens=0, reasoning_tokens=0, accepted_prediction_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0)))
Here is the output from gemini:
gemini-2.0-flash: ChatCompletion(id=None, choices=[Choice(finish_reason=‘stop’, index=0, logprobs=None, message=ChatCompletionMessage(content=None, refusal=None, role=‘assistant’, audio=None, function_call=None, tool_calls=None))], created=1740794586, model=‘gemini-2.0-flash’, object=‘chat.completion’, service_tier=None, system_fingerprint=None, usage=CompletionUsage(completion_tokens=0, prompt_tokens=634, total_tokens=634, completion_tokens_details=None, prompt_tokens_details=None))