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:
Charlie Doern 2025-11-12 15:59:34 -05:00
parent d6b915ce0a
commit b7480e9c88
296 changed files with 906 additions and 1109 deletions

View file

@ -8,8 +8,8 @@ from unittest.mock import patch
import pytest
from botocore.exceptions import ClientError
from llama_stack_api.apis.common.errors import ResourceNotFoundError
from llama_stack_api.apis.files import OpenAIFilePurpose
from llama_stack_api.common.errors import ResourceNotFoundError
from llama_stack_api.files import OpenAIFilePurpose
class TestS3FilesImpl:
@ -227,7 +227,7 @@ class TestS3FilesImpl:
mock_now.return_value = 0
from llama_stack_api.apis.files import ExpiresAfter
from llama_stack_api.files import ExpiresAfter
sample_text_file.filename = "test_expired_file"
uploaded = await s3_provider.openai_upload_file(
@ -259,7 +259,7 @@ class TestS3FilesImpl:
async def test_unsupported_expires_after_anchor(self, s3_provider, sample_text_file):
"""Unsupported anchor value should raise ValueError."""
from llama_stack_api.apis.files import ExpiresAfter
from llama_stack_api.files import ExpiresAfter
sample_text_file.filename = "test_unsupported_expires_after_anchor"
@ -272,7 +272,7 @@ class TestS3FilesImpl:
async def test_nonint_expires_after_seconds(self, s3_provider, sample_text_file):
"""Non-integer seconds in expires_after should raise ValueError."""
from llama_stack_api.apis.files import ExpiresAfter
from llama_stack_api.files import ExpiresAfter
sample_text_file.filename = "test_nonint_expires_after_seconds"
@ -285,7 +285,7 @@ class TestS3FilesImpl:
async def test_expires_after_seconds_out_of_bounds(self, s3_provider, sample_text_file):
"""Seconds outside allowed range should raise ValueError."""
from llama_stack_api.apis.files import ExpiresAfter
from llama_stack_api.files import ExpiresAfter
with pytest.raises(ValueError, match="greater than or equal to 3600"):
await s3_provider.openai_upload_file(

View file

@ -7,8 +7,8 @@
from unittest.mock import patch
import pytest
from llama_stack_api.apis.common.errors import ResourceNotFoundError
from llama_stack_api.apis.files import OpenAIFilePurpose
from llama_stack_api.common.errors import ResourceNotFoundError
from llama_stack_api.files import OpenAIFilePurpose
from llama_stack.core.datatypes import User
from llama_stack.providers.remote.files.s3.files import S3FilesImpl