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
ai_embed.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: AGPL-3.0-only OR LicenseRef-DocWire-Commercial */
10 /*********************************************************************************************************************************************/
11 
12 #ifndef DOCWIRE_AI_EMBED_H
13 #define DOCWIRE_AI_EMBED_H
14 
15 #include "ai_export.h"
16 #include "ai_runner.h"
17 #include "chain_element.h"
18 #include "not_null.h"
19 #include "pimpl.h"
20 
21 namespace docwire::ai
22 {
23 
24 class DOCWIRE_AI_EXPORT embed : public chain_element, public with_pimpl<embed>
25 {
26  public:
33  explicit embed(not_null<std::shared_ptr<ai_runner>> model_runner, std::string prefix);
34  continuation operator()(message_ptr msg, const message_callbacks& emit_message) override;
35  bool is_leaf() const override { return false; }
36 
37  private:
39 
40 };
41 
42 } // namespace docwire::ai
43 
44 #endif // DOCWIRE_AI_EMBED_H
embed(not_null< std::shared_ptr< ai_runner >> model_runner, std::string prefix)
Construct a local AI embed chain element with a specific model runner and prefix.
bool is_leaf() const override
Check if chain element is a leaf (last element which doesn't produce any messages)....
Definition: ai_embed.h:35
A wrapper for pointer-like types that enforces a non-null invariant.
Definition: not_null.h:41