Skip to content

Commit 86b9fdc

Browse files
authored
Merge pull request #425 from kiran-4444/fix/linting
Bump version to 2.2.1
2 parents 942bb31 + aea17cf commit 86b9fdc

3 files changed

Lines changed: 13 additions & 8 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)

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:

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)