Skip to content

Commit

Permalink
Fix: Internet search function
Browse files Browse the repository at this point in the history
  • Loading branch information
knoop7 authored Jan 20, 2025
1 parent 5a93276 commit 18a6a4c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/zhipuai/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ async def async_step_init(

if not errors:
self._data.update(user_input)
if CONF_WEB_SEARCH not in self._data:
self._data[CONF_WEB_SEARCH] = DEFAULT_WEB_SEARCH

if user_input.get(CONF_HISTORY_ANALYSIS):
return await self.async_step_history()
return self.async_create_entry(title="", data=self._data)
Expand Down Expand Up @@ -375,7 +378,8 @@ def zhipuai_config_option_schema(
),
vol.Optional(
CONF_WEB_SEARCH,
default=DEFAULT_WEB_SEARCH,
default=options.get(CONF_WEB_SEARCH, DEFAULT_WEB_SEARCH),
description={"suggested_value": options.get(CONF_WEB_SEARCH, DEFAULT_WEB_SEARCH)},
): bool,
vol.Optional(
CONF_HISTORY_ANALYSIS,
Expand Down Expand Up @@ -415,4 +419,4 @@ class InvalidAPIKey(exceptions.HomeAssistantError):
pass

class ModelNotFound(exceptions.HomeAssistantError):
pass
pass

0 comments on commit 18a6a4c

Please sign in to comment.