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
7 changes: 6 additions & 1 deletion tests/contrib/google_adk_agents/test_adk_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

import pytest
from google.adk import Agent
from google.adk.agents.run_config import RunConfig, StreamingMode

# ADK 2.7 marks StreamingMode as a private re-export.
from google.adk.agents.run_config import (
RunConfig,
StreamingMode, # pyright: ignore[reportPrivateImportUsage]
)
from google.adk.models import BaseLlm, LLMRegistry
from google.adk.models.llm_request import LlmRequest
from google.adk.models.llm_response import LlmResponse
Expand Down
8 changes: 4 additions & 4 deletions tests/contrib/google_genai/test_gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ async def gemini_file_search_stores_upload(
self, req: _GeminiUploadToFileSearchStoreRequest
) -> types.UploadToFileSearchStoreOperation:
self.file_search_store_upload_requests.append(req)
return types.UploadToFileSearchStoreOperation.model_construct(
name="operations/test-op",
return types.UploadToFileSearchStoreOperation.model_validate(
{"name": "operations/test-op"}
)

@activity.defn
Expand Down Expand Up @@ -1387,8 +1387,8 @@ async def _gen():
)
gemini.aio.files.download = AsyncMock(return_value=b"mock download content") # type: ignore[method-assign]
gemini.aio.file_search_stores.upload_to_file_search_store = AsyncMock( # type: ignore[method-assign]
return_value=types.UploadToFileSearchStoreOperation.model_construct(
name="operations/mock-op"
return_value=types.UploadToFileSearchStoreOperation.model_validate(
{"name": "operations/mock-op"}
)
)

Expand Down
11 changes: 4 additions & 7 deletions tests/nexus/test_temporal_system_nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,13 +566,10 @@ def _proto_scalar_sample(field: FieldDescriptor, *, path: str) -> Any:


def _field_is_repeated(field: FieldDescriptor) -> bool:
return bool(
getattr(
field,
"is_repeated",
getattr(field, "label") == FieldDescriptor.LABEL_REPEATED,
)
)
is_repeated = getattr(field, "is_repeated", None)
if is_repeated is not None:
return bool(is_repeated)
return getattr(field, "label") == FieldDescriptor.LABEL_REPEATED


@pytest.mark.parametrize(
Expand Down
Loading