Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
test(image): cover dropping null OpenAI image params
Xubin Rena1b95772243d
diff --git a/tests/providers/test_image_generation.py b/tests/providers/test_image_generation.pyindex 29890778d..c42dad493 100644--- a/tests/providers/test_image_generation.py+++ b/tests/providers/test_image_generation.py@@ -631,6 +631,28 @@ async def test_openai_payload_and_response() -> None:assert body["size"] == "1792x1024"+async def test_openai_extra_body_null_drops_default_params_only() -> None:+ fake = FakeClient(FakeResponse({"data": [{"b64_json": RAW_B64}]}))+ client = OpenAIImageGenerationClient(+ api_key="sk-openai-test",+ extra_body={+ "response_format": None,+ "seed": 0,+ "safety_checker": False,+ },+ client=fake, # type: ignore[arg-type]+ )++ await client.generate(prompt="draw", model="dall-e-3")++ body = fake.calls[0]["json"]+ assert "response_format" not in body+ assert body["n"] == 1+ assert body["seed"] == 0+ assert body["safety_checker"] is False++@pytest.mark.asyncioasync def test_openai_b64_json_response_uses_detected_mime() -> None:raw_b64 = base64.b64encode(JPEG_BYTES).decode("ascii")