llama-stack-mirror/llama_stack/providers/utils/common/provider_utils.py
Josh Salomon 8e3b579df2 Initial commit for postgresql dataset provider
Core implementation of postgresql dataset for llama stack

Signed-off-by: Josh Salomon <jsalomon@redhat.com>
2025-04-14 14:22:54 +03:00

15 lines
543 B
Python

# 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.
def get_provider_type(module: str) -> str:
parts = module.split(".")
if parts[0] != "llama_stack" or parts[1] != "providers":
raise ValueError(f"Invalid module name <{module}>")
if parts[2] == "inline" or parts[2] == "remote":
return parts[2]
else:
raise ValueError(f"Invalid module name <{module}>")