mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 19:04:19 +00:00
Refactor the API enum to an independent file into llama_stack/apis/
This commit is contained in:
parent
74f6af8bbe
commit
75a2694daa
2 changed files with 37 additions and 27 deletions
35
llama_stack/apis/datatypes.py
Normal file
35
llama_stack/apis/datatypes.py
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
|
# the root directory of this source tree.
|
||||||
|
|
||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
from llama_models.schema_utils import json_schema_type
|
||||||
|
|
||||||
|
|
||||||
|
@json_schema_type
|
||||||
|
class Api(Enum):
|
||||||
|
inference = "inference"
|
||||||
|
safety = "safety"
|
||||||
|
agents = "agents"
|
||||||
|
memory = "memory"
|
||||||
|
datasetio = "datasetio"
|
||||||
|
scoring = "scoring"
|
||||||
|
eval = "eval"
|
||||||
|
post_training = "post_training"
|
||||||
|
tool_runtime = "tool_runtime"
|
||||||
|
|
||||||
|
telemetry = "telemetry"
|
||||||
|
|
||||||
|
models = "models"
|
||||||
|
shields = "shields"
|
||||||
|
memory_banks = "memory_banks"
|
||||||
|
datasets = "datasets"
|
||||||
|
scoring_functions = "scoring_functions"
|
||||||
|
eval_tasks = "eval_tasks"
|
||||||
|
tool_groups = "tool_groups"
|
||||||
|
|
||||||
|
# built-in API
|
||||||
|
inspect = "inspect"
|
|
@ -4,7 +4,6 @@
|
||||||
# This source code is licensed under the terms described in the LICENSE file in
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
# the root directory of this source tree.
|
# the root directory of this source tree.
|
||||||
|
|
||||||
from enum import Enum
|
|
||||||
from typing import Any, List, Optional, Protocol
|
from typing import Any, List, Optional, Protocol
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
|
@ -12,6 +11,8 @@ from llama_models.schema_utils import json_schema_type
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
from llama_stack.apis.datasets import Dataset
|
from llama_stack.apis.datasets import Dataset
|
||||||
|
|
||||||
|
from llama_stack.apis.datatypes import Api
|
||||||
from llama_stack.apis.eval_tasks import EvalTask
|
from llama_stack.apis.eval_tasks import EvalTask
|
||||||
from llama_stack.apis.memory_banks.memory_banks import MemoryBank
|
from llama_stack.apis.memory_banks.memory_banks import MemoryBank
|
||||||
from llama_stack.apis.models import Model
|
from llama_stack.apis.models import Model
|
||||||
|
@ -20,32 +21,6 @@ from llama_stack.apis.shields import Shield
|
||||||
from llama_stack.apis.tools import Tool
|
from llama_stack.apis.tools import Tool
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class Api(Enum):
|
|
||||||
inference = "inference"
|
|
||||||
safety = "safety"
|
|
||||||
agents = "agents"
|
|
||||||
memory = "memory"
|
|
||||||
datasetio = "datasetio"
|
|
||||||
scoring = "scoring"
|
|
||||||
eval = "eval"
|
|
||||||
post_training = "post_training"
|
|
||||||
tool_runtime = "tool_runtime"
|
|
||||||
|
|
||||||
telemetry = "telemetry"
|
|
||||||
|
|
||||||
models = "models"
|
|
||||||
shields = "shields"
|
|
||||||
memory_banks = "memory_banks"
|
|
||||||
datasets = "datasets"
|
|
||||||
scoring_functions = "scoring_functions"
|
|
||||||
eval_tasks = "eval_tasks"
|
|
||||||
tool_groups = "tool_groups"
|
|
||||||
|
|
||||||
# built-in API
|
|
||||||
inspect = "inspect"
|
|
||||||
|
|
||||||
|
|
||||||
class ModelsProtocolPrivate(Protocol):
|
class ModelsProtocolPrivate(Protocol):
|
||||||
async def register_model(self, model: Model) -> None: ...
|
async def register_model(self, model: Model) -> None: ...
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue