Qore OpenAiDataProvider Module Reference 1.3
Loading...
Searching...
No Matches
OpenAiDataProvider::OpenAiRunDataProvider Class Reference

The OpenAi data provider class. More...

#include <OpenAiRunDataProvider.qc.dox.h>

Inheritance diagram for OpenAiDataProvider::OpenAiRunDataProvider:
[legend]

Public Member Functions

 constructor (*RestClient rest, string thread_id, hash< auto > run)
 Creates the object from the arguments.
 
*list< hash< DataProviderSummaryInfo > > getChildProviderSummaryInfo ()
 Return data provider summary info.
 
string getName ()
 Returns the data provider name.
 
- Public Member Functions inherited from OpenAiDataProvider::OpenAiDataProviderCommon
 constructor (*hash< auto > options)
 Creates the object from constructor options.
 
 constructor (RestClient::RestClient rest)
 Creates the object.
 
*hash< string, bool > getSupportedReferenceData ()
 Returns information on supported reference data.
 
 setLogger (*LoggerInterface logger)
 Accepts a LoggerInterface object for logging (or clears it)
 

Public Attributes

const ProviderInfo = ...
 Provider info.
 
const ProviderSummaryInfo = ...
 Provider summary info.
 
const RequestType = AbstractDataProviderTypeMap."nothing"
 Request type.
 
const ResponseType = OpenAiRunDataType
 Response type.
 
- Public Attributes inherited from OpenAiDataProvider::OpenAiDataProviderCommon
const AssistantApiHdr = ...
 Headers required for the OpenAI assistant API.
 
const ConstructorOptions = ...
 Constructor options.
 
const DefaultOpenAiApiVersion = "v1"
 The default OpenAi API version.
 
const DefaultOpenAiUrl = "https://api.openai.com/"
 The default OpenAi URL.
 
const MaxIoRetries = 5
 Max retries.
 
const RetrySet = ...
 IO errors for REST retries.
 

Protected Member Functions

auto doRequestImpl (auto req, *hash< auto > request_options)
 Makes a request and returns the response.
 
 fixRun ()
 Updates run data.
 
*AbstractDataProvider getChildProviderImpl (string name)
 Returns the given child provider or nothing if the given child is unknown.
 
*list< string > getChildProviderNamesImpl ()
 Returns a list of child data provider names, if any.
 
*DataProvider::AbstractDataProviderType getRequestTypeImpl ()
 Returns the description of a successful request message, if any.
 
*DataProvider::AbstractDataProviderType getResponseTypeImpl ()
 Returns the description of a response message, if this object represents a response message.
 
hash< DataProviderInfo > getStaticInfoImpl ()
 Returns data provider static info.
 
- Protected Member Functions inherited from OpenAiDataProvider::OpenAiDataProviderCommon
hash< auto > doRestCommand (string method, string path, auto body, *hash< auto > hdr, *reference< hash< auto > > info)
 Makes a REST call and returns the response; handles rate limit responses.
 
*list< hash< AllowedValueInfo > > getReferenceAssistants ()
 Returns available assistants.
 
*list< hash< AllowedValueInfo > > getReferenceDataImpl (string type, *hash< auto > action_opts)
 Returns reference data of the given kind if available.
 
*list< hash< AllowedValueInfo > > getReferenceModels ()
 Returns available models.
 
bool retry (hash< ExceptionInfo > ex, reference< int > retries)
 Returns True if the error indicates that the operation should be retried.
 

Protected Attributes

const ChildMap = ...
 Child data providers.
 
hash< auto > run
 The run info.
 
string thread_id
 The thread ID.
 
- Protected Attributes inherited from OpenAiDataProvider::OpenAiDataProviderCommon
*RestClient::RestClient rest
 The REST client object for API calls.
 

Additional Inherited Members

- Static Protected Member Functions inherited from OpenAiDataProvider::OpenAiDataProviderCommon
static Mutex m ()
 lock for first time initialization
 
- Static Protected Attributes inherited from OpenAiDataProvider::OpenAiDataProviderCommon
static bool init
 first time initialization
 

Detailed Description

The OpenAi data provider class.

Member Function Documentation

◆ doRequestImpl()

auto OpenAiDataProvider::OpenAiRunDataProvider::doRequestImpl ( auto req,
*hash< auto > request_options )
protected

Makes a request and returns the response.

Parameters
reqthe request to serialize and make according to the request type
request_optionsthe request options; will be processed by validateRequestOptions()
Returns
the response to the request

◆ getChildProviderImpl()

*AbstractDataProvider OpenAiDataProvider::OpenAiRunDataProvider::getChildProviderImpl ( string name)
protected

Returns the given child provider or nothing if the given child is unknown.

Returns
the given child provider or nothing if the given child is unknown
See also
getChildProviderEx()

◆ getChildProviderNamesImpl()

*list< string > OpenAiDataProvider::OpenAiRunDataProvider::getChildProviderNamesImpl ( )
protected

Returns a list of child data provider names, if any.

Returns
a list of child data provider names, if any

◆ getRequestTypeImpl()

*DataProvider::AbstractDataProviderType OpenAiDataProvider::OpenAiRunDataProvider::getRequestTypeImpl ( )
protected

Returns the description of a successful request message, if any.

Returns
the request type for this provider

◆ getResponseTypeImpl()

*DataProvider::AbstractDataProviderType OpenAiDataProvider::OpenAiRunDataProvider::getResponseTypeImpl ( )
protected

Returns the description of a response message, if this object represents a response message.

Returns
the response type for this response message