Turi Create  4.0
turi::toolkit_function_specification Struct Reference

#include <model_server/lib/toolkit_function_specification.hpp>

Public Attributes

std::string name
 
variant_map_type default_options
 
std::map< std::string, flexible_typedescription
 
std::function< toolkit_function_response_type(toolkit_function_invocation &)> toolkit_execute_function
 
std::function< variant_type(const std::vector< variant_type > &invoke)> native_execute_function
 

Detailed Description

Each toolkit is specified by filling in toolkit_function_specification struct. The contents of the struct describe user-facing documentation and default options, as well as a callback to actual toolkit execution.

Definition at line 21 of file toolkit_function_specification.hpp.

Member Data Documentation

◆ default_options

variant_map_type turi::toolkit_function_specification::default_options

A list of required configurable parameters and their default values.

Definition at line 31 of file toolkit_function_specification.hpp.

◆ description

std::map<std::string, flexible_type> turi::toolkit_function_specification::description

Toolkit properties. The following keys are recognized:

  • "arguments": value must a flex_list containing a list of the argument names.
  • "file": The file which the toolkit was loaded from
  • "documentation": A documentation string

Definition at line 41 of file toolkit_function_specification.hpp.

◆ name

std::string turi::toolkit_function_specification::name

A short name used to identify this toolkit. For instance, LDA, or PageRank.

Definition at line 26 of file toolkit_function_specification.hpp.

◆ native_execute_function

std::function<variant_type(const std::vector<variant_type>& invoke)> turi::toolkit_function_specification::native_execute_function

A pointer to a simple version of the toolkit execution function which can be executed natively without a toolkit_function_invocation. It will not have some of the error management/reporting capabilities of the invocation object, and does not have named parameters. But it is much simpler.

Definition at line 58 of file toolkit_function_specification.hpp.

◆ toolkit_execute_function

std::function<toolkit_function_response_type(toolkit_function_invocation&)> turi::toolkit_function_specification::toolkit_execute_function

A pointer to the actual execution function. All parameters to the execution are passed in the toolkit_function_invocation struct. Returns an std::pair<bool, options_map> with status results.

Note
this can be generated easily using toolkit_function_wrapper_impl::make_spec

Definition at line 50 of file toolkit_function_specification.hpp.


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