Closed vesper8 closed 8 months ago
I might be wrong on this but you should set your OPENAI_ORGANIZATION ... and trust me on this one: Its not "Personal' you can find it in Settings > Organization
I am setting it, although if you only belong to a single org, then it doesn't really matter. But I do belong to two so it's best to set it in such a case. I agree the usage example should show how to set it.
$this->client = OpenAI::client(config('services.openai.key'), config('services.openai.organization'));
I also got this to work by connecting to a locally running server (that is running via LM Studio for me, but it could be just a python server too. Like this:
$baseUri = 'http://localhost:1234/v1';
$this->client = OpenAI::factory()
->withApiKey(config('services.openai.key'))
->withOrganization(config('services.openai.organization'))
->withBaseUri($baseUri)
->make();
I think adding this in the README.md would also be welcome.
Thanks @vesper8
Has been fixed now.
Minor thing but your code snippet at the top of the README
returns an error because gpt-3.5-turbo-instruct is not a chat model, instead you can substitute it by gpt-3.5-turbo