Skip to content

[BUG] Gemini Ai integration doesn't work #746

Description

@Delivator

Describe the bug

Using the Instant Playlist feature results in an instant error. In the web ui it says:

Built the playlist0.1s
The AI couldn't build a plan for this request - try rephrasing it.

To Reproduce

  1. Set up the Ai provider using the setup wizard (AI_MODEL_PROVIDER = GEMINI, GEMINI_API_KEY double checked and updated several times, GEMINI_MODEL_NAME=gemini-3.5-flash (I have also tried gemini-2.5-flash and gemini-2.5-pro)

Expected behavior

It works.

Environment (please complete the following information):

  • OS: Linux/TrueNAS 25.04.2.6
  • Deployment: Docker/TrueNAS Custom YAML Config
  • AudioMuse-AI Version: latest (v2.6.0)
  • Navidrome/Jellyfin Version: Jellyfin v10.11.11
  • Browser: Firefox

Additional context

Log from the audiomuse-ai-flask container:

[INFO]-[10-07-2026 10-01-02]-chat_playlist_api -> provider=GEMINI url=(gemini-api) model=gemini-3.5-flash (default_provider=GEMINI, client_override=True)
[ERROR]-[10-07-2026 10-01-02]-Error calling Gemini with tools
Traceback (most recent call last):
  File "/app/tasks/ai/providers/gemini.py", line 103, in call_with_tools
    tools_list = [genai.types.Tool(function_declarations=function_declarations)]
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pydantic/main.py", line 263, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 5 validation errors for Tool
function_declarations.3.parameters.properties.genres.uniqueItems
  Extra inputs are not permitted [type=extra_forbidden, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.13/v/extra_forbidden
function_declarations.3.parameters.properties.voices.uniqueItems
  Extra inputs are not permitted [type=extra_forbidden, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.13/v/extra_forbidden
function_declarations.3.parameters.properties.moods.uniqueItems
  Extra inputs are not permitted [type=extra_forbidden, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.13/v/extra_forbidden
function_declarations.3.parameters.properties.exclude_artists.uniqueItems
  Extra inputs are not permitted [type=extra_forbidden, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.13/v/extra_forbidden
function_declarations.3.parameters.properties.exclude_genres.uniqueItems
  Extra inputs are not permitted [type=extra_forbidden, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.13/v/extra_forbidden
172.16.9.1 - - [10/Jul/2026:10:01:02 +0000] "POST /chat/api/chatPlaylistStream HTTP/1.1" 200 1781 "https://audiomuse-ai.harz.lol/chat/" "Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions