chore: rebase on main

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-11-14 10:03:44 +01:00
parent e79a03b697
commit 2a257dbdea
No known key found for this signature in database
14 changed files with 27198 additions and 38612 deletions

View file

@ -114,7 +114,7 @@ repos:
language: python language: python
pass_filenames: false pass_filenames: false
require_serial: true require_serial: true
files: ^src/llama_stack/apis/ files: ^src/llama_stack_api/.*$
- id: check-workflows-use-hashes - id: check-workflows-use-hashes
name: Check GitHub Actions use SHA-pinned actions name: Check GitHub Actions use SHA-pinned actions
entry: ./scripts/check-workflows-use-hashes.sh entry: ./scripts/check-workflows-use-hashes.sh

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -13,8 +13,8 @@ from typing import Any
from fastapi import FastAPI from fastapi import FastAPI
from llama_stack.apis.datatypes import Api
from llama_stack.core.resolver import api_protocol_map from llama_stack.core.resolver import api_protocol_map
from llama_stack_api import Api
from .state import _protocol_methods_cache from .state import _protocol_methods_cache

View file

@ -18,7 +18,7 @@ from typing import Annotated, Any, get_args, get_origin
from fastapi import FastAPI from fastapi import FastAPI
from pydantic import Field, create_model from pydantic import Field, create_model
from llama_stack.apis.datatypes import Api from llama_stack_api import Api
from . import app as app_module from . import app as app_module
from .state import _dynamic_models, _extra_body_fields from .state import _dynamic_models, _extra_body_fields

View file

@ -31,7 +31,7 @@ def _import_all_modules_in_package(package_name: str) -> list[Any]:
that any register_schema() calls at module level are executed. that any register_schema() calls at module level are executed.
Args: Args:
package_name: The fully qualified package name (e.g., 'llama_stack.apis') package_name: The fully qualified package name (e.g., 'llama_stack_api')
Returns: Returns:
List of imported module objects List of imported module objects
@ -54,7 +54,7 @@ def _import_all_modules_in_package(package_name: str) -> list[Any]:
modules.append(module) modules.append(module)
# If this is a package, also try to import any .py files directly # If this is a package, also try to import any .py files directly
# (e.g., llama_stack.apis.scoring_functions.scoring_functions) # (e.g., llama_stack_api.scoring_functions.scoring_functions)
if ispkg: if ispkg:
try: try:
# Try importing the module file with the same name as the package # Try importing the module file with the same name as the package
@ -113,11 +113,11 @@ def _ensure_json_schema_types_included(openapi_schema: dict[str, Any]) -> dict[s
# Dynamically import all modules in packages that might register schemas # Dynamically import all modules in packages that might register schemas
# This ensures register_schema() calls execute and populate _registered_schemas # This ensures register_schema() calls execute and populate _registered_schemas
# Also collect the modules for later scanning of @json_schema_type decorated classes # Also collect the modules for later scanning of @json_schema_type decorated classes
apis_modules = _import_all_modules_in_package("llama_stack.apis") apis_modules = _import_all_modules_in_package("llama_stack_api")
_import_all_modules_in_package("llama_stack.core.telemetry") _import_all_modules_in_package("llama_stack.core.telemetry")
# First, handle registered schemas (union types, etc.) # First, handle registered schemas (union types, etc.)
from llama_stack.schema_utils import _registered_schemas from llama_stack_api.schema_utils import _registered_schemas
for schema_type, registration_info in _registered_schemas.items(): for schema_type, registration_info in _registered_schemas.items():
schema_name = registration_info["name"] schema_name = registration_info["name"]

View file

@ -10,7 +10,7 @@ Schema filtering and version filtering for OpenAPI generation.
from typing import Any from typing import Any
from llama_stack.apis.version import ( from llama_stack_api.version import (
LLAMA_STACK_API_V1, LLAMA_STACK_API_V1,
LLAMA_STACK_API_V1ALPHA, LLAMA_STACK_API_V1ALPHA,
LLAMA_STACK_API_V1BETA, LLAMA_STACK_API_V1BETA,
@ -25,7 +25,7 @@ def _get_all_json_schema_type_names() -> set[str]:
This ensures they are included in filtered schemas even if not directly referenced by paths. This ensures they are included in filtered schemas even if not directly referenced by paths.
""" """
schema_names = set() schema_names = set()
apis_modules = schema_collection._import_all_modules_in_package("llama_stack.apis") apis_modules = schema_collection._import_all_modules_in_package("llama_stack_api")
for module in apis_modules: for module in apis_modules:
for attr_name in dir(module): for attr_name in dir(module):
try: try:
@ -43,7 +43,7 @@ def _get_all_json_schema_type_names() -> set[str]:
def _get_explicit_schema_names(openapi_schema: dict[str, Any]) -> set[str]: def _get_explicit_schema_names(openapi_schema: dict[str, Any]) -> set[str]:
"""Get all registered schema names and @json_schema_type decorated model names.""" """Get all registered schema names and @json_schema_type decorated model names."""
from llama_stack.schema_utils import _registered_schemas from llama_stack_api.schema_utils import _registered_schemas
registered_schema_names = {info["name"] for info in _registered_schemas.values()} registered_schema_names = {info["name"] for info in _registered_schemas.values()}
json_schema_type_names = _get_all_json_schema_type_names() json_schema_type_names = _get_all_json_schema_type_names()

View file

@ -10,7 +10,7 @@ Shared state for the OpenAPI generator module.
from typing import Any from typing import Any
from llama_stack.apis.datatypes import Api from llama_stack_api import Api
# Global list to store dynamic models created during endpoint generation # Global list to store dynamic models created during endpoint generation
_dynamic_models: list[Any] = [] _dynamic_models: list[Any] = []

View file

@ -19,7 +19,7 @@ import httpx
import yaml import yaml
from fastapi import Response as FastAPIResponse from fastapi import Response as FastAPIResponse
from llama_stack_api import is_unwrapped_body_param from llama_stack.core.utils.type_inspection import is_unwrapped_body_param
try: try:
from llama_stack_client import ( from llama_stack_client import (
@ -51,7 +51,6 @@ from llama_stack.core.telemetry.tracing import CURRENT_TRACE_CONTEXT, end_trace,
from llama_stack.core.utils.config import redact_sensitive_fields from llama_stack.core.utils.config import redact_sensitive_fields
from llama_stack.core.utils.context import preserve_contexts_async_generator from llama_stack.core.utils.context import preserve_contexts_async_generator
from llama_stack.core.utils.exec import in_notebook from llama_stack.core.utils.exec import in_notebook
from llama_stack.core.utils.type_inspection import is_unwrapped_body_param
from llama_stack.log import get_logger, setup_logging from llama_stack.log import get_logger, setup_logging
logger = get_logger(name=__name__, category="core") logger = get_logger(name=__name__, category="core")

View file

@ -388,27 +388,6 @@ from .shields import (
) )
# Import from strong_typing # Import from strong_typing
from .strong_typing.core import JsonType
from .strong_typing.docstring import Docstring, parse_type
from .strong_typing.inspection import (
get_signature,
is_generic_list,
is_type_optional,
is_type_union,
is_unwrapped_body_param,
unwrap_generic_list,
unwrap_optional_type,
unwrap_union_types,
)
from .strong_typing.name import python_type_to_name
from .strong_typing.schema import (
JsonSchemaGenerator,
Schema,
SchemaOptions,
StrictJsonType,
get_schema_identifier,
)
from .strong_typing.serialization import json_dump_string, object_to_json
from .tools import ( from .tools import (
ListToolDefsResponse, ListToolDefsResponse,
ListToolGroupsResponse, ListToolGroupsResponse,

3
uv.lock generated
View file

@ -1,5 +1,5 @@
version = 1 version = 1
revision = 3 revision = 2
requires-python = ">=3.12" requires-python = ">=3.12"
resolution-markers = [ resolution-markers = [
"(python_full_version >= '3.13' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version >= '3.13' and sys_platform != 'darwin' and sys_platform != 'linux')", "(python_full_version >= '3.13' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version >= '3.13' and sys_platform != 'darwin' and sys_platform != 'linux')",
@ -2176,6 +2176,7 @@ dev = [
{ name = "black" }, { name = "black" },
{ name = "mypy" }, { name = "mypy" },
{ name = "nbval" }, { name = "nbval" },
{ name = "openapi-spec-validator", specifier = ">=0.7.2" },
{ name = "pre-commit", specifier = ">=4.4.0" }, { name = "pre-commit", specifier = ">=4.4.0" },
{ name = "pytest", specifier = ">=8.4" }, { name = "pytest", specifier = ">=8.4" },
{ name = "pytest-asyncio", specifier = ">=1.0" }, { name = "pytest-asyncio", specifier = ">=1.0" },