feat: pre-commit result

This commit is contained in:
Young Han 2025-07-14 14:32:58 -07:00
parent f65a260cdd
commit b884bc490b
10 changed files with 286 additions and 288 deletions

View file

@ -4,15 +4,15 @@
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
from typing import Any, Union
from llama_stack.schema_utils import json_schema_type
from typing import Any
from pydantic import BaseModel, Field
from llama_stack.schema_utils import json_schema_type
class LlamaCppProviderDataValidator(BaseModel):
llamacpp_api_key: Union[str, None] = Field(
llamacpp_api_key: str | None = Field(
default=None,
description="API key for llama.cpp server (optional for local servers)",
)
@ -20,7 +20,7 @@ class LlamaCppProviderDataValidator(BaseModel):
@json_schema_type
class LlamaCppImplConfig(BaseModel):
api_key: Union[str, None] = Field(
api_key: str | None = Field(
default=None,
description="The llama.cpp server API key (optional for local servers)",
)
@ -31,9 +31,7 @@ class LlamaCppImplConfig(BaseModel):
)
@classmethod
def sample_run_config(
cls, api_key: str = "${env.LLAMACPP_API_KEY:}"
) -> dict[str, Any]:
def sample_run_config(cls, api_key: str = "${env.LLAMACPP_API_KEY:=}") -> dict[str, Any]:
return {
"openai_compat_api_base": "${env.LLAMACPP_URL:http://localhost:8080}/v1",
"api_key": api_key,