Loading...
Searching...
No Matches
OpenAiDataProvider.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
/* OpenAiDataProvider.qm Copyright 2024 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// minimum required Qore version
// assume local scope for variables, do not use "$" signs
// require type definitions everywhere
// strict argument handling
// enable all warnings
) + DataProviderActionCatalog::getActionOptionFromFields(
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"}, {
"preselected": True,
"required": True,
}
) + DataProviderActionCatalog::getActionOptionFromFields(
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"}, {
"preselected": True,
"required": True,
}
),
"output_type": OpenAiFileUploadFromLocationDataProvider::ResponseType,
});
DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName,
"path": "/files/{file}/delete",
"action": "delete-file",
"display_name": "Delete File",
"short_desc": "Delete a file stored on OpenAI",
"desc": "Delete a file stored on OpenAI",
"action_code": DPAT_API,
"path_vars": {
"file": <DataProviderPathVarInfo>{
"display_name": "File",
"short_desc": "The ID or OpenAI file name of the file to delete",
"desc": "The ID or OpenAI file name of the file to delete",
"example_value": "file-XlKc5wjQpWHfXbKwhCZeAuul",
},
},
"output_type": OpenAiDeleteResponseType,
});
DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName,
"path": "/create-assistant",
"action": "create-assistant",
"display_name": "Create an Assistant",
"short_desc": "Create an assistant",
"desc": "Create an assistant with a model and instructions",
"action_code": DPAT_API,
"options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiAssistantCreateRequestType.getFields(){"model",}, {
"preselected": True,
"required": True,
}
) + DataProviderActionCatalog::getActionOptionFromFields(
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": {
"assistant": <DataProviderPathVarInfo>{
"display_name": "Assistant",
"short_desc": "The ID of the assistant to update",
"desc": "The ID of the assistant to update",
"example_value": "asst_pOVJLN6z0hTsW1UKpALakcLA",
},
},
"options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiAssistantUpdateRequestType.getFields() ),
"output_type": OpenAiDeleteResponseType,
});
DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName,
"path": "/assistants/{assistant}/delete",
"action": "delete-assistant",
"display_name": "Delete Assistant",
"short_desc": "Delete an assistant",
"desc": "Delete an assistant",
"action_code": DPAT_API,
"path_vars": {
"assistant": <DataProviderPathVarInfo>{
"display_name": "Assistant",
"short_desc": "The ID of the assistant to delete",
"desc": "The ID of the assistant to delete",
"example_value": "asst_pOVJLN6z0hTsW1UKpALakcLA",
},
},
"output_type": OpenAiDeleteResponseType,
});
DataProviderActionCatalog::registerAction(<DataProviderActionInfo>{ "app": OpenAiDataProvider::AppName,
"path": "/threads/create",
"action": "create-thread",
"display_name": "Create a Thread",
"short_desc": "Create a thread",
"desc": "Create a thread with the given messages",
"action_code": DPAT_API,
"options": DataProviderActionCatalog::getActionOptionFromFields( OpenAiThreadCreateRequestType.getFields(){"messages",}, {
"preselected": True,
"required": True,
}
) + DataProviderActionCatalog::getActionOptionFromFields(
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",}, {
"preselected": True,
"required": True,
}
) + DataProviderActionCatalog::getActionOptionFromFields(
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",}, {
"preselected": True,
"required": True,
}
),
"output_type": OpenAiDeleteResponseType,
});
};
}
namespace OpenAiDataProvider {
const AppName = "OpenAI";
const OpenAiLogo = ...;
};
OpenAiDataProvider
Qore OpenAiDataProvider module definition.
Definition OpenAiAssistantCreateDataProvider.qc.dox.h:26
OpenAiDataProvider::OpenAiThreadUpdateRequestType
const OpenAiThreadUpdateRequestType
Constant for the thread update data type.
Definition OpenAiThreadUpdateDataProvider.qc.dox.h:101
OpenAiDataProvider::OpenAiDeleteResponseType
const OpenAiDeleteResponseType
Model type constant.
Definition OpenAiModelDeleteDataProvider.qc.dox.h:107
OpenAiDataProvider::AppName
const AppName
OpenAI app name.
Definition OpenAiDataProvider.qm.dox.h:146
OpenAiDataProvider::OpenAiSimpleChatCompletionRequestType
const OpenAiSimpleChatCompletionRequestType
The chat completion request type constant.
Definition OpenAiSimpleChatCompletionDataProvider.qc.dox.h:101
OpenAiDataProvider::OpenAiLogo
const OpenAiLogo
Logo file.
Definition OpenAiDataProvider.qm.dox.h:149
OpenAiDataProvider::OpenAiChatCompletionRequestType
const OpenAiChatCompletionRequestType
The chat completion request type constant.
Definition OpenAiChatCompletionDataProvider.qc.dox.h:181
OpenAiDataProvider::OpenAiFileUploadRequestType
const OpenAiFileUploadRequestType
File upload request type constant.
Definition OpenAiFileUploadDataProvider.qc.dox.h:103
OpenAiDataProvider::OpenAiAssistantCreateRequestType
const OpenAiAssistantCreateRequestType
File upload request type constant.
Definition OpenAiAssistantCreateDataProvider.qc.dox.h:181
OpenAiDataProvider::OpenAiThreadIdRequestType
const OpenAiThreadIdRequestType
Thread type constant.
Definition OpenAiThreadDeleteDataProvider.qc.dox.h:101
OpenAiDataProvider::OpenAiThreadCreateRequestType
const OpenAiThreadCreateRequestType
File upload request type constant.
Definition OpenAiThreadCreateDataProvider.qc.dox.h:101
OpenAiDataProvider::OpenAiAssistantUpdateRequestType
const OpenAiAssistantUpdateRequestType
Constant for the assistant tool data type.
Definition OpenAiAssistantUpdateDataProvider.qc.dox.h:107