openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.82k stars 499 forks source link

[Bug]: Unsupported operand types: string * int #443

Open Muhammad-Huzaifa7 opened 3 months ago

Muhammad-Huzaifa7 commented 3 months ago

Description

I am encountering an error "Unsupported operand types: string * int" when trying to use the OpenAI PHP Client to upload files and create assistants. The error occurs in the following scenarios:

When calling the uploadFileToOpenAI method and other methods like creating assistants etc

Steps To Reproduce

Steps To Reproduce Set up the environment:

Ensure you have the OpenAI PHP Client package installed. Set the OPENAI_API_KEY in the .env file. Create a Laravel service class: Call the methods:

OpenAI PHP Client Version

v0.10.1

PHP Version

8.2.12

Notes

The issue seems to stem from the file handling or request payload preparation within the OpenAI PHP Client. I have verified that the API key is correctly set and that the file path is valid. Any additional insights or troubleshooting steps would be greatly appreciated.

kayke-fairy commented 1 week ago

Hi! Have you found a solution?