The OpenAi data provider class.
More...
#include <OpenAiSimpleChatCompletionDataProvider.qc.dox.h>
|
| constructor (*RestClient rest) |
| Creates the object from the arguments.
|
|
string | getName () |
| Returns the data provider name.
|
|
| 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)
|
|
|
const | ProviderInfo = ... |
| Provider info.
|
|
const | ProviderSummaryInfo = ... |
| Provider summary info.
|
|
const | RequestType = OpenAiSimpleChatCompletionRequestType |
| Request type.
|
|
const | ResponseType = OpenAiSimpleChatCompletionResponseType |
| Response type.
|
|
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.
|
|
|
auto | doRequestImpl (auto req, *hash< auto > request_options) |
| Makes a request and returns the response.
|
|
*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.
|
|
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 Mutex | m () |
| lock for first time initialization
|
|
*RestClient::RestClient | rest |
| The REST client object for API calls.
|
|
static bool | init |
| first time initialization
|
|
The OpenAi data provider class.
◆ doRequestImpl()
auto OpenAiDataProvider::OpenAiSimpleChatCompletionDataProvider::doRequestImpl |
( |
auto | req, |
|
|
*hash< auto > | request_options ) |
|
protected |
Makes a request and returns the response.
- Parameters
-
req | the request to serialize and make according to the request type |
request_options | the request options; will be processed by validateRequestOptions() |
- Returns
- the response to the request
◆ getRequestTypeImpl()
*DataProvider::AbstractDataProviderType OpenAiDataProvider::OpenAiSimpleChatCompletionDataProvider::getRequestTypeImpl |
( |
| ) |
|
|
protected |
Returns the description of a successful request message, if any.
- Returns
- the request type for this provider
◆ getResponseTypeImpl()
*DataProvider::AbstractDataProviderType OpenAiDataProvider::OpenAiSimpleChatCompletionDataProvider::getResponseTypeImpl |
( |
| ) |
|
|
protected |
Returns the description of a response message, if this object represents a response message.
- Returns
- the response type for this response message