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
docwire::openai::embed Class Reference
Inheritance diagram for docwire::openai::embed:
docwire::chain_element docwire::with_pimpl< embed > docwire::with_pimpl< chain_element > docwire::with_pimpl_base docwire::with_pimpl_base

Public Types

enum class  model { text_embedding_3_small , text_embedding_3_large , text_embedding_ada_002 }
 

Public Member Functions

 embed (const std::string &api_key, model model=model::text_embedding_3_small)
 
continuation operator() (message_ptr msg, const message_callbacks &emit_message) override
 Executes transform operation for given node data. More...
 
bool is_leaf () const override
 Check if chain element is a leaf (last element which doesn't produce any messages). At this moment only exporters are leafs. More...
 
- Public Member Functions inherited from docwire::chain_element
 chain_element (chain_element &&)=default
 
chain_elementoperator= (chain_element &&)=default
 
virtual bool is_generator () const
 

Additional Inherited Members

- Protected Types inherited from docwire::with_pimpl< chain_element >
using impl_type = pimpl_impl< chain_element >
 
- Protected Types inherited from docwire::with_pimpl< embed >
using impl_type = pimpl_impl< embed >
 
- Protected Member Functions inherited from docwire::with_pimpl< chain_element >
impl_typecreate_impl (Args &&... args)
 
 with_pimpl (Args &&... args)
 
 with_pimpl (with_pimpl< chain_element > &&other) noexcept
 
 with_pimpl (std::nullptr_t)
 
with_pimploperator= (with_pimpl &&other) noexcept
 
impl_typeimpl ()
 
const impl_typeimpl () const
 
- Protected Member Functions inherited from docwire::with_pimpl< embed >
impl_typecreate_impl (Args &&... args)
 
 with_pimpl (Args &&... args)
 
 with_pimpl (with_pimpl< embed > &&other) noexcept
 
 with_pimpl (std::nullptr_t)
 
with_pimploperator= (with_pimpl &&other) noexcept
 
impl_typeimpl ()
 
const impl_typeimpl () const
 

Detailed Description

Definition at line 25 of file embed.h.

Member Enumeration Documentation

◆ model

Enumerator
text_embedding_3_small 

text-embedding-3-small: A new third generation embedding model, is OpenAI recommended default for most use cases.

text_embedding_3_large 

text-embedding-3-large: A larger and more powerful third generation embedding model, is OpenAI best performing embedding model.

text_embedding_ada_002 

text-embedding-ada-002: Older generation of OpenAI's embedding model.

Definition at line 28 of file embed.h.

Member Function Documentation

◆ is_leaf()

bool docwire::openai::embed::is_leaf ( ) const
inlineoverridevirtual

Check if chain element is a leaf (last element which doesn't produce any messages). At this moment only exporters are leafs.

Returns
true if leaf

Implements docwire::chain_element.

Definition at line 48 of file embed.h.

◆ operator()()

continuation docwire::openai::embed::operator() ( message_ptr  msg,
const message_callbacks emit_message 
)
overridevirtual

Executes transform operation for given node data.

See also
docwire::message_ptr
Parameters
tag
callback

Implements docwire::chain_element.


The documentation for this class was generated from the following file: