mirror of
https://github.com/home-assistant/core.git
synced 2025-11-15 14:00:24 +00:00
Set right model in OpenAI conversation (#147575)
This commit is contained in:
committed by
GitHub
parent
a73dafe097
commit
4244d2f66f
@@ -1,10 +1,12 @@
|
||||
"""Tests helpers."""
|
||||
|
||||
from typing import Any
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.openai_conversation.const import DEFAULT_CONVERSATION_NAME
|
||||
from homeassistant.config_entries import ConfigSubentryData
|
||||
from homeassistant.const import CONF_LLM_HASS_API
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import llm
|
||||
@@ -14,7 +16,15 @@ from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_config_entry(hass: HomeAssistant) -> MockConfigEntry:
|
||||
def mock_subentry_data() -> dict[str, Any]:
|
||||
"""Mock subentry data."""
|
||||
return {}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_config_entry(
|
||||
hass: HomeAssistant, mock_subentry_data: dict[str, Any]
|
||||
) -> MockConfigEntry:
|
||||
"""Mock a config entry."""
|
||||
entry = MockConfigEntry(
|
||||
title="OpenAI",
|
||||
@@ -24,12 +34,12 @@ def mock_config_entry(hass: HomeAssistant) -> MockConfigEntry:
|
||||
},
|
||||
version=2,
|
||||
subentries_data=[
|
||||
{
|
||||
"data": {},
|
||||
"subentry_type": "conversation",
|
||||
"title": DEFAULT_CONVERSATION_NAME,
|
||||
"unique_id": None,
|
||||
}
|
||||
ConfigSubentryData(
|
||||
data=mock_subentry_data,
|
||||
subentry_type="conversation",
|
||||
title=DEFAULT_CONVERSATION_NAME,
|
||||
unique_id=None,
|
||||
)
|
||||
],
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
Reference in New Issue
Block a user