Add typing for OpenAI client and fallout (#118514)

* typing for client and consequences

* Update homeassistant/components/openai_conversation/conversation.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
Josef Zweck
2024-05-31 04:13:18 +02:00
committed by GitHub
parent 2bd142d3a6
commit eae04bf2e9
2 changed files with 56 additions and 21 deletions

View File

@@ -184,7 +184,6 @@ async def test_function_call(
assert mock_create.mock_calls[1][2]["messages"][3] == {
"role": "tool",
"tool_call_id": "call_AbCdEfGhIjKlMnOpQrStUvWx",
"name": "test_tool",
"content": '"Test response"',
}
mock_tool.async_call.assert_awaited_once_with(
@@ -317,7 +316,6 @@ async def test_function_exception(
assert mock_create.mock_calls[1][2]["messages"][3] == {
"role": "tool",
"tool_call_id": "call_AbCdEfGhIjKlMnOpQrStUvWx",
"name": "test_tool",
"content": '{"error": "HomeAssistantError", "error_text": "Test tool exception"}',
}
mock_tool.async_call.assert_awaited_once_with(