developh/open-ai

Laravel wrapper for OpenAI api, Code Completion, Text Completion and Image generation

v0.0.1 2023-02-05 04:53 UTC

This package is auto-updated.

Last update: 2025-03-05 23:36:14 UTC


README

Environment variables

OPENAI_API_URL=https://api.openai.com/v1

Your secret API keys OpenAI API Keys

OPENAI_API_KEY=SECRET_KEY

Your Organization ID

OPENAI_ORGANIZATION=ORGANIZATION-ID

Text basic completion

OpenAI::textCompletion('Write this is a test');

Text advance completion

OpenAI::model('text-davinci-003')
->temperature(0.25)
->topP(0)
->textCompletion('Write this is a test');