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_runner.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_RUNNER_H
13 #define DOCWIRE_AI_RUNNER_H
14 
15 #include "ai_export.h"
16 #include <stdexcept>
17 #include <string>
18 #include <vector>
19 
20 namespace docwire::ai {
21 
42 class DOCWIRE_AI_EXPORT ai_runner {
43  public:
50  virtual ~ai_runner() = default;
51 
57  virtual std::string process(const std::string& input) = 0;
58 
64  virtual std::vector<double> embed(const std::string& input) = 0;
69  virtual void unload() = 0;
70 };
71 
72 } // namespace docwire::ai
73 
74 #endif
Abstract interface for AI model runners.
Definition: ai_runner.h:42
virtual std::string process(const std::string &input)=0
Synchronously process input and return generated text.
virtual void unload()=0
Unload the model and free associated resources. –!Must be thread-safe!– and safe to call concurrently...
virtual std::vector< double > embed(const std::string &input)=0
Generate an embedding for the given input.
virtual ~ai_runner()=default
Virtual destructor.