DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
chat.h
1 /*********************************************************************************************************************************************/
2 /* DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. */
3 /* Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, */
4 /* document analysis. Offline processing possible for security and confidentiality */
5 /* */
6 /* Copyright (c) SILVERCODERS Ltd, http://silvercoders.com */
7 /* Project homepage: https://github.com/docwire/docwire */
8 /* */
9 /* SPDX-License-Identifier: GPL-2.0-only OR LicenseRef-DocWire-Commercial */
10 /*********************************************************************************************************************************************/
11 
12 #ifndef DOCWIRE_OPENAI_CHAT_H
13 #define DOCWIRE_OPENAI_CHAT_H
14 
15 #include "chain_element.h"
16 #include "openai_export.h"
17 #include <string>
18 
19 namespace docwire
20 {
21 namespace openai
22 {
23 
27 enum class Model
28 {
30  gpt_5,
32  gpt_5_mini,
34  gpt_5_nano,
36  gpt_5_chat_latest,
38  gpt_41,
40  gpt_41_mini,
42  gpt_41_nano,
44  gpt_4o,
46  gpt_4o_mini,
48  o3,
50  o3_pro,
52  o3_deep_research,
54  o3_mini,
56  o4_mini,
58  o4_mini_deep_research
59 };
60 
61 enum class ImageDetail
62 {
63  low, high, automatic
64 };
65 
66 class DOCWIRE_OPENAI_EXPORT Chat : public ChainElement, public with_pimpl<Chat>
67 {
68 public:
69  Chat(const std::string& system_message, const std::string& api_key, Model model = Model::gpt_5, float temperature = 0.7, ImageDetail image_detail = ImageDetail::automatic);
70 
78  continuation operator()(message_ptr msg, const message_callbacks& emit_message) override;
79 
80  bool is_leaf() const override
81  {
82  return false;
83  }
84 
85 private:
87 };
88 
89 } // namespace openai
90 } // namespace docwire
91 
92 #endif //DOCWIRE_OPENAI_CHAT_H
bool is_leaf() const override
Check if ChainElement is a leaf (last element which doesn't produce any messages)....
Definition: chat.h:80
continuation operator()(message_ptr msg, const message_callbacks &emit_message) override
Executes transform operation for given node data.
The main namespace for the DocWire SDK.
Definition: ai_elements.h:19