From df23e0c32fb8831b7ff07dd6aeb140b3d20bb238 Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Thu, 20 Nov 2025 14:34:04 +0100 Subject: [PATCH] Fixed pre commit --- docs/docs/providers/vector_io/remote_elasticsearch.mdx | 10 +++++----- .../ci-tests/run-with-postgres-store.yaml | 8 ++++++++ src/llama_stack/distributions/ci-tests/run.yaml | 8 ++++++++ .../distributions/starter/run-with-postgres-store.yaml | 4 ++-- src/llama_stack/distributions/starter/run.yaml | 2 +- .../remote/vector_io/elasticsearch/__init__.py | 2 +- .../providers/remote/vector_io/elasticsearch/config.py | 2 +- .../remote/vector_io/elasticsearch/elasticsearch.py | 6 ++---- 8 files changed, 28 insertions(+), 14 deletions(-) diff --git a/docs/docs/providers/vector_io/remote_elasticsearch.mdx b/docs/docs/providers/vector_io/remote_elasticsearch.mdx index 864015a5c..5deed1a27 100644 --- a/docs/docs/providers/vector_io/remote_elasticsearch.mdx +++ b/docs/docs/providers/vector_io/remote_elasticsearch.mdx @@ -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 diff --git a/src/llama_stack/distributions/ci-tests/run-with-postgres-store.yaml b/src/llama_stack/distributions/ci-tests/run-with-postgres-store.yaml index 5384b58fe..590e01668 100644 --- a/src/llama_stack/distributions/ci-tests/run-with-postgres-store.yaml +++ b/src/llama_stack/distributions/ci-tests/run-with-postgres-store.yaml @@ -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 diff --git a/src/llama_stack/distributions/ci-tests/run.yaml b/src/llama_stack/distributions/ci-tests/run.yaml index 1118d2ad1..b4caf1668 100644 --- a/src/llama_stack/distributions/ci-tests/run.yaml +++ b/src/llama_stack/distributions/ci-tests/run.yaml @@ -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 diff --git a/src/llama_stack/distributions/starter/run-with-postgres-store.yaml b/src/llama_stack/distributions/starter/run-with-postgres-store.yaml index e2e301d9e..f6e301b9f 100644 --- a/src/llama_stack/distributions/starter/run-with-postgres-store.yaml +++ b/src/llama_stack/distributions/starter/run-with-postgres-store.yaml @@ -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 diff --git a/src/llama_stack/distributions/starter/run.yaml b/src/llama_stack/distributions/starter/run.yaml index 81d7e47cb..e2beeec7c 100644 --- a/src/llama_stack/distributions/starter/run.yaml +++ b/src/llama_stack/distributions/starter/run.yaml @@ -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 diff --git a/src/llama_stack/providers/remote/vector_io/elasticsearch/__init__.py b/src/llama_stack/providers/remote/vector_io/elasticsearch/__init__.py index 6370c6196..33e3930a2 100644 --- a/src/llama_stack/providers/remote/vector_io/elasticsearch/__init__.py +++ b/src/llama_stack/providers/remote/vector_io/elasticsearch/__init__.py @@ -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 diff --git a/src/llama_stack/providers/remote/vector_io/elasticsearch/config.py b/src/llama_stack/providers/remote/vector_io/elasticsearch/config.py index 0559868f9..caa7e7891 100644 --- a/src/llama_stack/providers/remote/vector_io/elasticsearch/config.py +++ b/src/llama_stack/providers/remote/vector_io/elasticsearch/config.py @@ -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 diff --git a/src/llama_stack/providers/remote/vector_io/elasticsearch/elasticsearch.py b/src/llama_stack/providers/remote/vector_io/elasticsearch/elasticsearch.py index 8fc876b23..85042413a 100644 --- a/src/llama_stack/providers/remote/vector_io/elasticsearch/elasticsearch.py +++ b/src/llama_stack/providers/remote/vector_io/elasticsearch/elasticsearch.py @@ -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