AlibabaCloudOpenSearchSettings#
- class langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings(endpoint: str, instance_id: str, username: str, password: str, table_name: str, field_name_mapping: Dict[str, str], protocol: str = 'http', namespace: str = '', embedding_field_separator: str = ',', output_fields: List[str] | None = None)[source]#
Alibaba Cloud Opensearch` client configuration.
- Attribute:
- endpoint (str)The endpoint of opensearch instance, You can find it
from the console of Alibaba Cloud OpenSearch.
- instance_id (str)The identify of opensearch instance, You can find
it from the console of Alibaba Cloud OpenSearch.
username (str) : The username specified when purchasing the instance. password (str) : The password specified when purchasing the instance,
After the instance is created, you can modify it on the console.
tablename (str): The table name specified during instance configuration. field_name_mapping (Dict) : Using field name mapping between opensearch
vector store and opensearch instance configuration table field names:
- {
‘id’: ‘The id field name map of index document.’, ‘document’: ‘The text field name map of index document.’, ‘embedding’: ‘In the embedding field of the opensearch instance,
the values must be in float type and separated by separator, default is comma.’,
- ‘metadata_field_x’: ‘Metadata field mapping includes the mapped
field name and operator in the mapping value, separated by a comma between the mapped field name and the operator.’,
} protocol (str): Communication Protocol between SDK and Server, default is http. namespace (str) : The instance data will be partitioned based on the “namespace”
field,If the namespace is enabled, you need to specify the namespace field name during initialization, Otherwise, the queries cannot be executed correctly.
- embedding_field_separator(str): Delimiter specified for writing vector
field data, default is comma.
- output_fields: Specify the field list returned when invoking OpenSearch,
by default it is the value list of the field mapping field.
Methods
__init__
(endpoint, instance_id, username, ...)- Parameters:
endpoint (str) –
instance_id (str) –
username (str) –
password (str) –
table_name (str) –
field_name_mapping (Dict[str, str]) –
protocol (str) –
namespace (str) –
embedding_field_separator (str) –
output_fields (List[str] | None) –
- __init__(endpoint: str, instance_id: str, username: str, password: str, table_name: str, field_name_mapping: Dict[str, str], protocol: str = 'http', namespace: str = '', embedding_field_separator: str = ',', output_fields: List[str] | None = None) None [source]#
- Parameters:
endpoint (str) –
instance_id (str) –
username (str) –
password (str) –
table_name (str) –
field_name_mapping (Dict[str, str]) –
protocol (str) –
namespace (str) –
embedding_field_separator (str) –
output_fields (List[str] | None) –
- Return type:
None
Examples using AlibabaCloudOpenSearchSettings