Compare commits

...

3 Commits

Author SHA1 Message Date
hackerESQ 3f9a1bafa0 Merge pull request #37 from investbrainapp/feat-use-openai-compatible-endpoints
Feat use openai compatible endpoints
2024-12-06 16:10:54 -06:00
hackerESQ 6f72a03ecf fix: specifically use factory import 2024-12-06 16:10:27 -06:00
hackerESQ 5b8e4c634e fix: remove validation which could prevent selfhosting w ollama 2024-12-06 16:09:03 -06:00
@@ -5,7 +5,7 @@ use App\Models\AiChat;
use App\Models\Holding;
use Illuminate\Database\Eloquent\Model;
use Livewire\Volt\Component;
use OpenAI;
use OpenAI\Factory;
use OpenAI\Responses\StreamResponse;
new class extends Component {
@@ -202,10 +202,6 @@ new class extends Component {
$organization = config('openai.organization');
$baseUri = config('openai.base_uri');
if (! is_string($apiKey) || ($organization !== null && ! is_string($organization))) {
throw new \InvalidArgumentException('The OpenAI API Key is missing. Please publish the [openai.php] configuration file and set the [api_key].');
}
return OpenAI::factory()
->withApiKey($apiKey)
->withOrganization($organization)