Skip to content

motleyhand/promptjuggler-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PromptJuggler PHP SDK

The official PHP client for the PromptJuggler API. Run prompts and workflows, manage knowledge bases, and verify webhooks — fully typed, with flat, synchronous methods.

Requirements

  • PHP 8.2+

Installation

composer require promptjuggler/sdk

Usage

use PromptJuggler\Client\PromptJuggler;
use PromptJuggler\Client\Models\RunStatus;

$pj = new PromptJuggler('your-api-key');

// Trigger a run (async — returns the run ID)
$created = $pj->runPrompt('greeting', 'production', inputs: ['name' => 'Ada']);

// Poll for the result
$run = $pj->getPromptRun($created->getId());
if ($run->getStatus()?->is(RunStatus::COMPLETED)) {
    echo $run->getOutput();
}

Errors surface as PromptJuggler\Client\Exception\ApiException (with a statusCode). Verify incoming webhooks with PromptJuggler\Client\Webhook\WebhookSignature::isValid().

Documentation

Full guides and the API reference: https://docs.promptjuggler.com/sdks/php/overview

License

MIT

About

PromptJuggler PHP SDK

Resources

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages