Package Details: python-google-genai 1.66.0-1

Git Clone URL: https://aur.archlinux.org/python-google-genai.git (read-only, click to copy)
Package Base: python-google-genai
Description: GenAI Python SDK.
Upstream URL: https://github.com/googleapis/python-genai
Licenses: Apache-2.0
Submitter: medaminezghal
Maintainer: medaminezghal
Last Packager: medaminezghal
Votes: 2
Popularity: 0.004843
First Submitted: 2025-02-02 07:22 (UTC)
Last Updated: 2026-03-06 07:44 (UTC)

Latest Comments

1 2 3 Next › Last »

cyrozap commented on 2026-03-01 21:34 (UTC)

This fixed the failing test_websocket_base_url_no_auth_with_custom_base_url test for me:

diff --git a/PKGBUILD b/PKGBUILD
index afa3ee0..4bc9fd8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -45,6 +45,7 @@ check() {
     --deselect google/genai/tests/afc/test_generate_content_stream_afc_thoughts.py
     --deselect google/genai/tests/operations/test_get.py
     --deselect google/genai/tests/interactions/test_paths.py
+    --deselect google/genai/tests/live/test_live.py
     # Need to be fixed by developers
     --deselect google/genai/tests/types/test_types.py::test_generic_alias_complex_array_with_default_value
     --deselect google/genai/tests/types/test_types.py::test_generic_alias_complex_array_with_default_value_all_py_versions

sashank commented on 2026-01-13 08:07 (UTC)

The coder comment on the from_callable method in FunctionDeclaration class reads:

    """Converts a Callable to a FunctionDeclaration based on the client.

    Note: For best results prefer
    [Google-style
    docstring](https://google.github.io/styleguide/pyguide.html#383-functions-and-methods)
    when describing arguments. This function does **not** parse argument
    descriptions into the property description slots of the resulting structure.
    Instead it sends the whole docstring in the top-level function description.
    Google-style docstring are closest to what the model is trained on.
    """

sashank commented on 2026-01-13 08:05 (UTC)

Hey @medaminezghal, so several tests fail when trying to install 1.55 or modifying your script to 1.57. At least a couple of these are tests that require one to set up a google AI API. See:

ERROR google/genai/tests/interactions/test_paths.py::test_interactions_paths[True-tests/interactions/paths-None] - google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information. ERROR google/genai/tests/interactions/test_paths.py::test_interactions_paths[False-tests/interactions/paths-None] - ValueError: Missing key inputs argument! To use the Google AI API, provide (api_key) arguments. To use the Google Cloud API, provide (vertexai, project & location) arguments. ERROR google/genai/tests/interactions/test_paths.py::test_async_interactions_paths[True-tests/interactions/paths-None] - google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information. ERROR google/genai/tests/interactions/test_paths.py::test_async_interactions_paths[False-tests/interactions/paths-None] - ValueError: Missing key inputs argument! To use the Google AI API, provide (api_key) arguments. To use the Google Cloud API, provide (vertexai, project & location) arguments.

And the rest are some sort of typing errors (and these are the only ones that show up in 1.55):

But even the typing errors seem like they might depend on APIs or at least API specific functions (without looking more deeply at the code than I have), since the output of FunctionDeclaration from_collable method being called on the test input depends on these APIs to structure them.

google/genai/tests/types/test_types.py::test_type_union_with_default_value_all_py_versions

actual_schema_vertex = types.FunctionDeclaration.from_callable(
          client=vertex_client, callable=func_under_test
      )

assert actual_schema_vertex == expected_schema
E     AssertionError: assert FunctionDeclaration(\n  description='test generic alias complex array with default value.',\n  name='func_under_test',\n  parameters=Schema(\n    properties={\n      'a': Schema(\n        default=[\n          1,\n          'a',\n          1.1,\n          True,\n        ],\n        items=Schema(\n          any_of=[\n            Schema(\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n          ]\n        ),\n        type=<Type.ARRAY: 'ARRAY'>\n      ),\n      'b': Schema(\n        default=[\n          11,\n          'aa',\n          1.11,\n          False,\n        ],\n        items=Schema(\n          any_of=[\n            Schema(\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n          ]\n        ),\n        type=<Type.ARRAY: 'ARRAY'>\n      ),\n      'c': Schema(\n        default=[\n          [\n            1,\n          ],\n          2,\n        ],\n        items=Schema(\n          any_of=[\n            Schema(\n              items=<... Max depth ...>,\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n          ]\n        ),\n        type=<Type.ARRAY: 'ARRAY'>\n      )\n    },\n    required=[],\n    type=<Type.OBJECT: 'OBJECT'>\n  )\n) == FunctionDeclaration(\n  description='test generic alias complex array with default value.',\n  name='func_under_test',\n  parameters=Schema(\n    properties={\n      'a': Schema(\n        default=[\n          1,\n          'a',\n          1.1,\n          True,\n        ],\n        items=Schema(\n          any_of=[\n            Schema(\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n            Schema(\n              type=<... Max depth ...>\n            ),\n          ],\n          type=<Type.OBJECT: 'OBJECT'>\n        ),\n        type=<Type.ARRAY: 'ARRAY'>\n      ),\n      'b': Schema(\n        default=[\n          11,\n          'aa',\n          1.11,\n          False,\n        ],\n        items=Schema(\n          any_of=[\n            Schema(\n              type=<... Max depth ...>\n            ),\n 

Auerhuhn commented on 2025-12-05 12:41 (UTC)

Hi @medaminezghal, would you mind adding python-pytest-xdist to checkdepends as @gwuensch has suggested?

This breaks downstream packages such as aider-chat, so it would be super helpful if you fixed this error.

gwuensch commented on 2025-11-24 18:30 (UTC)

This is still missing.

gwuensch commented on 2025-11-07 16:33 (UTC)

Missing check dependency python-pytest-xdist for the -n auto option:

==> Starting check()...
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: -n --dist=loadscope google/genai/tests

quest commented on 2025-10-28 02:31 (UTC)

This no longer builds for me.

FAILED google/genai/tests/live/test_live.py::test_websocket_base_url_no_auth_with_custom_base_url - AssertionError: assert 'wss://test-api-gateway-proxy.com' == 'https://test-api-gateway-proxy.com'

  - https://test-api-gateway-proxy.com
  ? ^^^^
  + wss://test-api-gateway-proxy.com
  ? ^^
================================= 1 failed, 867 passed, 1 skipped, 158 deselected, 62 warnings in 51.23s ==================================
==> ERROR: A failure occurred in check().
    Aborting...
 -> error making: python-google-genai-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
python-google-genai - exit status 4

acters commented on 2025-09-19 08:48 (UTC)

@Jawzper if you are on CachyOS then I asked the repo maintainers to rebuild sentencepiece with the new protobuf 32.0 version. Which fixed this issue.

Make sure you install python-pytokens as it is also now required!

BTW, if you are NOT on CachyOS like me, then you need to get in contact with whoever is your repo maintainer and ask them to rebuild it. (or if you want to you can build it with the new protobuf 32.0 yourself)

Jawzper commented on 2025-09-15 08:44 (UTC)

I'm getting this error, can anyone help? I already have protobuf and python-protobuf packages installed.


====================================================== ERRORS ======================================================
___________________ ERROR collecting google/genai/tests/local_tokenizer/test_local_tokenizer.py ____________________
ImportError while importing test module '/home/jazz/.cache/yay/python-google-genai/src/python-genai-1.36.0/google/genai/tests/local_tokenizer/test_local_tokenizer.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.13/site-packages/_pytest/python.py:498: in importtestmodule
    mod = import_path(
/usr/lib/python3.13/site-packages/_pytest/pathlib.py:587: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
/usr/lib/python3.13/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
google/genai/tests/local_tokenizer/test_local_tokenizer.py:19: in <module>
    from sentencepiece import sentencepiece_model_pb2
/usr/lib/python3.13/site-packages/sentencepiece/__init__.py:10: in <module>
    from . import _sentencepiece
E   ImportError: libprotobuf-lite.so.31.1.0: cannot open shared object file: No such file or directory
________________ ERROR collecting google/genai/tests/local_tokenizer/test_local_tokenizer_loader.py ________________
ImportError while importing test module '/home/jazz/.cache/yay/python-google-genai/src/python-genai-1.36.0/google/genai/tests/local_tokenizer/test_local_tokenizer_loader.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.13/site-packages/_pytest/python.py:498: in importtestmodule
    mod = import_path(
/usr/lib/python3.13/site-packages/_pytest/pathlib.py:587: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
/usr/lib/python3.13/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
google/genai/tests/local_tokenizer/test_local_tokenizer_loader.py:19: in <module>
    import sentencepiece as spm
/usr/lib/python3.13/site-packages/sentencepiece/__init__.py:10: in <module>
    from . import _sentencepiece
E   ImportError: libprotobuf-lite.so.31.1.0: cannot open shared object file: No such file or directory
================================================= warnings summary =================================================
../../../../../../../usr/lib/python3.13/site-packages/_hypothesis_pytestplugin.py:450
  /usr/lib/python3.13/site-packages/_hypothesis_pytestplugin.py:450: PytestRemovedIn9Warning: Marks applied to fixtures have no effect
  See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
    return _orig_call(self, function)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================= short test summary info ==============================================
ERROR google/genai/tests/local_tokenizer/test_local_tokenizer.py
ERROR google/genai/tests/local_tokenizer/test_local_tokenizer_loader.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================== 172 deselected, 1 warning, 2 errors in 0.94s ===================================
==> ERROR: A failure occurred in check().
    Aborting...
 -> error making: python-google-genai-exit status 4

envolution commented on 2025-09-10 14:16 (UTC)

I believe pgpkeys are only relevant when using a signed source. In this case, makepkg has nothing to verify without an associated .sig