Skip to content

[Bug]: MistralAI- Undefined array key "type" #397

@doc-

Description

@doc-

Description

Hi,

I'm using this API implementation with both OpenAI models and MistralAI ones.

My implementation works perfectly with both, except for the tool_calls function which is the only thing that goes wrong with MistralAI models.

When calling a function with a compliant model (example: open-mixtral-8x22b), I get this error message:

Message: Undefined array key "type"

Filename: Chat/CreateResponseToolCall.php

Line Number: 23

It only happens when the model intends to use the tool.
It's able to recognise its tools though, but as soon as it tries to use them, there is this error occuring.

Steps To Reproduce

Create a MistralAI account and get an API key.

Use this base URI: api.mistral.ai/v1

Make a chat resource with a tool and use it with a MistralAI compliant model (example: open-mixtral-8x22b).

OpenAI PHP Client Version

v0.8.5

PHP Version

8.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