Documentation

Perplexity extends ContainerAwareObject
in package
implements AIModelInterface

Perplexity AI Model

Table of Contents

Interfaces

AIModelInterface

Constants

PERPLEXITY_MODEL  = 'pplx-70b-online'
PERPLEXITY_MODEL_PATH  = 'app/perplexity/model'
PERPLEXITY_TOKEN_PATH  = 'app/perplexity/token'

Properties

$translators  : array<string|int, mixed>
$container  : ContainerInterface

Methods

__call()  : mixed
{@inheritdoc}
__construct()  : mixed
constructor
ask()  : string
Invia una richiesta all'API Perplexity e ottiene una risposta
containerCall()  : mixed
call method through container
containerMake()  : mixed
create object through container
getAdminRouter()  : Admin
gets admin service
getAI()  : Manager
gets ai manager service
getApp()  : App
gets app object
getApplicationLogger()  : Manager
gets application_logger service
getAppRouteInfo()  : RouteInfo|null
gets route info
getAppWebsite()  : Website|null
gets current website
getAssets()  : Manager
gets assets manager
getAuth()  : Manager
gets auth manager service
getAvailableModels()  : array<string|int, mixed>
getCache()  : Manager
get cache manager
getCode()  : string
getContainer()  : ContainerInterface|Container
gets container object
getCrudRouter()  : Crud
gets crud service
getDb()  : Database|null
gets db object
getDebugbar()  : StandardDebugBar
gets debugbar object
getDefaultModel()  : string
getEnvironment()  : Manager
gets environment manager service
getEventManager()  : SharedEventEmitter
gets events manager service
getGoogleAuthenticator()  : PHPGangsta_GoogleAuthenticator
gets google authenticator service
getGuzzle()  : Client
gets guzzle service
getGZip()  : GZip
gets gzip service
getHtmlRenderer()  : HtmlPartsRenderer
gets html renderer service
getIcons()  : Icons
gets icons service
getImagine()  : Imagine
gets imagine service
getLog()  : Logger
gets log object
getMailer()  : Mailer
gets mailer service
getModel()  : string
getName()  : string
getPdo()  : PDO|null
gets PDO object
getRedis()  : Manager
gets redis service
getRouters()  : array<string|int, mixed>
gets routers
getSchema()  : Schema|null
gets schema object
getSearch()  : Manager
gets search service
getSesMailer()  : SesClient
gets SES mailer service
getSiteData()  : SiteData
gets site data service
getSmtpMailer()  : Swift_Mailer
gets SMTP mailer service
getTemplates()  : Engine
gets plates engine object
getTranslator()  : Translator
gets translator
getUtils()  : Globals
gets global utils service
getVersion()  : string
getWebhooksRouter()  : Webhooks
gets webhooks service
getWebRouter()  : Web
gets routing service
getZip()  : Zip
gets zip service
isEnabled()  : bool
requestUrl()  : string|bool
executes an http request
getService()  : mixed
gets registered service

Constants

PERPLEXITY_MODEL

public mixed PERPLEXITY_MODEL = 'pplx-70b-online'

PERPLEXITY_MODEL_PATH

public mixed PERPLEXITY_MODEL_PATH = 'app/perplexity/model'

PERPLEXITY_TOKEN_PATH

public mixed PERPLEXITY_TOKEN_PATH = 'app/perplexity/token'

Properties

$translators

public static array<string|int, mixed> $translators = []

translators

Methods

__construct()

constructor

public __construct(ContainerInterface $container) : mixed
Parameters
$container : ContainerInterface

ask()

Invia una richiesta all'API Perplexity e ottiene una risposta

public ask(string $prompt[, string|null $model = null ][, array<string|int, mixed>|null $previousMessages = null ]) : string
Parameters
$prompt : string
$model : string|null = null
$previousMessages : array<string|int, mixed>|null = null
Return values
string

containerCall()

call method through container

public containerCall(callable $callable[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$callable : callable
$arguments : array<string|int, mixed> = []

containerMake()

create object through container

public containerMake(string $className[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$className : string
$arguments : array<string|int, mixed> = []

getAvailableModels()

public getAvailableModels([bool $reset = false ]) : array<string|int, mixed>
Parameters
$reset : bool = false
Return values
array<string|int, mixed>

getCode()

public static getCode() : string
Return values
string

getContainer()

gets container object

public getContainer() : ContainerInterface|Container
Return values
ContainerInterface|Container

getDb()

gets db object

public getDb() : Database|null
Tags
throws
BasicException
Return values
Database|null

getDebugbar()

gets debugbar object

public getDebugbar() : StandardDebugBar
Tags
throws
BasicException
Return values
StandardDebugBar

getDefaultModel()

public getDefaultModel() : string
Return values
string

getEventManager()

gets events manager service

public getEventManager() : SharedEventEmitter
Tags
throws
BasicException
Return values
SharedEventEmitter

getGoogleAuthenticator()

gets google authenticator service

public getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
Tags
throws
BasicException
Return values
PHPGangsta_GoogleAuthenticator

getGuzzle()

gets guzzle service

public getGuzzle() : Client
Tags
throws
BasicException
Return values
Client

getIcons()

gets icons service

public getIcons() : Icons
Tags
throws
BasicException
Return values
Icons

getImagine()

gets imagine service

public getImagine() : Imagine
Tags
throws
BasicException
Return values
Imagine

getLog()

gets log object

public getLog() : Logger
Tags
throws
BasicException
Return values
Logger

getModel()

public getModel([string|null $model = null ]) : string
Parameters
$model : string|null = null
Return values
string

getName()

public static getName() : string
Return values
string

getPdo()

gets PDO object

public getPdo() : PDO|null
Tags
throws
BasicException
Return values
PDO|null

getRouters()

gets routers

public getRouters() : array<string|int, mixed>
Tags
throws
BasicException
Return values
array<string|int, mixed>

getSchema()

gets schema object

public getSchema() : Schema|null
Tags
throws
BasicException
Return values
Schema|null

getSesMailer()

gets SES mailer service

public getSesMailer() : SesClient
Tags
throws
BasicException
Return values
SesClient

getSmtpMailer()

gets SMTP mailer service

public getSmtpMailer() : Swift_Mailer
Tags
throws
BasicException
Return values
Swift_Mailer

getTemplates()

gets plates engine object

public getTemplates() : Engine
Tags
throws
BasicException
Return values
Engine

getTranslator()

gets translator

public getTranslator([string|null $locale_code = null ]) : Translator
Parameters
$locale_code : string|null = null
Tags
throws
DependencyException
throws
NotFoundException
Return values
Translator

getVersion()

public getVersion() : string
Return values
string

isEnabled()

public static isEnabled() : bool
Return values
bool

requestUrl()

executes an http request

public requestUrl(string $url[, string $method = 'GET' ][, array<string|int, mixed> $options = [] ]) : string|bool
Parameters
$url : string
$method : string = 'GET'
$options : array<string|int, mixed> = []
Tags
throws
Exception
throws
GuzzleException
Return values
string|bool

getService()

gets registered service

protected getService(string $service_key) : mixed
Parameters
$service_key : string
Tags
throws
BasicException

        
On this page

Search results