mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-30 10:23:30 +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:
parent
46f0cea2b9
commit
914af69b44
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user