openai-php / client

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

[Bug]: Call to undefined method OpenAI\\Resources\\ThreadsRuns::createStreamed() #424

Closed Muhammad-Huzaifa7 closed 3 weeks ago

Muhammad-Huzaifa7 commented 3 weeks ago

Description

when i use "OpenAI::threads()->runs()->createStreamed(" it gives me an error "Call to undefined method OpenAI\Resources\ThreadsRuns::createStreamed()", i have run "composer update openai-php/laravel" but the error still persists

Steps To Reproduce

  1. Install the OpenAI PHP Laravel package: composer require openai-php/laravel

  2. Update the package to the latest version: composer update openai-php/laravel

  3. Add API key to .env file: OPENAI_API_KEY=your-api-key

  4. Create a controller and use the following code: use OpenAI\Laravel\Facades\OpenAI;

$stream = OpenAI::threads()->runs()->createStreamed([ 'assistant_id' => 'your-assistant-id', 'prompt' => 'Hello, how can I assist you today?', ]);

  1. Run the code and observe the error: Call to undefined method OpenAI\Resources\ThreadsRuns::createStreamed()

OpenAI PHP Client Version

v0.8.5

PHP Version

8.2.12

Notes

No response

gehrisandro commented 3 weeks ago

Hi @Muhammad-Huzaifa7

Make sure you are using the latest version 0.10.x