Skip to content

Commit

Permalink
Black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tonybaloney committed Jan 23, 2025
1 parent d80e7be commit e697aae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 1 addition & 6 deletions app/backend/approaches/chatreadretrieveread.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,7 @@ async def keyword_rewrite(rendered_prompt, tools):
else {"model": self.chatgpt_model}
),
),
ThoughtStep(
"Bing search query",
bing_query_text if use_bing_search else None,
{
}
),
ThoughtStep("Bing search query", bing_query_text if use_bing_search else None, {}),
ThoughtStep(
"Bing search results",
[result.snippet for result in bing_results.value[:2]] if use_bing_search else None,
Expand Down
8 changes: 4 additions & 4 deletions app/backend/bing_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class WebPage(BaseModel):

# There are more fields in the response, but we only care about these for now.
model_config = ConfigDict(
extra='allow',
extra="allow",
)


Expand All @@ -32,7 +32,7 @@ class WebAnswer(BaseModel):

# There are more fields in the response, but we only care about these for now.
model_config = ConfigDict(
extra='allow',
extra="allow",
)


Expand All @@ -45,7 +45,7 @@ def __init__(self, api_key: str, bing_endpoint: Optional[str] = "api.bing.micros
"User-Agent": "azure-search-openai-demo",
# "X-Search-Location": "" # this would be useful in future
}

async def search(self, query: str) -> WebAnswer:
params = {
"q": query,
Expand All @@ -55,4 +55,4 @@ async def search(self, query: str) -> WebAnswer:
async with httpx.AsyncClient() as client:
response = await client.get(self.base_url, headers=self.headers, params=params)
response.raise_for_status()
return WebAnswer.model_validate(response.json()['webPages'])
return WebAnswer.model_validate(response.json()["webPages"])

0 comments on commit e697aae

Please sign in to comment.