Skip to content
Merged
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
2 changes: 1 addition & 1 deletion aai_cli/code_gen/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def _has(*keys: str) -> Callable[[dict[str, object]], bool]:
return lambda merged: any(bool(merged.get(k)) for k in keys)
return lambda merged: any(merged.get(k) for k in keys)


_SNIPPETS: list[_Entry] = [
Expand Down
6 changes: 4 additions & 2 deletions aai_cli/init/scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ def scaffold(
root = _template_root(template)
target.mkdir(parents=True, exist_ok=True)
_copy_tree(root, target)
lines = [f"ASSEMBLYAI_API_KEY={api_key or PLACEHOLDER_KEY}"]
lines += [f"{k}={v}" for k, v in (env_vars or {}).items()]
lines = [
f"ASSEMBLYAI_API_KEY={api_key or PLACEHOLDER_KEY}",
*(f"{k}={v}" for k, v in (env_vars or {}).items()),
]
env_path = target / ".env"
# The .env holds the real API key, so create it readable/writable by the owner
# only (0600) instead of the umask default (commonly 0644) — otherwise the key
Expand Down
7 changes: 1 addition & 6 deletions aai_cli/jsonshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ def as_object_list(value: object) -> list[dict[str, object]] | None:


def mapping_list(value: object) -> list[dict[str, object]]:
valid: list[dict[str, object]] = []
for item in object_list(value):
mapped = as_mapping(item)
if mapped is not None:
valid.append(mapped)
return valid
return [mapped for item in object_list(value) if (mapped := as_mapping(item)) is not None]


def as_int(value: object, default: int = 0) -> int:
Expand Down
3 changes: 1 addition & 2 deletions aai_cli/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ def usage_of(response: ChatCompletion) -> dict[str, Any] | None:
usage = response.usage
if usage is None:
return None
dumped: dict[str, Any] = usage.model_dump()
return dumped
return usage.model_dump()


def transform_transcript(
Expand Down
Loading