Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/llama_stack_client/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ def __init__(
) -> None:
"""Construct a new synchronous llama-stack-client client instance.

This automatically infers the `api_key` argument from the `LLAMA_STACK_CLIENT_API_KEY` environment variable if it is not provided.
This automatically infers the `api_key` argument from the `LLAMA_STACK_API_KEY` environment variable if it is not provided.
"""
if api_key is None:
api_key = os.environ.get("LLAMA_STACK_CLIENT_API_KEY")
api_key = os.environ.get("LLAMA_STACK_API_KEY")
self.api_key = api_key

if base_url is None:
base_url = os.environ.get("LLAMA_STACK_CLIENT_BASE_URL")
base_url = os.environ.get("LLAMA_STACK_BASE_URL")
if base_url is None:
base_url = f"http://any-hosted-llama-stack.com"

Expand Down Expand Up @@ -342,14 +342,14 @@ def __init__(
) -> None:
"""Construct a new async llama-stack-client client instance.

This automatically infers the `api_key` argument from the `LLAMA_STACK_CLIENT_API_KEY` environment variable if it is not provided.
This automatically infers the `api_key` argument from the `LLAMA_STACK_API_KEY` environment variable if it is not provided.
"""
if api_key is None:
api_key = os.environ.get("LLAMA_STACK_CLIENT_API_KEY")
api_key = os.environ.get("LLAMA_STACK_API_KEY")
self.api_key = api_key

if base_url is None:
base_url = os.environ.get("LLAMA_STACK_CLIENT_BASE_URL")
base_url = os.environ.get("LLAMA_STACK_BASE_URL")
if base_url is None:
base_url = f"http://any-hosted-llama-stack.com"

Expand Down
2 changes: 1 addition & 1 deletion src/llama_stack_client/_utils/_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def _basic_config() -> None:


def setup_logging() -> None:
env = os.environ.get("LLAMA_STACK_CLIENT_LOG")
env = os.environ.get("LLAMA_STACK_LOG")
if env == "debug":
_basic_config()
logger.setLevel(logging.DEBUG)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def test_base_url_setter(self) -> None:
assert client.base_url == "https://example.com/from_setter/"

def test_base_url_env(self) -> None:
with update_env(LLAMA_STACK_CLIENT_BASE_URL="http://localhost:5000/from/env"):
with update_env(LLAMA_STACK_BASE_URL="http://localhost:5000/from/env"):
client = LlamaStackClient(_strict_response_validation=True)
assert client.base_url == "http://localhost:5000/from/env/"

Expand Down Expand Up @@ -1316,7 +1316,7 @@ def test_base_url_setter(self) -> None:
assert client.base_url == "https://example.com/from_setter/"

def test_base_url_env(self) -> None:
with update_env(LLAMA_STACK_CLIENT_BASE_URL="http://localhost:5000/from/env"):
with update_env(LLAMA_STACK_BASE_URL="http://localhost:5000/from/env"):
client = AsyncLlamaStackClient(_strict_response_validation=True)
assert client.base_url == "http://localhost:5000/from/env/"

Expand Down