Skip to content

Commit 742748d

Browse files
committed
fix: All lintint and formatting errors
1 parent 1495160 commit 742748d

5 files changed

Lines changed: 17 additions & 12 deletions

File tree

examples/adk_streaming_thinking_usage.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ def _build_weather_tool() -> Any:
6363
name="get_demo_weather",
6464
description="Return canned weather information for a city.",
6565
parameters=genai_types.Schema(
66-
type="OBJECT",
66+
type=genai_types.Type.OBJECT,
6767
properties={
6868
"city": genai_types.Schema(
69-
type="STRING",
69+
type=genai_types.Type.STRING,
7070
description="City name to look up.",
7171
)
7272
},
@@ -102,9 +102,9 @@ def _build_request(
102102
thinking_budget=thinking_budget,
103103
)
104104
if enable_tool_call:
105-
config_kwargs["system_instruction"] = (
106-
"When the user asks about weather, call the provided tool exactly once."
107-
)
105+
config_kwargs[
106+
"system_instruction"
107+
] = "When the user asks about weather, call the provided tool exactly once."
108108
config_kwargs["tools"] = [_build_weather_tool()]
109109
if config_kwargs:
110110
kwargs["config"] = genai_types.GenerateContentConfig(**config_kwargs)

examples/hello_world_portkey_strands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async def main() -> None:
3131
]
3232

3333
print(f"Streaming with model: {model_id}")
34-
async for event in model.stream(messages=messages):
34+
async for event in model.stream(messages=messages): # type: ignore[arg-type]
3535
# Events follow the Strands stream event shape produced by our adapter.
3636
if isinstance(event, dict) and "contentBlockDelta" in event:
3737
delta = event["contentBlockDelta"].get("delta", {})

portkey_ai/integrations/adk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ async def generate_content_async(
659659
event, "output_index", len(streamed_function_calls_by_index)
660660
)
661661
if getattr(item, "arguments", None) is None:
662-
item.arguments = ""
662+
item.arguments = "" # type: ignore[union-attr]
663663
streamed_function_calls_by_index[output_index] = item
664664
key = _function_call_key(item)
665665
if key:

portkey_ai/integrations/strands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ def format_messages(
124124
):
125125
formatted.append({"role": role, "content": part["text"]})
126126
elif isinstance(part, dict) and "toolUse" in part:
127-
formatted.append(self._format_tool_use_part(part))
127+
formatted.append(self._format_tool_use_part(part)) # type: ignore[arg-type]
128128
elif (
129129
isinstance(part, dict)
130130
and "toolResult" in part
131131
and self._current_tool_use_id is not None
132132
):
133-
formatted.append(self._format_tool_result_part(part))
133+
formatted.append(self._format_tool_result_part(part)) # type: ignore[arg-type]
134134

135135
return formatted
136136

@@ -339,7 +339,7 @@ async def stream(
339339
state["tool_use_id"] = None
340340
state["tool_name"] = None
341341

342-
async def structured_output(
342+
async def structured_output( # type: ignore[override]
343343
self,
344344
output_model: "Type[T]",
345345
prompt: List[dict[str, Any]],

tests/integrations/test_adk_adapter.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,9 @@ async def test_streaming_merge_enriches_incomplete_final_response(
486486

487487
async def fake_stream_gen() -> AsyncIterator[Any]:
488488
yield _FakeOutputItemAddedEvent(streamed_item, output_index=0)
489-
yield _FakeFunctionArgsDeltaEvent('{"city":"SF"}', item_id="call_1", output_index=0)
489+
yield _FakeFunctionArgsDeltaEvent(
490+
'{"city":"SF"}', item_id="call_1", output_index=0
491+
)
490492
yield _FakeCompletedEvent(final_response)
491493

492494
async def fake_create(**kwargs: Any) -> AsyncIterator[Any]:
@@ -529,7 +531,10 @@ def test_ensure_strict_json_schema_nested_objects() -> None:
529531
result = _ensure_strict_json_schema(schema)
530532
assert result["additionalProperties"] is False
531533
assert result["properties"]["location"]["additionalProperties"] is False
532-
assert result["properties"]["location"]["properties"]["coords"]["additionalProperties"] is False
534+
assert (
535+
result["properties"]["location"]["properties"]["coords"]["additionalProperties"]
536+
is False
537+
)
533538

534539

535540
def test_ensure_strict_json_schema_array_of_objects() -> None:

0 commit comments

Comments
 (0)