Skip to content

Commit e68619b

Browse files
committed
mypy updates
1 parent e697aae commit e68619b

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

app/backend/app.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,6 @@ async def setup_clients():
473473
USE_BING_SEARCH = os.getenv("USE_BING_SEARCH", "").lower() == "true"
474474
BING_SEARCH_API_KEY = os.getenv("BING_SEARCH_API_KEY")
475475
BING_SEARCH_ENDPOINT = os.getenv("BING_SEARCH_ENDPOINT")
476-
if BING_SEARCH_ENDPOINT is not None and BING_SEARCH_ENDPOINT.trim() == "":
477-
BING_SEARCH_ENDPOINT = None
478476

479477
# WEBSITE_HOSTNAME is always set by App Service, RUNNING_IN_PRODUCTION is set in main.bicep
480478
RUNNING_ON_AZURE = os.getenv("WEBSITE_HOSTNAME") is not None or os.getenv("RUNNING_IN_PRODUCTION") is not None

app/backend/approaches/chatreadretrieveread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ async def keyword_rewrite(rendered_prompt, tools):
137137
)
138138
tools: List[ChatCompletionToolParam] = self.query_rewrite_tools
139139
query_messages, query_text = await keyword_rewrite(rendered_query_prompt, tools)
140-
if use_bing_search:
140+
if use_bing_search and self.bing_client:
141141
bing_search_prompt = self.prompt_manager.render_prompt(
142142
self.bing_ground_rewrite_prompt,
143143
{"user_query": original_user_query, "past_messages": messages[:-1]},

app/backend/bing_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
An async client for Bing Web Search API.
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Union
66

77
import httpx
88
from pydantic import BaseModel, ConfigDict
@@ -47,7 +47,7 @@ def __init__(self, api_key: str, bing_endpoint: Optional[str] = "api.bing.micros
4747
}
4848

4949
async def search(self, query: str) -> WebAnswer:
50-
params = {
50+
params: dict[str, Union[str,bool]] = {
5151
"q": query,
5252
"textDecorations": True,
5353
"textFormat": "HTML",

0 commit comments

Comments
 (0)