Skip to content

test: add table_test and sample for lat/long field support. #786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
70 changes: 3 additions & 67 deletions google/genai/caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,33 +283,6 @@ def _FunctionCallingConfig_to_mldev(
return to_object


def _LatLng_to_mldev(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
parent_object: Optional[dict[str, Any]] = None,
) -> dict[str, Any]:
to_object: dict[str, Any] = {}
if getv(from_object, ['latitude']) is not None:
raise ValueError('latitude parameter is not supported in Gemini API.')

if getv(from_object, ['longitude']) is not None:
raise ValueError('longitude parameter is not supported in Gemini API.')

return to_object


def _RetrievalConfig_to_mldev(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
parent_object: Optional[dict[str, Any]] = None,
) -> dict[str, Any]:
to_object: dict[str, Any] = {}
if getv(from_object, ['lat_lng']) is not None:
raise ValueError('lat_lng parameter is not supported in Gemini API.')

return to_object


def _ToolConfig_to_mldev(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
Expand All @@ -328,8 +301,8 @@ def _ToolConfig_to_mldev(
)

if getv(from_object, ['retrieval_config']) is not None:
raise ValueError(
'retrieval_config parameter is not supported in Gemini API.'
setv(
to_object, ['retrievalConfig'], getv(from_object, ['retrieval_config'])
)

return to_object
Expand Down Expand Up @@ -815,39 +788,6 @@ def _FunctionCallingConfig_to_vertex(
return to_object


def _LatLng_to_vertex(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
parent_object: Optional[dict[str, Any]] = None,
) -> dict[str, Any]:
to_object: dict[str, Any] = {}
if getv(from_object, ['latitude']) is not None:
setv(to_object, ['latitude'], getv(from_object, ['latitude']))

if getv(from_object, ['longitude']) is not None:
setv(to_object, ['longitude'], getv(from_object, ['longitude']))

return to_object


def _RetrievalConfig_to_vertex(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
parent_object: Optional[dict[str, Any]] = None,
) -> dict[str, Any]:
to_object: dict[str, Any] = {}
if getv(from_object, ['lat_lng']) is not None:
setv(
to_object,
['latLng'],
_LatLng_to_vertex(
api_client, getv(from_object, ['lat_lng']), to_object
),
)

return to_object


def _ToolConfig_to_vertex(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
Expand All @@ -867,11 +807,7 @@ def _ToolConfig_to_vertex(

if getv(from_object, ['retrieval_config']) is not None:
setv(
to_object,
['retrievalConfig'],
_RetrievalConfig_to_vertex(
api_client, getv(from_object, ['retrieval_config']), to_object
),
to_object, ['retrievalConfig'], getv(from_object, ['retrieval_config'])
)

return to_object
Expand Down
70 changes: 3 additions & 67 deletions google/genai/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,33 +316,6 @@ def _FunctionCallingConfig_to_mldev(
return to_object


def _LatLng_to_mldev(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
parent_object: Optional[dict[str, Any]] = None,
) -> dict[str, Any]:
to_object: dict[str, Any] = {}
if getv(from_object, ['latitude']) is not None:
raise ValueError('latitude parameter is not supported in Gemini API.')

if getv(from_object, ['longitude']) is not None:
raise ValueError('longitude parameter is not supported in Gemini API.')

return to_object


def _RetrievalConfig_to_mldev(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
parent_object: Optional[dict[str, Any]] = None,
) -> dict[str, Any]:
to_object: dict[str, Any] = {}
if getv(from_object, ['lat_lng']) is not None:
raise ValueError('lat_lng parameter is not supported in Gemini API.')

return to_object


def _ToolConfig_to_mldev(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
Expand All @@ -361,8 +334,8 @@ def _ToolConfig_to_mldev(
)

if getv(from_object, ['retrieval_config']) is not None:
raise ValueError(
'retrieval_config parameter is not supported in Gemini API.'
setv(
to_object, ['retrievalConfig'], getv(from_object, ['retrieval_config'])
)

return to_object
Expand Down Expand Up @@ -1458,39 +1431,6 @@ def _FunctionCallingConfig_to_vertex(
return to_object


def _LatLng_to_vertex(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
parent_object: Optional[dict[str, Any]] = None,
) -> dict[str, Any]:
to_object: dict[str, Any] = {}
if getv(from_object, ['latitude']) is not None:
setv(to_object, ['latitude'], getv(from_object, ['latitude']))

if getv(from_object, ['longitude']) is not None:
setv(to_object, ['longitude'], getv(from_object, ['longitude']))

return to_object


def _RetrievalConfig_to_vertex(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
parent_object: Optional[dict[str, Any]] = None,
) -> dict[str, Any]:
to_object: dict[str, Any] = {}
if getv(from_object, ['lat_lng']) is not None:
setv(
to_object,
['latLng'],
_LatLng_to_vertex(
api_client, getv(from_object, ['lat_lng']), to_object
),
)

return to_object


def _ToolConfig_to_vertex(
api_client: BaseApiClient,
from_object: Union[dict[str, Any], object],
Expand All @@ -1510,11 +1450,7 @@ def _ToolConfig_to_vertex(

if getv(from_object, ['retrieval_config']) is not None:
setv(
to_object,
['retrievalConfig'],
_RetrievalConfig_to_vertex(
api_client, getv(from_object, ['retrieval_config']), to_object
),
to_object, ['retrievalConfig'], getv(from_object, ['retrieval_config'])
)

return to_object
Expand Down
Loading