Loading...
Searching...
No Matches
OpenAiDataProviderCommon.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
namespace OpenAiDataProvider {
class OpenAiDataProviderCommon : public DataProvider::AbstractDataProvider {
public:
const DefaultOpenAiUrl = "https://api.openai.com/";
const DefaultOpenAiApiVersion = "v1";
const ConstructorOptions = ...;
const RetrySet = ...;
const MaxIoRetries = 5;
const AssistantApiHdr = ...;
protected:
*RestClient::RestClient rest;
static bool init;
static Mutex m();
public:
constructor(RestClient::RestClient rest);
constructor(*hash<auto> options);
setLogger(*LoggerInterface logger);
*hash<string, bool> getSupportedReferenceData();
protected:
*list<hash<AllowedValueInfo>> getReferenceDataImpl(string type, *hash<auto> action_opts);
public:
protected:
*list<hash<AllowedValueInfo>> getReferenceModels();
public:
protected:
*list<hash<AllowedValueInfo>> getReferenceAssistants();
public:
protected:
hash<auto> doRestCommand(string method, string path, auto body, *hash<auto> hdr, *reference<hash<auto>> info);
public:
protected:
bool retry(hash<ExceptionInfo> ex, reference<int> retries);
public:
};
};
OpenAiDataProvider::OpenAiDataProviderCommon
The OpenAi data provider common base class.
Definition OpenAiDataProviderCommon.qc.dox.h:28
OpenAiDataProvider::OpenAiDataProviderCommon::AssistantApiHdr
const AssistantApiHdr
Headers required for the OpenAI assistant API.
Definition OpenAiDataProviderCommon.qc.dox.h:49
OpenAiDataProvider::OpenAiDataProviderCommon::init
static bool init
first time initialization
Definition OpenAiDataProviderCommon.qc.dox.h:57
OpenAiDataProvider::OpenAiDataProviderCommon::rest
*RestClient::RestClient rest
The REST client object for API calls.
Definition OpenAiDataProviderCommon.qc.dox.h:54
OpenAiDataProvider::OpenAiDataProviderCommon::RetrySet
const RetrySet
IO errors for REST retries.
Definition OpenAiDataProviderCommon.qc.dox.h:42
OpenAiDataProvider::OpenAiDataProviderCommon::doRestCommand
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.
OpenAiDataProvider::OpenAiDataProviderCommon::MaxIoRetries
const MaxIoRetries
Max retries.
Definition OpenAiDataProviderCommon.qc.dox.h:46
OpenAiDataProvider::OpenAiDataProviderCommon::constructor
constructor(*hash< auto > options)
Creates the object from constructor options.
OpenAiDataProvider::OpenAiDataProviderCommon::DefaultOpenAiUrl
const DefaultOpenAiUrl
The default OpenAi URL.
Definition OpenAiDataProviderCommon.qc.dox.h:32
OpenAiDataProvider::OpenAiDataProviderCommon::constructor
constructor(RestClient::RestClient rest)
Creates the object.
OpenAiDataProvider::OpenAiDataProviderCommon::getReferenceModels
*list< hash< AllowedValueInfo > > getReferenceModels()
Returns available models.
OpenAiDataProvider::OpenAiDataProviderCommon::getReferenceDataImpl
*list< hash< AllowedValueInfo > > getReferenceDataImpl(string type, *hash< auto > action_opts)
Returns reference data of the given kind if available.
OpenAiDataProvider::OpenAiDataProviderCommon::setLogger
setLogger(*LoggerInterface logger)
Accepts a LoggerInterface object for logging (or clears it)
OpenAiDataProvider::OpenAiDataProviderCommon::DefaultOpenAiApiVersion
const DefaultOpenAiApiVersion
The default OpenAi API version.
Definition OpenAiDataProviderCommon.qc.dox.h:35
OpenAiDataProvider::OpenAiDataProviderCommon::ConstructorOptions
const ConstructorOptions
Constructor options.
Definition OpenAiDataProviderCommon.qc.dox.h:38
OpenAiDataProvider::OpenAiDataProviderCommon::getSupportedReferenceData
*hash< string, bool > getSupportedReferenceData()
Returns information on supported reference data.
OpenAiDataProvider::OpenAiDataProviderCommon::getReferenceAssistants
*list< hash< AllowedValueInfo > > getReferenceAssistants()
Returns available assistants.
OpenAiDataProvider::OpenAiDataProviderCommon::retry
bool retry(hash< ExceptionInfo > ex, reference< int > retries)
Returns True if the error indicates that the operation should be retried.
OpenAiDataProvider::OpenAiDataProviderCommon::m
static Mutex m()
lock for first time initialization
OpenAiDataProvider
Qore OpenAiDataProvider module definition.
Definition OpenAiAssistantCreateDataProvider.qc.dox.h:26