mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-29 03:14:19 +00:00
fix sample impls
This commit is contained in:
parent
bf0d111c53
commit
335dea849a
2 changed files with 16 additions and 2 deletions
|
@ -9,10 +9,17 @@ from .config import SampleConfig
|
||||||
|
|
||||||
from llama_stack.apis.inference import * # noqa: F403
|
from llama_stack.apis.inference import * # noqa: F403
|
||||||
|
|
||||||
|
from llama_stack.distribution.datatypes import RoutableProvider
|
||||||
|
|
||||||
class SampleInferenceImpl(Inference):
|
|
||||||
|
class SampleInferenceImpl(Inference, RoutableProvider):
|
||||||
def __init__(self, config: SampleConfig):
|
def __init__(self, config: SampleConfig):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
|
async def validate_routing_keys(self, routing_keys: list[str]) -> None:
|
||||||
|
# these are the model names the Llama Stack will use to route requests to this provider
|
||||||
|
# perform validation here if necessary
|
||||||
|
pass
|
||||||
|
|
||||||
async def initialize(self):
|
async def initialize(self):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -9,10 +9,17 @@ from .config import SampleConfig
|
||||||
|
|
||||||
from llama_stack.apis.safety import * # noqa: F403
|
from llama_stack.apis.safety import * # noqa: F403
|
||||||
|
|
||||||
|
from llama_stack.distribution.datatypes import RoutableProvider
|
||||||
|
|
||||||
class SampleSafetyImpl(Safety):
|
|
||||||
|
class SampleSafetyImpl(Safety, RoutableProvider):
|
||||||
def __init__(self, config: SampleConfig):
|
def __init__(self, config: SampleConfig):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
|
async def validate_routing_keys(self, routing_keys: list[str]) -> None:
|
||||||
|
# these are the safety shields the Llama Stack will use to route requests to this provider
|
||||||
|
# perform validation here if necessary
|
||||||
|
pass
|
||||||
|
|
||||||
async def initialize(self):
|
async def initialize(self):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue