Skip to content

Commit fc49202

Browse files
committed
fixing ruff issue
1 parent 973cb14 commit fc49202

3 files changed

Lines changed: 8 additions & 21 deletions

File tree

agent_memory_toolkit/_utils.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ def _resolve_cosmos_throughput_mode(val: Optional[str]) -> str:
7878
if raw not in {"serverless", "autoscale"}:
7979
raise ConfigurationError(
8080
message=(
81-
"Invalid configuration for cosmos_throughput_mode: "
82-
f"expected 'serverless' or 'autoscale', got '{raw}'"
81+
f"Invalid configuration for cosmos_throughput_mode: expected 'serverless' or 'autoscale', got '{raw}'"
8382
),
8483
parameter="cosmos_throughput_mode",
8584
)
@@ -95,18 +94,12 @@ def _resolve_cosmos_autoscale_max_ru(val: Optional[int]) -> int:
9594
parsed = int(raw)
9695
except ValueError as exc:
9796
raise ConfigurationError(
98-
message=(
99-
"Invalid configuration for cosmos_autoscale_max_ru: "
100-
f"expected an integer, got '{raw}'"
101-
),
97+
message=(f"Invalid configuration for cosmos_autoscale_max_ru: expected an integer, got '{raw}'"),
10298
parameter="cosmos_autoscale_max_ru",
10399
) from exc
104100
if parsed <= 0:
105101
raise ConfigurationError(
106-
message=(
107-
"Invalid configuration for cosmos_autoscale_max_ru: "
108-
f"expected a positive integer, got '{raw}'"
109-
),
102+
message=(f"Invalid configuration for cosmos_autoscale_max_ru: expected a positive integer, got '{raw}'"),
110103
parameter="cosmos_autoscale_max_ru",
111104
)
112105
return parsed

agent_memory_toolkit/aio/cosmos_memory_client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
VALID_ROLES,
2121
VALID_TYPES,
2222
_build_memory_query_builder,
23-
_cosmos_container_offer_throughput,
2423
_container_policies,
24+
_cosmos_container_offer_throughput,
2525
_make_memory,
2626
_resolve_cosmos_autoscale_max_ru,
2727
_resolve_cosmos_throughput_mode,
@@ -371,9 +371,7 @@ async def create_memory_store(
371371
self._cosmos_container = container or self._cosmos_container
372372
self._cosmos_counter_container = counter_container or self._cosmos_counter_container
373373
self._cosmos_lease_container = lease_container or self._cosmos_lease_container
374-
self._cosmos_throughput_mode = _resolve_cosmos_throughput_mode(
375-
throughput_mode or self._cosmos_throughput_mode
376-
)
374+
self._cosmos_throughput_mode = _resolve_cosmos_throughput_mode(throughput_mode or self._cosmos_throughput_mode)
377375
self._cosmos_autoscale_max_ru = _resolve_cosmos_autoscale_max_ru(
378376
autoscale_max_ru if autoscale_max_ru is not None else self._cosmos_autoscale_max_ru
379377
)

agent_memory_toolkit/cosmos_memory_client.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
VALID_ROLES,
1717
VALID_TYPES,
1818
_build_memory_query_builder,
19-
_cosmos_container_offer_throughput,
2019
_container_policies,
20+
_cosmos_container_offer_throughput,
2121
_make_memory,
2222
_resolve_cosmos_autoscale_max_ru,
2323
_resolve_cosmos_throughput_mode,
@@ -100,9 +100,7 @@ def __init__(
100100
self._cosmos_credential = cosmos_credential
101101
self._cosmos_database = cosmos_database or "ai_memory"
102102
self._cosmos_container = cosmos_container or "memories"
103-
self._cosmos_counter_container = (
104-
cosmos_counter_container or "counter"
105-
)
103+
self._cosmos_counter_container = cosmos_counter_container or "counter"
106104
self._cosmos_lease_container = cosmos_lease_container or "leases"
107105
self._cosmos_throughput_mode = _resolve_cosmos_throughput_mode(cosmos_throughput_mode)
108106
self._cosmos_autoscale_max_ru = _resolve_cosmos_autoscale_max_ru(cosmos_autoscale_max_ru)
@@ -383,9 +381,7 @@ def create_memory_store(
383381
self._cosmos_container = container or self._cosmos_container
384382
self._cosmos_counter_container = counter_container or self._cosmos_counter_container
385383
self._cosmos_lease_container = lease_container or self._cosmos_lease_container
386-
self._cosmos_throughput_mode = _resolve_cosmos_throughput_mode(
387-
throughput_mode or self._cosmos_throughput_mode
388-
)
384+
self._cosmos_throughput_mode = _resolve_cosmos_throughput_mode(throughput_mode or self._cosmos_throughput_mode)
389385
self._cosmos_autoscale_max_ru = _resolve_cosmos_autoscale_max_ru(
390386
autoscale_max_ru if autoscale_max_ru is not None else self._cosmos_autoscale_max_ru
391387
)

0 commit comments

Comments
 (0)