fix msg, urls

This commit is contained in:
Xi Yan 2024-11-06 13:09:04 -08:00
parent 711edb3448
commit 6b1b3d02ee
4 changed files with 9 additions and 7 deletions

View file

@ -40,6 +40,7 @@ class StackConfigure(Subcommand):
self.parser.error(
"""
DEPRECATED! llama stack configure has been deprecated.
Please use llama stack run --config <path/to/run.yaml> instead. You may find example run.yaml in ./llamas_stack/templates
Please use llama stack run --config <path/to/run.yaml> instead.
You may find example run.yaml in /distributions folder.
"""
)

View file

@ -70,13 +70,12 @@ class StackRun(Subcommand):
if not config_file.exists():
self.parser.error(
f"File {str(config_file)} does not exist. Please run `llama stack build` to generate a run.yaml file"
f"File {str(config_file)} does not exist. Please run `llama stack build` to generate (and optionally edit) a run.yaml file"
)
return
with open(config_file, "r") as f:
config_dict = yaml.safe_load(config_file.read_text())
config = parse_and_maybe_upgrade_config(config_dict)
config_dict = yaml.safe_load(config_file.read_text())
config = parse_and_maybe_upgrade_config(config_dict)
if config.docker_image:
script = pkg_resources.resource_filename(

View file

@ -14,10 +14,11 @@ from pydantic import BaseModel, Field
class TGIImplConfig(BaseModel):
host: str = "localhost"
port: int = 8080
protocol: str = "http"
@property
def url(self) -> str:
return f"http://{self.host}:{self.port}"
return f"{self.protocol}://{self.host}:{self.port}"
api_token: Optional[str] = Field(
default=None,

View file

@ -146,10 +146,11 @@ Fully-qualified name of the module to import. The module is expected to have:
class RemoteProviderConfig(BaseModel):
host: str = "localhost"
port: int = 0
protocol: str = "http"
@property
def url(self) -> str:
return f"http://{self.host}:{self.port}"
return f"{self.protocol}://{self.host}:{self.port}"
@json_schema_type