ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
Loading...
Searching...
No Matches
foresthub::core::ChatRequest Struct Reference

Chat completion request sent to an LLM provider. More...

#include <types.hpp>

Public Member Functions

 ChatRequest ()=default
 Default constructor. Use the two-argument constructor or builder methods for configuration.
 ChatRequest (ModelID model, std::shared_ptr< Input > input)
 Construct a request with model and input.
ChatRequestWithSystemPrompt (std::string prompt)
 Set the system prompt.
ChatRequestWithPreviousResponseId (std::string id)
 Link to a previous response for multi-turn context.
ChatRequestWithResponseFormat (ResponseFormat format)
 Set the structured output format.
ChatRequestAddTool (std::shared_ptr< Tool > tool)
 Append a tool to the request.
ChatRequestAddFileId (FileID file_id)
 Attach an uploaded file to the request.
ChatRequestAddImageId (FileID image_id)
 Attach an uploaded image to the request.
ChatRequestAddImageUrl (std::string url)
 Attach an image by URL.
ChatRequestWithTemperature (float temperature)
 Set the sampling temperature.
ChatRequestWithMaxTokens (int max_tokens)
 Set the maximum number of tokens to generate.
ChatRequestWithTopK (int top_k)
 Set the top-k sampling limit.
ChatRequestWithTopP (float top_p)
 Set the nucleus sampling cutoff.
ChatRequestWithFrequencyPenalty (float frequency_penalty)
 Set the frequency penalty.
ChatRequestWithPresencePenalty (float presence_penalty)
 Set the presence penalty.
ChatRequestWithSeed (int seed)
 Set the random seed for deterministic output.

Public Attributes

ModelID model
 Target model identifier.
std::shared_ptr< Inputinput
 Polymorphic input (InputString or InputItems).
std::string system_prompt
 System-level instructions.
std::string previous_response_id
 Previous response ID for multi-turn context.
foresthub::Optional< ResponseFormatresponse_format
 Optional structured output format.
std::vector< std::shared_ptr< Tool > > tools
 Tools available to the model.
std::vector< FileIDfile_ids
 Attached file identifiers.
std::vector< FileIDimage_ids
 Attached image identifiers.
std::vector< std::string > image_urls
 Attached image URLs.
Options options
 Generation parameters.

Detailed Description

Chat completion request sent to an LLM provider.

Constructor & Destructor Documentation

◆ ChatRequest()

foresthub::core::ChatRequest::ChatRequest ( ModelID model,
std::shared_ptr< Input > input )
inline

Construct a request with model and input.

Parameters
modelTarget model identifier.
inputPolymorphic input (InputString or InputItems).

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