Qore OpenAiDataProvider Module Reference 1.3
Loading...
Searching...
No Matches
OpenAiDataProvider.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* OpenAiDataProvider.qm Copyright 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 required Qore version
26// assume local scope for variables, do not use "$" signs
27// require type definitions everywhere
28// strict argument handling
29// enable all warnings
30
31
32 ) + DataProviderActionCatalog::getActionOptionFromFields(
33 OpenAiChatCompletionRequestType.getFields() - ("model", "messages") ), "output_type": OpenAiChatCompletionDataProvider::ResponseType, }); DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName, "path": "/simple-chat", "action": "simple-chat", "display_name": "Simple Chat", "short_desc": "Chat with an AI model by sending a single message and receiving a single reply", "desc": "Chat with an AI model by sending a single message and receiving a single reply", "action_code": DPAT_API, "options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiSimpleChatCompletionRequestType.getFields(){"model", "role", "content"}, {
34 "preselected": True,
35 "required": True,
36 }
37 ) + DataProviderActionCatalog::getActionOptionFromFields(
38 OpenAiSimpleChatCompletionRequestType.getFields() - ("model", "role", "content") ), "output_type": OpenAiChatCompletionDataProvider::ResponseType, }); DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName, "path": "/upload-file", "action": "upload-file", "display_name": "Upload File", "short_desc": "Upload a file for an assistant, for fine tuning, or for batch processing", "desc": "Upload a file for an assistant, for fine tuning, or for batch processing", "action_code": DPAT_API, "options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiFileUploadRequestType.getFields(){"purpose", "file"}, {
39 "preselected": True,
40 "required": True,
41 }
42 ),
43 "output_type": OpenAiFileUploadFromLocationDataProvider::ResponseType,
44 });
45 DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName,
46 "path": "/files/{file}/delete",
47 "action": "delete-file",
48 "display_name": "Delete File",
49 "short_desc": "Delete a file stored on OpenAI",
50 "desc": "Delete a file stored on OpenAI",
51 "action_code": DPAT_API,
52 "path_vars": {
53 "file": <DataProviderPathVarInfo>{
54 "display_name": "File",
55 "short_desc": "The ID or OpenAI file name of the file to delete",
56 "desc": "The ID or OpenAI file name of the file to delete",
57 "example_value": "file-XlKc5wjQpWHfXbKwhCZeAuul",
58 },
59 },
60 "output_type": OpenAiDeleteResponseType,
61 });
62 DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName,
63 "path": "/create-assistant",
64 "action": "create-assistant",
65 "display_name": "Create an Assistant",
66 "short_desc": "Create an assistant",
67 "desc": "Create an assistant with a model and instructions",
68 "action_code": DPAT_API,
69 "options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiAssistantCreateRequestType.getFields(){"model",}, {
70 "preselected": True,
71 "required": True,
72 }
73 ) + DataProviderActionCatalog::getActionOptionFromFields(
74 OpenAiAssistantCreateRequestType.getFields() - ("model",) ), "output_type": OpenAiFileUploadFromLocationDataProvider::ResponseType, }); DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName, "path": "/assistants/{assistant}/update", "action": "update-assistant", "display_name": "Update Assistant", "short_desc": "Update an assistant", "desc": "Update an assistant", "action_code": DPAT_API, "path_vars": {
75 "assistant": <DataProviderPathVarInfo>{
76 "display_name": "Assistant",
77 "short_desc": "The ID of the assistant to update",
78 "desc": "The ID of the assistant to update",
79 "example_value": "asst_pOVJLN6z0hTsW1UKpALakcLA",
80 },
81 },
82 "options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiAssistantUpdateRequestType.getFields() ),
83 "output_type": OpenAiDeleteResponseType,
84 });
85 DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName,
86 "path": "/assistants/{assistant}/delete",
87 "action": "delete-assistant",
88 "display_name": "Delete Assistant",
89 "short_desc": "Delete an assistant",
90 "desc": "Delete an assistant",
91 "action_code": DPAT_API,
92 "path_vars": {
93 "assistant": <DataProviderPathVarInfo>{
94 "display_name": "Assistant",
95 "short_desc": "The ID of the assistant to delete",
96 "desc": "The ID of the assistant to delete",
97 "example_value": "asst_pOVJLN6z0hTsW1UKpALakcLA",
98 },
99 },
100 "output_type": OpenAiDeleteResponseType,
101 });
102 DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName,
103 "path": "/threads/create",
104 "action": "create-thread",
105 "display_name": "Create a Thread",
106 "short_desc": "Create a thread",
107 "desc": "Create a thread with the given messages",
108 "action_code": DPAT_API,
109 "options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiThreadCreateRequestType.getFields(){"messages",}, {
110 "preselected": True,
111 "required": True,
112 }
113 ) + DataProviderActionCatalog::getActionOptionFromFields(
114 OpenAiThreadCreateRequestType.getFields() - ("messages",) ), "output_type": OpenAiFileUploadFromLocationDataProvider::ResponseType, }); DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName, "path": "/threads/update", "action": "update-thread", "display_name": "Update Thread", "short_desc": "Update a thread", "desc": "Update a thread", "action_code": DPAT_API, "options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiThreadUpdateRequestType.getFields(){"thread_id",}, {
115 "preselected": True,
116 "required": True,
117 }
118 ) + DataProviderActionCatalog::getActionOptionFromFields(
119 OpenAiThreadUpdateRequestType.getFields() - "thread_id" ), "output_type": OpenAiDeleteResponseType, }); DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName, "path": "/threads/delete", "action": "delete-thread", "display_name": "Delete Thread", "short_desc": "Delete a thread", "desc": "Delete a thread", "action_code": DPAT_API, "options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiThreadIdRequestType.getFields(){"thread_id",}, {
120 "preselected": True,
121 "required": True,
122 }
123 ),
124 "output_type": OpenAiDeleteResponseType,
125 });
126 };
127}
128
144namespace OpenAiDataProvider {
146const AppName = "OpenAI";
147
149const OpenAiLogo = ...;
150
151};
Qore OpenAiDataProvider module definition.
Definition OpenAiAssistantCreateDataProvider.qc.dox.h:26
const OpenAiThreadUpdateRequestType
Constant for the thread update data type.
Definition OpenAiThreadUpdateDataProvider.qc.dox.h:101
const OpenAiDeleteResponseType
Model type constant.
Definition OpenAiModelDeleteDataProvider.qc.dox.h:107
const AppName
OpenAI app name.
Definition OpenAiDataProvider.qm.dox.h:146
const OpenAiSimpleChatCompletionRequestType
The chat completion request type constant.
Definition OpenAiSimpleChatCompletionDataProvider.qc.dox.h:101
const OpenAiLogo
Logo file.
Definition OpenAiDataProvider.qm.dox.h:149
const OpenAiChatCompletionRequestType
The chat completion request type constant.
Definition OpenAiChatCompletionDataProvider.qc.dox.h:181
const OpenAiFileUploadRequestType
File upload request type constant.
Definition OpenAiFileUploadDataProvider.qc.dox.h:103
const OpenAiAssistantCreateRequestType
File upload request type constant.
Definition OpenAiAssistantCreateDataProvider.qc.dox.h:181
const OpenAiThreadIdRequestType
Thread type constant.
Definition OpenAiThreadDeleteDataProvider.qc.dox.h:101
const OpenAiThreadCreateRequestType
File upload request type constant.
Definition OpenAiThreadCreateDataProvider.qc.dox.h:101
const OpenAiAssistantUpdateRequestType
Constant for the assistant tool data type.
Definition OpenAiAssistantUpdateDataProvider.qc.dox.h:107