mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 20:14:13 +00:00
Move control plane to distribution server for now
This commit is contained in:
parent
099ac81bc7
commit
a0bf20f19a
14 changed files with 22 additions and 26 deletions
35
llama_stack/distribution/control_plane/api.py
Normal file
35
llama_stack/distribution/control_plane/api.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 datetime import datetime
|
||||
from typing import Any, List, Optional, Protocol
|
||||
|
||||
from llama_models.schema_utils import json_schema_type, webmethod
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class ControlPlaneValue(BaseModel):
|
||||
key: str
|
||||
value: Any
|
||||
expiration: Optional[datetime] = None
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class ControlPlane(Protocol):
|
||||
@webmethod(route="/control_plane/set")
|
||||
async def set(
|
||||
self, key: str, value: Any, expiration: Optional[datetime] = None
|
||||
) -> None: ...
|
||||
|
||||
@webmethod(route="/control_plane/get", method="GET")
|
||||
async def get(self, key: str) -> Optional[ControlPlaneValue]: ...
|
||||
|
||||
@webmethod(route="/control_plane/delete")
|
||||
async def delete(self, key: str) -> None: ...
|
||||
|
||||
@webmethod(route="/control_plane/range", method="GET")
|
||||
async def range(self, start_key: str, end_key: str) -> List[ControlPlaneValue]: ...
|
Loading…
Add table
Add a link
Reference in a new issue