Describe the bug
I receive OpenAi 500 internal error when my agent attempt to call llm after a tool call. I find that this field can be None(and it will be passed to the 'content' field when calling LLM). My LLM is a private deployed LLM with openAI api style and i tried a list of LLMs, all of them cannot accept None value.
This can be fixed if replacing this None value(google/adk/models/lite_llm.py line 202) to empty string.
To Reproduce
Steps to reproduce the behavior:
- run agent after specific tool call
- call llm
Expected behavior
18:33:55 - LiteLLM:INFO: utils.py:3173 -
LiteLLM completion() model= us.anthropic.claude-sonnet-4-20250514-v1:0; provider = openai
2025-07-04 18:33:55,968 - INFO - utils.py:3173 -
LiteLLM completion() model= us.anthropic.claude-sonnet-4-20250514-v1:0; provider = openai
2025-07-04 18:33:56,382 - INFO - _client.py:1740 - HTTP Request: POST https://pre-openai-keys.alibaba-inc.com/v1/chat/completions "HTTP/1.1 500 Internal Server Error"
2025-07-04 18:33:56,382 - INFO - _base_client.py:1608 - Retrying request to /chat/completions in 0.497158 seconds
2025-07-04 18:33:57,206 - INFO - _client.py:1740 - HTTP Request: POST https://pre-openai-keys.alibaba-inc.com/v1/chat/completions "HTTP/1.1 500 Internal Server Error"
2025-07-04 18:33:57,207 - INFO - _base_client.py:1608 - Retrying request to /chat/completions in 0.763697 seconds
2025-07-04 18:33:58,237 - INFO - _client.py:1740 - HTTP Request: POST https://pre-openai-keys.alibaba-inc.com/v1/chat/completions "HTTP/1.1 500 Internal Server Error"
Model Information:
claude-sonnet-4-20250514-v1:0
Additional context
google/adk/models/lite_llm.py line 202
Describe the bug
I receive OpenAi 500 internal error when my agent attempt to call llm after a tool call. I find that this field can be None(and it will be passed to the 'content' field when calling LLM). My LLM is a private deployed LLM with openAI api style and i tried a list of LLMs, all of them cannot accept None value.
This can be fixed if replacing this None value(google/adk/models/lite_llm.py line 202) to empty string.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
18:33:55 - LiteLLM:INFO: utils.py:3173 -
LiteLLM completion() model= us.anthropic.claude-sonnet-4-20250514-v1:0; provider = openai
2025-07-04 18:33:55,968 - INFO - utils.py:3173 -
LiteLLM completion() model= us.anthropic.claude-sonnet-4-20250514-v1:0; provider = openai
2025-07-04 18:33:56,382 - INFO - _client.py:1740 - HTTP Request: POST https://pre-openai-keys.alibaba-inc.com/v1/chat/completions "HTTP/1.1 500 Internal Server Error"
2025-07-04 18:33:56,382 - INFO - _base_client.py:1608 - Retrying request to /chat/completions in 0.497158 seconds
2025-07-04 18:33:57,206 - INFO - _client.py:1740 - HTTP Request: POST https://pre-openai-keys.alibaba-inc.com/v1/chat/completions "HTTP/1.1 500 Internal Server Error"
2025-07-04 18:33:57,207 - INFO - _base_client.py:1608 - Retrying request to /chat/completions in 0.763697 seconds
2025-07-04 18:33:58,237 - INFO - _client.py:1740 - HTTP Request: POST https://pre-openai-keys.alibaba-inc.com/v1/chat/completions "HTTP/1.1 500 Internal Server Error"
Model Information:
claude-sonnet-4-20250514-v1:0
Additional context
google/adk/models/lite_llm.py line 202