in any format (Office, PDF, mail, etc) in two steps: summarize using GPT model and convert the summary to speech using text to speech model. Result is saved to mp3 file#include "docwire.h"

#include <fstream>
 
int main(int argc, char* argv[])
{
using namespace docwire
try
{
std::filesystem::path("1.doc") | content_type::detector{} | office_formats_parser{} | PlainTextExporter() | openai::Summarize(std::getenv("OPENAI_API_KEY")) | openai::TextToSpeech(std::getenv("OPENAI_API_KEY")) | std::ofstream("summary.mp3")
}
catch (const std::exception& e)
{
std::cerr << errors::diagnostic_message(e) << std::endl
return 1
}
 
return 0
}
posted on 2025-07-05 10:04  北京开发  阅读(11)  评论(0)    收藏  举报