LlamaLib  v2.0.2
Cross-platform library for local LLMs
Loading...
Searching...
No Matches
LLM_agent.h File Reference

High-level conversational agent interface for LLMs. More...

#include "LLM.h"
#include "LLM_client.h"
Include dependency graph for LLM_agent.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ChatMessage
 Structure representing a single chat message. More...
 
class  LLMAgent
 High-level conversational agent for LLM interactions. More...
 

Functions

LLMAgentLLMAgent_Construct (LLMLocal *llm, const char *system_prompt="")
 Construct LLMAgent (C API)
 
void LLMAgent_Set_System_Prompt (LLMAgent *llm, const char *system_prompt)
 Set system prompt (C API)
 
const char * LLMAgent_Get_System_Prompt (LLMAgent *llm)
 Get system prompt (C API)
 
void LLMAgent_Set_Slot (LLMAgent *llm, int slot_id)
 Set processing slot (C API)
 
int LLMAgent_Get_Slot (LLMAgent *llm)
 Get processing slot (C API)
 
const char * LLMAgent_Chat (LLMAgent *llm, const char *user_prompt, bool add_to_history=true, CharArrayFn callback=nullptr, bool return_response_json=false, bool debug_prompt=false)
 Conduct chat interaction (C API)
 
void LLMAgent_Clear_History (LLMAgent *llm)
 Clear conversation history (C API)
 
const char * LLMAgent_Get_History (LLMAgent *llm)
 Get conversation history (C API)
 
void LLMAgent_Set_History (LLMAgent *llm, const char *history_json)
 Set conversation history (C API)
 
void LLMAgent_Add_User_Message (LLMAgent *llm, const char *content)
 Add user message to history (C API)
 
void LLMAgent_Add_Assistant_Message (LLMAgent *llm, const char *content)
 Add assistant message to history (C API)
 
void LLMAgent_Remove_Last_Message (LLMAgent *llm)
 Remove last message from history (C API)
 
void LLMAgent_Save_History (LLMAgent *llm, const char *filepath)
 Save conversation history to file (C API)
 
void LLMAgent_Load_History (LLMAgent *llm, const char *filepath)
 Load conversation history from file (C API)
 
size_t LLMAgent_Get_History_Size (LLMAgent *llm)
 Get conversation history size (C API)
 

Detailed Description

High-level conversational agent interface for LLMs.

Provides a conversation-aware wrapper around LLM functionality with chat history management

Definition in file LLM_agent.h.