|
ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
|
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. | |
| ChatRequest & | WithSystemPrompt (std::string prompt) |
| Set the system prompt. | |
| ChatRequest & | WithPreviousResponseId (std::string id) |
| Link to a previous response for multi-turn context. | |
| ChatRequest & | WithResponseFormat (ResponseFormat format) |
| Set the structured output format. | |
| ChatRequest & | AddTool (std::shared_ptr< Tool > tool) |
| Append a tool to the request. | |
| ChatRequest & | AddFileId (FileID file_id) |
| Attach an uploaded file to the request. | |
| ChatRequest & | AddImageId (FileID image_id) |
| Attach an uploaded image to the request. | |
| ChatRequest & | AddImageUrl (std::string url) |
| Attach an image by URL. | |
| ChatRequest & | WithTemperature (float temperature) |
| Set the sampling temperature. | |
| ChatRequest & | WithMaxTokens (int max_tokens) |
| Set the maximum number of tokens to generate. | |
| ChatRequest & | WithTopK (int top_k) |
| Set the top-k sampling limit. | |
| ChatRequest & | WithTopP (float top_p) |
| Set the nucleus sampling cutoff. | |
| ChatRequest & | WithFrequencyPenalty (float frequency_penalty) |
| Set the frequency penalty. | |
| ChatRequest & | WithPresencePenalty (float presence_penalty) |
| Set the presence penalty. | |
| ChatRequest & | WithSeed (int seed) |
| Set the random seed for deterministic output. | |
Public Attributes | |
| ModelID | model |
| Target model identifier. | |
| std::shared_ptr< Input > | input |
| 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< ResponseFormat > | response_format |
| Optional structured output format. | |
| std::vector< std::shared_ptr< Tool > > | tools |
| Tools available to the model. | |
| std::vector< FileID > | file_ids |
| Attached file identifiers. | |
| std::vector< FileID > | image_ids |
| Attached image identifiers. | |
| std::vector< std::string > | image_urls |
| Attached image URLs. | |
| Options | options |
| Generation parameters. | |
Chat completion request sent to an LLM provider.
Construct a request with model and input.
| model | Target model identifier. |
| input | Polymorphic input (InputString or InputItems). |