mirror of
https://github.com/hwchase17/langchain.git
synced 2026-04-02 18:32:56 +00:00
x
This commit is contained in:
@@ -1298,14 +1298,18 @@ class AzureSearch(VectorStore):
|
||||
}
|
||||
),
|
||||
**{
|
||||
"captions": {
|
||||
"text": result.get("@search.captions", [{}])[0].text,
|
||||
"highlights": result.get("@search.captions", [{}])[
|
||||
0
|
||||
].highlights,
|
||||
}
|
||||
if result.get("@search.captions")
|
||||
else {},
|
||||
"captions": (
|
||||
{
|
||||
"text": result.get("@search.captions", [{}])[
|
||||
0
|
||||
].text,
|
||||
"highlights": result.get("@search.captions", [{}])[
|
||||
0
|
||||
].highlights,
|
||||
}
|
||||
if result.get("@search.captions")
|
||||
else {}
|
||||
),
|
||||
"answers": semantic_answers_dict.get(
|
||||
result.get(FIELDS_ID, ""),
|
||||
"",
|
||||
@@ -1382,14 +1386,18 @@ class AzureSearch(VectorStore):
|
||||
}
|
||||
),
|
||||
**{
|
||||
"captions": {
|
||||
"text": result.get("@search.captions", [{}])[0].text,
|
||||
"highlights": result.get("@search.captions", [{}])[
|
||||
0
|
||||
].highlights,
|
||||
}
|
||||
if result.get("@search.captions")
|
||||
else {},
|
||||
"captions": (
|
||||
{
|
||||
"text": result.get("@search.captions", [{}])[
|
||||
0
|
||||
].text,
|
||||
"highlights": result.get("@search.captions", [{}])[
|
||||
0
|
||||
].highlights,
|
||||
}
|
||||
if result.get("@search.captions")
|
||||
else {}
|
||||
),
|
||||
"answers": semantic_answers_dict.get(
|
||||
result.get(FIELDS_ID, ""),
|
||||
"",
|
||||
@@ -1421,10 +1429,10 @@ class AzureSearch(VectorStore):
|
||||
azure_search = cls(
|
||||
azure_search_endpoint,
|
||||
azure_search_key,
|
||||
azure_ad_access_token,
|
||||
index_name,
|
||||
embedding,
|
||||
fields=fields,
|
||||
azure_ad_access_token=azure_ad_access_token,
|
||||
**kwargs,
|
||||
)
|
||||
azure_search.add_texts(texts, metadatas, **kwargs)
|
||||
@@ -1447,10 +1455,10 @@ class AzureSearch(VectorStore):
|
||||
azure_search = cls(
|
||||
azure_search_endpoint,
|
||||
azure_search_key,
|
||||
azure_ad_access_token,
|
||||
index_name,
|
||||
embedding,
|
||||
fields=fields,
|
||||
azure_ad_access_token=azure_ad_access_token,
|
||||
**kwargs,
|
||||
)
|
||||
await azure_search.aadd_texts(texts, metadatas, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user