simonw/llm-gemini

No response and exit code is zero for PROHIBITED_CONTENT

Open

#80 opened on May 18, 2025

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Python (52 forks)github user discovery
help wanted

Repository metrics

Stars
 (445 stars)
PR merge metrics
 (PR metrics pending)

Description

The command like llm -m gemini-2.0-flash "prompt" -f "file.txt" returned no response nor any indication of a failure. llm version is 0.25

In responses table response field is empty. response_json is below:

{
    "promptFeedback": {
        "blockReason": "PROHIBITED_CONTENT"
    },
    "usageMetadata": {
        "promptTokenCount": 9311,
        "totalTokenCount": 9311,
        "promptTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 9311
            }
        ]
    },
    "modelVersion": "gemini-2.0-flash"
}

Additionally, these fields are null:

  • input_tokens
  • output_tokens
  • token_details

The quickest fix could be just output the json to stdout, so a user have a clue of what's going on.

Contributor guide