Skip to content

[BUG]: TypeError: Cannot use in operator to search for choices #96

@FidelusAleksander

Description

@FidelusAleksander

Hey @sgoedecke

I'm running into this on a very simple basic workflow

Error:

API error: TypeError: Cannot use 'in' operator to search for 'choices' in {"choices":[{"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"protected_material_code":{"filtered":false,"detected":false},"protected_material_text":{"filtered":false,"detected":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}},"finish_reason":"length","index":0,"logprobs":null,"message":{"annotations":[],"content":"The meaning of life is one of the most profound philosophical, spiritual, and existential questions, and its interpretation varies greatly depending on individual beliefs, cultural perspectives, and personal experiences. Here are some common perspectives on the meaning of life:\n\n### **Philosophical Perspectives**  \n1. **Existentialism**: Life has no inherent meaning; individuals create their own purpose through choices, actions, and relationships.\n2. **Absurdism**: Life's search for meaning is inherently futile because the universe lacks objective purpose, but embracing the absurd can lead to freedom and joy.\n3. **Humanism**: The meaning of life is derived from human potential, creativity, compassion, and contributing positively to society.\n\n### **Spiritual \u0026 Religious Perspectives**  \n1. **Christianity**: The purpose of life is to know, love, and serve God, and to prepare for eternal life.\n2. **Buddhism**: Life's meaning is to overcome suffering through spiritual enlightenment,","refusal":null,"role":"assistant"}}],"created":1755867020,"id":"chatcmpl-C7LVkeRbtg8lDnDT90H3WzuEX0OLV","model":"gpt-4o-2024-11-20","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"filtered":false,"detected":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"system_fingerprint":"fp_ee1d74bde0","usage":{"completion_tokens":200,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":23,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0},"total_tokens":223}}

workflow file

name: Ask AI
on:
  workflow_dispatch:

permissions:
  models: read


jobs:
  ask-ai:
    runs-on: ubuntu-latest

    steps:
      - name: AI Inference
        id: ai-response
        uses: actions/ai-inference@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          prompt: |
            What is the meaning of life?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions