Skip to content

Commit 78187e4

Browse files
committed
Remove whitespace changes
1 parent a547b1e commit 78187e4

File tree

2 files changed

+11
-47
lines changed

2 files changed

+11
-47
lines changed

app/backend/approaches/retrievethenread.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,10 @@ async def run(
145145
}
146146

147147
async def run_search_approach(
148-
self,
149-
messages: list[ChatCompletionMessageParam],
150-
overrides: dict[str, Any],
151-
auth_claims: dict[str, Any],
148+
self, messages: list[ChatCompletionMessageParam], overrides: dict[str, Any], auth_claims: dict[str, Any]
152149
) -> ExtraInfo:
153150
use_text_search = overrides.get("retrieval_mode") in ["text", "hybrid", None]
154-
use_vector_search = overrides.get("retrieval_mode") in [
155-
"vectors",
156-
"hybrid",
157-
None,
158-
]
151+
use_vector_search = overrides.get("retrieval_mode") in ["vectors", "hybrid", None]
159152
use_semantic_ranker = True if overrides.get("semantic_ranker") else False
160153
use_query_rewriting = True if overrides.get("query_rewriting") else False
161154
use_semantic_captions = True if overrides.get("semantic_captions") else False
@@ -190,10 +183,7 @@ async def run_search_approach(
190183
)
191184

192185
data_points = await self.get_sources_content(
193-
results,
194-
use_semantic_captions,
195-
download_image_sources=send_image_sources,
196-
user_oid=auth_claims.get("oid"),
186+
results, use_semantic_captions, download_image_sources=send_image_sources, user_oid=auth_claims.get("oid")
197187
)
198188

199189
return ExtraInfo(

app/backend/prepdocslib/searchmanager.py

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,7 @@ async def create_index(self):
232232
type="Edm.String",
233233
analyzer_name=self.search_analyzer_name,
234234
),
235-
SimpleField(
236-
name="category",
237-
type="Edm.String",
238-
filterable=True,
239-
facetable=True,
240-
),
235+
SimpleField(name="category", type="Edm.String", filterable=True, facetable=True),
241236
SimpleField(
242237
name="sourcepage",
243238
type="Edm.String",
@@ -282,10 +277,7 @@ async def create_index(self):
282277
vector_algorithms: list[VectorSearchAlgorithmConfiguration] = []
283278
vector_compressions: list[VectorSearchCompression] = []
284279
if embedding_field:
285-
logger.info(
286-
"Including %s field for text vectors in new index",
287-
embedding_field.name,
288-
)
280+
logger.info("Including %s field for text vectors in new index", embedding_field.name)
289281
fields.append(embedding_field)
290282
if text_vectorizer is not None:
291283
vectorizers.append(text_vectorizer)
@@ -300,10 +292,7 @@ async def create_index(self):
300292
vector_compressions.append(text_vector_compression)
301293

302294
if images_field:
303-
logger.info(
304-
"Including %s field for image descriptions and vectors in new index",
305-
images_field.name,
306-
)
295+
logger.info("Including %s field for image descriptions and vectors in new index", images_field.name)
307296
fields.append(images_field)
308297
if image_vector_search_profile is None or image_vector_algorithm is None:
309298
raise ValueError("Image search profile and algorithm must be set")
@@ -340,10 +329,7 @@ async def create_index(self):
340329
logger.info("Search index %s already exists", self.search_info.index_name)
341330
existing_index = await search_index_client.get_index(self.search_info.index_name)
342331
if not any(field.name == "storageUrl" for field in existing_index.fields):
343-
logger.info(
344-
"Adding storageUrl field to index %s",
345-
self.search_info.index_name,
346-
)
332+
logger.info("Adding storageUrl field to index %s", self.search_info.index_name)
347333
existing_index.fields.append(
348334
SimpleField(
349335
name="storageUrl",
@@ -408,10 +394,7 @@ async def create_index(self):
408394

409395
if existing_index.semantic_search:
410396
if not existing_index.semantic_search.default_configuration_name:
411-
logger.info(
412-
"Adding default semantic configuration to index %s",
413-
self.search_info.index_name,
414-
)
397+
logger.info("Adding default semantic configuration to index %s", self.search_info.index_name)
415398
existing_index.semantic_search.default_configuration_name = "default"
416399

417400
if existing_index.semantic_search.configurations:
@@ -421,10 +404,7 @@ async def create_index(self):
421404
and existing_semantic_config.prioritized_fields.title_field
422405
and not existing_semantic_config.prioritized_fields.title_field.field_name == "sourcepage"
423406
):
424-
logger.info(
425-
"Updating semantic configuration for index %s",
426-
self.search_info.index_name,
427-
)
407+
logger.info("Updating semantic configuration for index %s", self.search_info.index_name)
428408
existing_semantic_config.prioritized_fields.title_field = SemanticField(
429409
field_name="sourcepage"
430410
)
@@ -434,10 +414,7 @@ async def create_index(self):
434414
or len(existing_index.vector_search.vectorizers) == 0
435415
):
436416
if self.embeddings is not None and isinstance(self.embeddings, AzureOpenAIEmbeddingService):
437-
logger.info(
438-
"Adding vectorizer to search index %s",
439-
self.search_info.index_name,
440-
)
417+
logger.info("Adding vectorizer to search index %s", self.search_info.index_name)
441418
existing_index.vector_search.vectorizers = [
442419
AzureOpenAIVectorizer(
443420
vectorizer_name=f"{self.search_info.index_name}-vectorizer",
@@ -578,10 +555,7 @@ async def remove_content(self, path: Optional[str] = None, only_oid: Optional[st
578555
filter = f"sourcefile eq '{path_for_filter}'"
579556
max_results = 1000
580557
result = await search_client.search(
581-
search_text="",
582-
filter=filter,
583-
top=max_results,
584-
include_total_count=True,
558+
search_text="", filter=filter, top=max_results, include_total_count=True
585559
)
586560
result_count = await result.get_count()
587561
if result_count == 0:

0 commit comments

Comments
 (0)