mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 01:48:05 +00:00
Fixed pre commit
This commit is contained in:
parent
7034637cac
commit
df23e0c32f
8 changed files with 28 additions and 14 deletions
|
|
@ -89,15 +89,15 @@ See [Elasticsearch's documentation](https://www.elastic.co/docs/solutions/search
|
|||
|
||||
| Field | Type | Required | Default | Description |
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `api_key` | `str \| None` | No | | The API key for the Elasticsearch instance |
|
||||
| `hosts` | `str \| None` | No | localhost:9200 | The URL of the Elasticsearch instance |
|
||||
| `persistence` | `llama_stack.core.storage.datatypes.KVStoreReference \| None` | No | | Config for KV store backend (SQLite only for now) |
|
||||
| `elasticsearch_api_key` | `str \| None` | No | | The API key for the Elasticsearch instance |
|
||||
| `elasticsearch_url` | `str \| None` | No | localhost:9200 | The URL of the Elasticsearch instance |
|
||||
| `persistence` | `KVStoreReference \| None` | No | | Config for KV store backend (SQLite only for now) |
|
||||
|
||||
## Sample Configuration
|
||||
|
||||
```yaml
|
||||
hosts: ${env.ELASTICSEARCH_API_KEY:=None}
|
||||
api_key: ${env.ELASTICSEARCH_URL:=localhost:9200}
|
||||
elasticsearch_url: ${env.ELASTICSEARCH_URL:=localhost:9200}
|
||||
elasticsearch_api_key: ${env.ELASTICSEARCH_API_KEY:=}
|
||||
persistence:
|
||||
namespace: vector_io::elasticsearch
|
||||
backend: kv_default
|
||||
|
|
|
|||
|
|
@ -146,6 +146,14 @@ providers:
|
|||
persistence:
|
||||
namespace: vector_io::weaviate
|
||||
backend: kv_default
|
||||
- provider_id: ${env.ELASTICSEARCH_URL:+elasticsearch}
|
||||
provider_type: remote::elasticsearch
|
||||
config:
|
||||
elasticsearch_url: ${env.ELASTICSEARCH_URL:=localhost:9200}
|
||||
elasticsearch_api_key: ${env.ELASTICSEARCH_API_KEY:=}
|
||||
persistence:
|
||||
namespace: vector_io::elasticsearch
|
||||
backend: kv_default
|
||||
files:
|
||||
- provider_id: meta-reference-files
|
||||
provider_type: inline::localfs
|
||||
|
|
|
|||
|
|
@ -146,6 +146,14 @@ providers:
|
|||
persistence:
|
||||
namespace: vector_io::weaviate
|
||||
backend: kv_default
|
||||
- provider_id: ${env.ELASTICSEARCH_URL:+elasticsearch}
|
||||
provider_type: remote::elasticsearch
|
||||
config:
|
||||
elasticsearch_url: ${env.ELASTICSEARCH_URL:=localhost:9200}
|
||||
elasticsearch_api_key: ${env.ELASTICSEARCH_API_KEY:=}
|
||||
persistence:
|
||||
namespace: vector_io::elasticsearch
|
||||
backend: kv_default
|
||||
files:
|
||||
- provider_id: meta-reference-files
|
||||
provider_type: inline::localfs
|
||||
|
|
|
|||
|
|
@ -149,11 +149,11 @@ providers:
|
|||
- provider_id: ${env.ELASTICSEARCH_URL:+elasticsearch}
|
||||
provider_type: remote::elasticsearch
|
||||
config:
|
||||
elasticsearch_api_key: ${env.ELASTICSEARCH_API_KEY:=}
|
||||
elasticsearch_url: ${env.ELASTICSEARCH_URL:=localhost:9200}
|
||||
elasticsearch_api_key: ${env.ELASTICSEARCH_API_KEY:=}
|
||||
persistence:
|
||||
namespace: vector_io::elasticsearch
|
||||
backend: kv_default
|
||||
backend: kv_default
|
||||
files:
|
||||
- provider_id: meta-reference-files
|
||||
provider_type: inline::localfs
|
||||
|
|
|
|||
|
|
@ -149,8 +149,8 @@ providers:
|
|||
- provider_id: ${env.ELASTICSEARCH_URL:+elasticsearch}
|
||||
provider_type: remote::elasticsearch
|
||||
config:
|
||||
elasticsearch_api_key: ${env.ELASTICSEARCH_API_KEY:=}
|
||||
elasticsearch_url: ${env.ELASTICSEARCH_URL:=localhost:9200}
|
||||
elasticsearch_api_key: ${env.ELASTICSEARCH_API_KEY:=}
|
||||
persistence:
|
||||
namespace: vector_io::elasticsearch
|
||||
backend: kv_default
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from llama_stack.providers.datatypes import Api, ProviderSpec
|
||||
from llama_stack_api import Api, ProviderSpec
|
||||
|
||||
from .config import ElasticsearchVectorIOConfig
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from typing import Any
|
|||
from pydantic import BaseModel, Field
|
||||
|
||||
from llama_stack.core.storage.datatypes import KVStoreReference
|
||||
from llama_stack.schema_utils import json_schema_type
|
||||
from llama_stack_api import json_schema_type
|
||||
|
||||
|
||||
@json_schema_type
|
||||
|
|
|
|||
|
|
@ -229,6 +229,7 @@ class ElasticsearchIndex(EmbeddingIndex):
|
|||
log.error(f"Error deleting Elasticsearch index {self.collection_name}: {e}")
|
||||
raise
|
||||
|
||||
|
||||
class ElasticsearchVectorIOAdapter(OpenAIVectorStoreMixin, VectorIO, VectorStoresProtocolPrivate):
|
||||
def __init__(
|
||||
self,
|
||||
|
|
@ -244,10 +245,7 @@ class ElasticsearchVectorIOAdapter(OpenAIVectorStoreMixin, VectorIO, VectorStore
|
|||
self.vector_store_table = None
|
||||
|
||||
async def initialize(self) -> None:
|
||||
self.client = AsyncElasticsearch(
|
||||
hosts=self.config.elasticsearch_url,
|
||||
api_key=self.config.elasticsearch_api_key
|
||||
)
|
||||
self.client = AsyncElasticsearch(hosts=self.config.elasticsearch_url, api_key=self.config.elasticsearch_api_key)
|
||||
self.kvstore = await kvstore_impl(self.config.persistence)
|
||||
|
||||
start_key = VECTOR_DBS_PREFIX
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue