diff --git a/examples/adk_streaming_thinking_usage.py b/examples/adk_streaming_thinking_usage.py index 67322b06..4cbc4c21 100644 --- a/examples/adk_streaming_thinking_usage.py +++ b/examples/adk_streaming_thinking_usage.py @@ -63,10 +63,10 @@ def _build_weather_tool() -> Any: name="get_demo_weather", description="Return canned weather information for a city.", parameters=genai_types.Schema( - type="OBJECT", + type=genai_types.Type.OBJECT, properties={ "city": genai_types.Schema( - type="STRING", + type=genai_types.Type.STRING, description="City name to look up.", ) }, @@ -102,9 +102,9 @@ def _build_request( thinking_budget=thinking_budget, ) if enable_tool_call: - config_kwargs["system_instruction"] = ( - "When the user asks about weather, call the provided tool exactly once." - ) + config_kwargs[ + "system_instruction" + ] = "When the user asks about weather, call the provided tool exactly once." config_kwargs["tools"] = [_build_weather_tool()] if config_kwargs: kwargs["config"] = genai_types.GenerateContentConfig(**config_kwargs) diff --git a/examples/hello_world_portkey_strands.py b/examples/hello_world_portkey_strands.py index a3453000..edef0425 100644 --- a/examples/hello_world_portkey_strands.py +++ b/examples/hello_world_portkey_strands.py @@ -31,7 +31,7 @@ async def main() -> None: ] print(f"Streaming with model: {model_id}") - async for event in model.stream(messages=messages): + async for event in model.stream(messages=messages): # type: ignore[arg-type] # Events follow the Strands stream event shape produced by our adapter. if isinstance(event, dict) and "contentBlockDelta" in event: delta = event["contentBlockDelta"].get("delta", {}) diff --git a/portkey_ai/integrations/adk.py b/portkey_ai/integrations/adk.py index 4685fb3d..2d3946f4 100644 --- a/portkey_ai/integrations/adk.py +++ b/portkey_ai/integrations/adk.py @@ -659,7 +659,7 @@ async def generate_content_async( event, "output_index", len(streamed_function_calls_by_index) ) if getattr(item, "arguments", None) is None: - item.arguments = "" + item.arguments = "" # type: ignore[union-attr] streamed_function_calls_by_index[output_index] = item key = _function_call_key(item) if key: diff --git a/portkey_ai/version.py b/portkey_ai/version.py index 3c00bb49..3f755ed2 100644 --- a/portkey_ai/version.py +++ b/portkey_ai/version.py @@ -1 +1 @@ -VERSION = "2.2.0" +VERSION = "2.2.1" diff --git a/tests/integrations/test_adk_adapter.py b/tests/integrations/test_adk_adapter.py index f6217e78..ac45d832 100644 --- a/tests/integrations/test_adk_adapter.py +++ b/tests/integrations/test_adk_adapter.py @@ -486,7 +486,9 @@ async def test_streaming_merge_enriches_incomplete_final_response( async def fake_stream_gen() -> AsyncIterator[Any]: yield _FakeOutputItemAddedEvent(streamed_item, output_index=0) - yield _FakeFunctionArgsDeltaEvent('{"city":"SF"}', item_id="call_1", output_index=0) + yield _FakeFunctionArgsDeltaEvent( + '{"city":"SF"}', item_id="call_1", output_index=0 + ) yield _FakeCompletedEvent(final_response) async def fake_create(**kwargs: Any) -> AsyncIterator[Any]: @@ -529,7 +531,10 @@ def test_ensure_strict_json_schema_nested_objects() -> None: result = _ensure_strict_json_schema(schema) assert result["additionalProperties"] is False assert result["properties"]["location"]["additionalProperties"] is False - assert result["properties"]["location"]["properties"]["coords"]["additionalProperties"] is False + assert ( + result["properties"]["location"]["properties"]["coords"]["additionalProperties"] + is False + ) def test_ensure_strict_json_schema_array_of_objects() -> None: