Loading...
Searching...
No Matches
OpenAiDataProvider::OpenAiDataProviderCommon Class Reference

The OpenAi data provider common base class. More...

`#include <OpenAiDataProviderCommon.qc.dox.h>`

Inheritance diagram for OpenAiDataProvider::OpenAiDataProviderCommon:
[legend]

## Public Member Functions

| 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 | 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

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.

## Static Protected Member Functions

static Mutex | m ()
| lock for first time initialization

## Protected Attributes

*RestClient::RestClient | rest
| The REST client object for API calls.

## Static Protected Attributes

static bool | init
| first time initialization

## Detailed Description

The OpenAi data provider common base class.

## Member Function Documentation

## getReferenceDataImpl()

*list< hash< AllowedValueInfo > > OpenAiDataProvider::OpenAiDataProviderCommon::getReferenceDataImpl | ( | string | type,
|  | *hash< auto > | action_opts )

protected

Returns reference data of the given kind if available.

Parameters

  type | the unique type name of the reference data
  action_opts | an optional hash of action options when called when working with an app action

Returns
  a list of allowed values for this data

Since
  DataProvider 3.0

## getSupportedReferenceData()

*hash< string, bool > OpenAiDataProvider::OpenAiDataProviderCommon::getSupportedReferenceData | ( |  | ) |

Returns information on supported reference data.

Returns
  a hash of supported reference data; keys in the hash returned are supported in calls to getReferenceData()

Since
  DataProvider 3.0