You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Azure LLM, if you specify Japanese in the prompt, the answer may not be displayed.
The version of OpenAI-agents is Version: 0.0.14.
The following code may return a blank answer.
import agents
model_name = 'gpt-4.1-mini'
custom_client = agents.AsyncOpenAI(
api_key='xxxx',
base_url='https://yyyy.openai.azure.com/openai/deployments/gpt-4.1-mini',
default_headers={'api-key': 'xxxx'},
default_query={'api-version': '2025-04-01-preview'},
)
agents.set_default_openai_client(client=custom_client, use_for_tracing=False)
agents.set_default_openai_api(api='chat_completions') # Default Model
agents.set_tracing_disabled(disabled=True) # Disable Trace
model = agents.OpenAIChatCompletionsModel(
model=model_name,
openai_client=custom_client,
)
agent = agents.Agent(
name='Assistant',
instructions='あなたは役に立つアシスタントです',
# instructions='You are a helpful assistant',
model=model,
# model_settings=agents.ModelSettings(temperature=0.0), # ←Setting this increases the frequency with which results are not displayed.
# hooks=LoggingAgentHooks()
)
# For Jupyter notebooks with existing event loops
result = await agents.Runner.run(
starting_agent=agent,
input='プログラミングにおける、再帰について俳句を書いてください。'
# input='Write a haiku about recursion in programming.'
)
# print('----')
print(result.final_output)
# print('----')
This sometimes occurs when the prompt is set to Japanese. It does not occur when the prompt is set to English.
The debug log is attached below.
Could this be because the content from LLM is null? Why is it null?
When you say "The following code may return a blank answer." do you mean sometimes you'll get the answer and sometimes empty result?
Can you run the sample with OPENAI_LOG=debug and confirm that the model output has empty content?
sasaki000
changed the title
When using AzureOpenAI, the answer is not displayed
When using Japanese in AzureOpenAI, answers may not be displayed
May 5, 2025
Thanks for your reply.
Yes, sometimes it returns an answer, sometimes it returns an empty result.
I ran the example with OPENAI_LOG=debug and added a log where the model output contains empty content.
When using Azure LLM, if you specify Japanese in the prompt, the answer may not be displayed.
The version of OpenAI-agents is Version: 0.0.14.
This sometimes occurs when the prompt is set to Japanese. It does not occur when the prompt is set to English.
The debug log is attached below.
Could this be because the content from LLM is null? Why is it null?
The text was updated successfully, but these errors were encountered: