Skip to content

[Bug]: Undefined array key "index" #526

Closed
@j-schumann

Description

@j-schumann

Description

Warning: Undefined array key "index" caused in Responses/Completions/CreateResponseChoice.php#L23

Steps To Reproduce

By receiving the following attributes:
Image

from Openrouter.ai with different models, using

        $client = \OpenAI::factory()
            ->withApiKey($yourApiKey)
            ->withBaseUri('https://openrouter.ai/api/v1')
            ->make();

        $result = $client->completions()->create([
            //'model' => 'gpt-3.5-turbo-instruct',
            "model" => "google/gemini-2.0-pro-exp-02-05:free",
            'prompt' => 'Say this is a test',
            'max_tokens' => 6,
            'temperature' => 0
        ]);

OpenAI PHP Client Version

v0.10.3

PHP Version

8.4.3

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions