mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-09 06:53:59 +00:00
community[patch]: Update azuresearch vectorstore from_texts() method to include fields argument (#17661)
- **Description:** Update azuresearch vectorstore from_texts() method to include fields argument, necessary for creating an Azure AI Search index with custom fields. - **Issue:** Currently index fields are fixed to default fields if Azure Search index is created using from_texts() method - **Dependencies:** None - **Twitter handle:** None --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
@@ -626,6 +626,7 @@ class AzureSearch(VectorStore):
|
||||
azure_search_endpoint: str = "",
|
||||
azure_search_key: str = "",
|
||||
index_name: str = "langchain-index",
|
||||
fields: Optional[List[SearchField]] = None,
|
||||
**kwargs: Any,
|
||||
) -> AzureSearch:
|
||||
# Creating a new Azure Search instance
|
||||
@@ -634,6 +635,7 @@ class AzureSearch(VectorStore):
|
||||
azure_search_key,
|
||||
index_name,
|
||||
embedding,
|
||||
fields=fields,
|
||||
)
|
||||
azure_search.add_texts(texts, metadatas, **kwargs)
|
||||
return azure_search
|
||||
|
Reference in New Issue
Block a user