liblloyal 1.0.0
Composable primitives for llama.cpp inference
Loading...
Searching...
No Matches
minja::chat_template Class Reference

#include <chat-template.hpp>

Public Member Functions

 chat_template (const std::string &source, const std::string &bos_token, const std::string &eos_token)
 
const std::string & source () const
 
const std::string & bos_token () const
 
const std::string & eos_token () const
 
const chat_template_capsoriginal_caps () const
 
std::string apply (const nlohmann::ordered_json &messages, const nlohmann::ordered_json &tools, bool add_generation_prompt, const nlohmann::ordered_json &extra_context=nlohmann::ordered_json(), bool apply_polyfills=true)
 
std::string apply (const chat_template_inputs &inputs, const chat_template_options &opts=chat_template_options()) const
 

Static Public Member Functions

static nlohmann::ordered_json add_system (const nlohmann::ordered_json &messages, const std::string &system_prompt)
 

Detailed Description

Definition at line 71 of file chat-template.hpp.

Constructor & Destructor Documentation

◆ chat_template()

minja::chat_template::chat_template ( const std::string &  source,
const std::string &  bos_token,
const std::string &  eos_token 
)
inline

Definition at line 108 of file chat-template.hpp.

Member Function Documentation

◆ add_system()

static nlohmann::ordered_json minja::chat_template::add_system ( const nlohmann::ordered_json &  messages,
const std::string &  system_prompt 
)
inlinestatic

Definition at line 607 of file chat-template.hpp.

◆ apply() [1/2]

std::string minja::chat_template::apply ( const chat_template_inputs inputs,
const chat_template_options opts = chat_template_options() 
) const
inline

Definition at line 381 of file chat-template.hpp.

◆ apply() [2/2]

std::string minja::chat_template::apply ( const nlohmann::ordered_json &  messages,
const nlohmann::ordered_json &  tools,
bool  add_generation_prompt,
const nlohmann::ordered_json &  extra_context = nlohmann::ordered_json(),
bool  apply_polyfills = true 
)
inline

Definition at line 362 of file chat-template.hpp.

◆ bos_token()

const std::string & minja::chat_template::bos_token ( ) const
inline

Definition at line 355 of file chat-template.hpp.

◆ eos_token()

const std::string & minja::chat_template::eos_token ( ) const
inline

Definition at line 356 of file chat-template.hpp.

◆ original_caps()

const chat_template_caps & minja::chat_template::original_caps ( ) const
inline

Definition at line 357 of file chat-template.hpp.

◆ source()

const std::string & minja::chat_template::source ( ) const
inline

Definition at line 354 of file chat-template.hpp.


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