mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Bump openai to 1.93.0 (#148350)
This commit is contained in:
parent
a46cc82916
commit
090b8f0659
@ -8,5 +8,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/openai_conversation",
|
"documentation": "https://www.home-assistant.io/integrations/openai_conversation",
|
||||||
"integration_type": "service",
|
"integration_type": "service",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"requirements": ["openai==1.76.2"]
|
"requirements": ["openai==1.93.0"]
|
||||||
}
|
}
|
||||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -1597,7 +1597,7 @@ open-garage==0.2.0
|
|||||||
open-meteo==0.3.2
|
open-meteo==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.openai_conversation
|
# homeassistant.components.openai_conversation
|
||||||
openai==1.76.2
|
openai==1.93.0
|
||||||
|
|
||||||
# homeassistant.components.openerz
|
# homeassistant.components.openerz
|
||||||
openerz-api==0.3.0
|
openerz-api==0.3.0
|
||||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -1365,7 +1365,7 @@ open-garage==0.2.0
|
|||||||
open-meteo==0.3.2
|
open-meteo==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.openai_conversation
|
# homeassistant.components.openai_conversation
|
||||||
openai==1.76.2
|
openai==1.93.0
|
||||||
|
|
||||||
# homeassistant.components.openerz
|
# homeassistant.components.openerz
|
||||||
openerz-api==0.3.0
|
openerz-api==0.3.0
|
||||||
|
@ -35,6 +35,7 @@ from openai.types.responses import (
|
|||||||
ResponseWebSearchCallSearchingEvent,
|
ResponseWebSearchCallSearchingEvent,
|
||||||
)
|
)
|
||||||
from openai.types.responses.response import IncompleteDetails
|
from openai.types.responses.response import IncompleteDetails
|
||||||
|
from openai.types.responses.response_function_web_search import ActionSearch
|
||||||
import pytest
|
import pytest
|
||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
@ -95,10 +96,12 @@ def mock_create_stream() -> Generator[AsyncMock]:
|
|||||||
)
|
)
|
||||||
yield ResponseCreatedEvent(
|
yield ResponseCreatedEvent(
|
||||||
response=response,
|
response=response,
|
||||||
|
sequence_number=0,
|
||||||
type="response.created",
|
type="response.created",
|
||||||
)
|
)
|
||||||
yield ResponseInProgressEvent(
|
yield ResponseInProgressEvent(
|
||||||
response=response,
|
response=response,
|
||||||
|
sequence_number=0,
|
||||||
type="response.in_progress",
|
type="response.in_progress",
|
||||||
)
|
)
|
||||||
response.status = "completed"
|
response.status = "completed"
|
||||||
@ -123,16 +126,19 @@ def mock_create_stream() -> Generator[AsyncMock]:
|
|||||||
if response.status == "incomplete":
|
if response.status == "incomplete":
|
||||||
yield ResponseIncompleteEvent(
|
yield ResponseIncompleteEvent(
|
||||||
response=response,
|
response=response,
|
||||||
|
sequence_number=0,
|
||||||
type="response.incomplete",
|
type="response.incomplete",
|
||||||
)
|
)
|
||||||
elif response.status == "failed":
|
elif response.status == "failed":
|
||||||
yield ResponseFailedEvent(
|
yield ResponseFailedEvent(
|
||||||
response=response,
|
response=response,
|
||||||
|
sequence_number=0,
|
||||||
type="response.failed",
|
type="response.failed",
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
yield ResponseCompletedEvent(
|
yield ResponseCompletedEvent(
|
||||||
response=response,
|
response=response,
|
||||||
|
sequence_number=0,
|
||||||
type="response.completed",
|
type="response.completed",
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -301,7 +307,7 @@ async def test_incomplete_response(
|
|||||||
"OpenAI response failed: Rate limit exceeded",
|
"OpenAI response failed: Rate limit exceeded",
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
ResponseErrorEvent(type="error", message="Some error"),
|
ResponseErrorEvent(type="error", message="Some error", sequence_number=0),
|
||||||
"OpenAI response error: Some error",
|
"OpenAI response error: Some error",
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -359,6 +365,7 @@ def create_message_item(
|
|||||||
status="in_progress",
|
status="in_progress",
|
||||||
),
|
),
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_item.added",
|
type="response.output_item.added",
|
||||||
),
|
),
|
||||||
ResponseContentPartAddedEvent(
|
ResponseContentPartAddedEvent(
|
||||||
@ -366,6 +373,7 @@ def create_message_item(
|
|||||||
item_id=id,
|
item_id=id,
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
part=content,
|
part=content,
|
||||||
|
sequence_number=0,
|
||||||
type="response.content_part.added",
|
type="response.content_part.added",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
@ -377,6 +385,7 @@ def create_message_item(
|
|||||||
delta=delta,
|
delta=delta,
|
||||||
item_id=id,
|
item_id=id,
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_text.delta",
|
type="response.output_text.delta",
|
||||||
)
|
)
|
||||||
for delta in text
|
for delta in text
|
||||||
@ -389,6 +398,7 @@ def create_message_item(
|
|||||||
item_id=id,
|
item_id=id,
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
text="".join(text),
|
text="".join(text),
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_text.done",
|
type="response.output_text.done",
|
||||||
),
|
),
|
||||||
ResponseContentPartDoneEvent(
|
ResponseContentPartDoneEvent(
|
||||||
@ -396,6 +406,7 @@ def create_message_item(
|
|||||||
item_id=id,
|
item_id=id,
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
part=content,
|
part=content,
|
||||||
|
sequence_number=0,
|
||||||
type="response.content_part.done",
|
type="response.content_part.done",
|
||||||
),
|
),
|
||||||
ResponseOutputItemDoneEvent(
|
ResponseOutputItemDoneEvent(
|
||||||
@ -407,6 +418,7 @@ def create_message_item(
|
|||||||
type="message",
|
type="message",
|
||||||
),
|
),
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_item.done",
|
type="response.output_item.done",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
@ -433,6 +445,7 @@ def create_function_tool_call_item(
|
|||||||
status="in_progress",
|
status="in_progress",
|
||||||
),
|
),
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_item.added",
|
type="response.output_item.added",
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@ -442,6 +455,7 @@ def create_function_tool_call_item(
|
|||||||
delta=delta,
|
delta=delta,
|
||||||
item_id=id,
|
item_id=id,
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.function_call_arguments.delta",
|
type="response.function_call_arguments.delta",
|
||||||
)
|
)
|
||||||
for delta in arguments
|
for delta in arguments
|
||||||
@ -452,6 +466,7 @@ def create_function_tool_call_item(
|
|||||||
arguments="".join(arguments),
|
arguments="".join(arguments),
|
||||||
item_id=id,
|
item_id=id,
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.function_call_arguments.done",
|
type="response.function_call_arguments.done",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -467,6 +482,7 @@ def create_function_tool_call_item(
|
|||||||
status="completed",
|
status="completed",
|
||||||
),
|
),
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_item.done",
|
type="response.output_item.done",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -485,6 +501,7 @@ def create_reasoning_item(id: str, output_index: int) -> list[ResponseStreamEven
|
|||||||
status=None,
|
status=None,
|
||||||
),
|
),
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_item.added",
|
type="response.output_item.added",
|
||||||
),
|
),
|
||||||
ResponseOutputItemDoneEvent(
|
ResponseOutputItemDoneEvent(
|
||||||
@ -495,6 +512,7 @@ def create_reasoning_item(id: str, output_index: int) -> list[ResponseStreamEven
|
|||||||
status=None,
|
status=None,
|
||||||
),
|
),
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_item.done",
|
type="response.output_item.done",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
@ -505,31 +523,42 @@ def create_web_search_item(id: str, output_index: int) -> list[ResponseStreamEve
|
|||||||
return [
|
return [
|
||||||
ResponseOutputItemAddedEvent(
|
ResponseOutputItemAddedEvent(
|
||||||
item=ResponseFunctionWebSearch(
|
item=ResponseFunctionWebSearch(
|
||||||
id=id, status="in_progress", type="web_search_call"
|
id=id,
|
||||||
|
status="in_progress",
|
||||||
|
action=ActionSearch(query="query", type="search"),
|
||||||
|
type="web_search_call",
|
||||||
),
|
),
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_item.added",
|
type="response.output_item.added",
|
||||||
),
|
),
|
||||||
ResponseWebSearchCallInProgressEvent(
|
ResponseWebSearchCallInProgressEvent(
|
||||||
item_id=id,
|
item_id=id,
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.web_search_call.in_progress",
|
type="response.web_search_call.in_progress",
|
||||||
),
|
),
|
||||||
ResponseWebSearchCallSearchingEvent(
|
ResponseWebSearchCallSearchingEvent(
|
||||||
item_id=id,
|
item_id=id,
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.web_search_call.searching",
|
type="response.web_search_call.searching",
|
||||||
),
|
),
|
||||||
ResponseWebSearchCallCompletedEvent(
|
ResponseWebSearchCallCompletedEvent(
|
||||||
item_id=id,
|
item_id=id,
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.web_search_call.completed",
|
type="response.web_search_call.completed",
|
||||||
),
|
),
|
||||||
ResponseOutputItemDoneEvent(
|
ResponseOutputItemDoneEvent(
|
||||||
item=ResponseFunctionWebSearch(
|
item=ResponseFunctionWebSearch(
|
||||||
id=id, status="completed", type="web_search_call"
|
id=id,
|
||||||
|
status="completed",
|
||||||
|
action=ActionSearch(query="query", type="search"),
|
||||||
|
type="web_search_call",
|
||||||
),
|
),
|
||||||
output_index=output_index,
|
output_index=output_index,
|
||||||
|
sequence_number=0,
|
||||||
type="response.output_item.done",
|
type="response.output_item.done",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
@ -588,6 +617,7 @@ async def test_function_call(
|
|||||||
"id": "rs_A",
|
"id": "rs_A",
|
||||||
"summary": [],
|
"summary": [],
|
||||||
"type": "reasoning",
|
"type": "reasoning",
|
||||||
|
"encrypted_content": None,
|
||||||
}
|
}
|
||||||
assert result.response.response_type == intent.IntentResponseType.ACTION_DONE
|
assert result.response.response_type == intent.IntentResponseType.ACTION_DONE
|
||||||
# Don't test the prompt, as it's not deterministic
|
# Don't test the prompt, as it's not deterministic
|
||||||
|
Loading…
x
Reference in New Issue
Block a user