Qore OpenAiRestClient Module Reference 1.0
Loading...
Searching...
No Matches
OpenAiRestClient.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* OpenAiRestClient.qm Copyright (C) 2020 - 2024 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
25// minimum qore version
26
27// require type definitions everywhere
28
29// enable all warnings
30
31// don't use "$" for vars, members, and methods, assume local variable scope
32
33// do not ignore argument errors
34
35
36
83
86
87public:
89 const DefaultUrl = "https://api.openai.com";
90
92 const DefaultApiVersion = "v1";
93
95 const DefaultOptions = ...;
96
97
98protected:
100 string api;
101
102public:
103
105
118 constructor(hash<auto> opts, *softbool do_not_connect) ;
119
120
122 static hash<auto> getOptions(hash<auto> opts);
123};
124
126
131
132public:
134 const DefaultUrl = "openai://api.openai.com";
135
137 const ConnectionScheme = ...;
138
139
141 const DefaultPingMethod= "GET";
142
145
146
148 const DefaultPingPath = "models";
149
151
161 constructor(string name, string description, string url = DefaultUrl, hash<auto> attributes = {}, hash<auto> options = {})
162 ;
163
164
166
183 constructor(hash<auto> config, *hash<auto> attr) ;
184
185
187 string getType();
188
189
191
196
197
199
203 DataProvider::AbstractDataProvider getDataProvider(*hash<auto> constructor_options);
204
205
207protected:
209public:
210
211
213
218protected:
219 OpenAiRestClient getImpl(bool connect = True, *hash<auto> rtopts);
220public:
221
222
224protected:
225 hash<ConnectionSchemeInfo> getConnectionSchemeInfoImpl();
226public:
227
228};
229};
static hash< auto > getOptions(hash< auto > opts)
returns options for OpenAiRestClient::OpenAiRestClient::constructor()
constructor(hash< auto > opts, *softbool do_not_connect)
creates the object with the given options
string api
The API version in use.
Definition OpenAiRestClient.qm.dox.h:100
Class for OpenAi REST connections; returns OpenAiRestClient objects.
Definition OpenAiRestClient.qm.dox.h:130
string getType()
returns "openai"
OpenAiRestClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a OpenAiRestClient object
constructor(hash< auto > config, *hash< auto > attr)
creates the OpenAiRestConnection object
const DefaultUrl
Default OpenAi REST API URL.
Definition OpenAiRestClient.qm.dox.h:134
DataProvider::AbstractDataProvider getDataProvider(*hash< auto > constructor_options)
returns a data provider object for this connection
const DefaultPingHeaders
Default OpenAi ping headers.
Definition OpenAiRestClient.qm.dox.h:144
const DefaultPingPath
Default OpenAi ping path.
Definition OpenAiRestClient.qm.dox.h:148
bool hasDataProvider()
returns True as this connection returns a data provider with the getDataProvider() method
const DefaultPingMethod
Default OpenAi ping method.
Definition OpenAiRestClient.qm.dox.h:141
setChildCapabilities()
Sets child data provider capabilities.
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
constructor(string name, string description, string url=DefaultUrl, hash< auto > attributes={}, hash< auto > options={})
creates the OpenAiRestConnection object
const ConnectionScheme
Connection entry info.
Definition OpenAiRestClient.qm.dox.h:137
the OpenAiRestClient namespace contains all the objects in the OpenAiRestClient module
Definition OpenAiRestClient.qm.dox.h:81