DocWire SDK
DocWire SDK: Deterministic, auditable, and secure data processing in C++20. On-premise by default. No compromises on computational speed.
Toggle main menu visibility
Loading...
Searching...
No Matches
openai_sentiment.cpp
This example shows how to detect the sentiment of a document using the OpenAI API.
#include "docwire.h"
#include <sstream>
int
main(
int
argc,
char
* argv[])
{
using namespace
docwire
;
try
{
std::filesystem::path(
"1.doc"
) |
content_type::detector
{} |
office_formats_parser
{} |
plain_text_exporter
() |
openai::detect_sentiment
(environment::get(
"OPENAI_API_KEY"
).value()) | std::cout;
}
catch
(
const
std::exception& e)
{
std::cerr <<
errors::diagnostic_message
(e) << std::endl;
return
1;
}
return
0;
}
docwire::content_type::detector
Content type detection chain element.
Definition
content_type.h:107
docwire::office_formats_parser
A composite parser handling various office document formats.
Definition
office_formats_parser.h:39
docwire::openai::detect_sentiment
Definition
detect_sentiment.h:25
docwire::plain_text_exporter
Exports data to plain text format.
Definition
plain_text_exporter.h:42
docwire::errors::diagnostic_message
std::string diagnostic_message(const std::exception &e)
Generates a diagnostic message for the given nested exceptions chain.
Definition
diagnostic_message.h:27
docwire
The main namespace for the DocWire SDK.
Definition
ai_elements.h:19
Generated by
1.18.0