mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-05 18:27:22 +00:00
feat: refactor llama-stack-api structure
move llama_stack_api.apis... to top level llama_stack_api. merge provider datatypes and the existing apis.datatypes into a common llama_stack_api.datatypes update all usages of these packages throughout LLS Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
parent
d6b915ce0a
commit
b7480e9c88
296 changed files with 906 additions and 1109 deletions
|
|
@ -9,8 +9,8 @@ from unittest.mock import AsyncMock, MagicMock, patch
|
|||
|
||||
import numpy as np
|
||||
import pytest
|
||||
from llama_stack_api.apis.vector_io import Chunk, ChunkMetadata, QueryChunksResponse
|
||||
from llama_stack_api.apis.vector_stores import VectorStore
|
||||
from llama_stack_api.vector_io import Chunk, ChunkMetadata, QueryChunksResponse
|
||||
from llama_stack_api.vector_stores import VectorStore
|
||||
|
||||
from llama_stack.core.storage.datatypes import KVStoreReference, SqliteKVStoreConfig
|
||||
from llama_stack.providers.inline.vector_io.faiss.config import FaissVectorIOConfig
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ from unittest.mock import MagicMock, patch
|
|||
|
||||
import numpy as np
|
||||
import pytest
|
||||
from llama_stack_api.apis.files import Files
|
||||
from llama_stack_api.apis.vector_io import Chunk, QueryChunksResponse
|
||||
from llama_stack_api.apis.vector_stores import VectorStore
|
||||
from llama_stack_api.providers.datatypes import HealthStatus
|
||||
from llama_stack_api.datatypes import HealthStatus
|
||||
from llama_stack_api.files import Files
|
||||
from llama_stack_api.vector_io import Chunk, QueryChunksResponse
|
||||
from llama_stack_api.vector_stores import VectorStore
|
||||
|
||||
from llama_stack.providers.inline.vector_io.faiss.config import FaissVectorIOConfig
|
||||
from llama_stack.providers.inline.vector_io.faiss.faiss import (
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import asyncio
|
|||
|
||||
import numpy as np
|
||||
import pytest
|
||||
from llama_stack_api.apis.vector_io import Chunk, QueryChunksResponse
|
||||
from llama_stack_api.vector_io import Chunk, QueryChunksResponse
|
||||
|
||||
from llama_stack.providers.inline.vector_io.sqlite_vec.sqlite_vec import (
|
||||
SQLiteVecIndex,
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ from unittest.mock import AsyncMock, patch
|
|||
|
||||
import numpy as np
|
||||
import pytest
|
||||
from llama_stack_api.apis.common.errors import VectorStoreNotFoundError
|
||||
from llama_stack_api.apis.vector_io import (
|
||||
from llama_stack_api.common.errors import VectorStoreNotFoundError
|
||||
from llama_stack_api.vector_io import (
|
||||
Chunk,
|
||||
OpenAICreateVectorStoreFileBatchRequestWithExtraBody,
|
||||
OpenAICreateVectorStoreRequestWithExtraBody,
|
||||
|
|
@ -19,7 +19,7 @@ from llama_stack_api.apis.vector_io import (
|
|||
VectorStoreChunkingStrategyAuto,
|
||||
VectorStoreFileObject,
|
||||
)
|
||||
from llama_stack_api.apis.vector_stores import VectorStore
|
||||
from llama_stack_api.vector_stores import VectorStore
|
||||
|
||||
from llama_stack.providers.inline.vector_io.sqlite_vec.sqlite_vec import VECTOR_DBS_PREFIX
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ async def test_insert_chunks_missing_db_raises(vector_io_adapter):
|
|||
|
||||
async def test_insert_chunks_with_missing_document_id(vector_io_adapter):
|
||||
"""Ensure no KeyError when document_id is missing or in different places."""
|
||||
from llama_stack_api.apis.vector_io import Chunk, ChunkMetadata
|
||||
from llama_stack_api.vector_io import Chunk, ChunkMetadata
|
||||
|
||||
fake_index = AsyncMock()
|
||||
vector_io_adapter.cache["db1"] = fake_index
|
||||
|
|
@ -255,7 +255,7 @@ async def test_insert_chunks_with_missing_document_id(vector_io_adapter):
|
|||
|
||||
async def test_document_id_with_invalid_type_raises_error():
|
||||
"""Ensure TypeError is raised when document_id is not a string."""
|
||||
from llama_stack_api.apis.vector_io import Chunk
|
||||
from llama_stack_api.vector_io import Chunk
|
||||
|
||||
# Integer document_id should raise TypeError
|
||||
from llama_stack.providers.utils.vector_io.vector_utils import generate_chunk_id
|
||||
|
|
|
|||
|
|
@ -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_api.apis.vector_io import Chunk, ChunkMetadata
|
||||
from llama_stack_api.vector_io import Chunk, ChunkMetadata
|
||||
|
||||
from llama_stack.providers.utils.vector_io.vector_utils import generate_chunk_id
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue