mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-15 22:47:59 +00:00
working tests
This commit is contained in:
parent
4f5c4d1e3b
commit
23777abeb7
4 changed files with 54 additions and 13 deletions
|
@ -9,12 +9,12 @@ from typing import Any, Dict, List, Literal, Optional, Protocol, runtime_checkab
|
|||
from llama_models.schema_utils import json_schema_type, webmethod
|
||||
from pydantic import Field
|
||||
|
||||
from llama_stack.apis.resource import Resource
|
||||
from llama_stack.apis.resource import Resource, ResourceType
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class Model(Resource):
|
||||
type: Literal["model"] = "model"
|
||||
type: Literal[ResourceType.model.value] = ResourceType.model.value
|
||||
llama_model: str = Field(
|
||||
description="Pointer to the underlying core Llama family model. Each model served by Llama Stack must have a core Llama model.",
|
||||
)
|
||||
|
@ -33,4 +33,11 @@ class Models(Protocol):
|
|||
async def get_model(self, identifier: str) -> Optional[Model]: ...
|
||||
|
||||
@webmethod(route="/models/register", method="POST")
|
||||
async def register_model(self, model: Model) -> None: ...
|
||||
async def register_model(
|
||||
self,
|
||||
model_id: str,
|
||||
provider_model_id: Optional[str] = None,
|
||||
provider_id: Optional[str] = None,
|
||||
llama_model: Optional[str] = None,
|
||||
metadata: Optional[Dict[str, Any]] = None,
|
||||
) -> Model: ...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue