Skip to content
papi-aiPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PapiAI OpenAI Provider

CI Latest Version Total Downloads PHP Version License

OpenAI provider for PapiAI - A simple but powerful PHP library for building AI agents.

Installation

composer require papi-ai/openai

Usage

use PapiAI\Core\Agent;
use PapiAI\OpenAI\OpenAIProvider;

$provider = new OpenAIProvider(
    apiKey: $_ENV['OPENAI_API_KEY'],
    defaultModel: OpenAIProvider::MODEL_GPT_6_ASTRA,
);

$agent = new Agent(
    provider: $provider,
    model: OpenAIProvider::MODEL_GPT_6_ASTRA,
    instructions: 'You are a helpful assistant.',
);

$response = $agent->run('Hello!');
echo $response->text;

Available Models

OpenAIProvider::MODEL_GPT_6_ASTRA   // 'gpt-6-astra' (default, most capable)
OpenAIProvider::MODEL_GPT_5_6_SOL   // 'gpt-5.6-sol' (complex work)
OpenAIProvider::MODEL_GPT_5_6_TERRA // 'gpt-5.6-terra' (balanced)
OpenAIProvider::MODEL_GPT_5_6_LUNA  // 'gpt-5.6-luna' (cost-sensitive)
OpenAIProvider::MODEL_GPT_4O        // 'gpt-4o' (legacy, still served)
OpenAIProvider::MODEL_GPT_4O_MINI   // 'gpt-4o-mini' (legacy, still served)

Features

  • Tool/function calling
  • Vision/multimodal support
  • Structured output (JSON mode)
  • Streaming support

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages