Update.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
#ifndef BASH_REPAIR_H
|
||||
#define BASH_REPAIR_H
|
||||
|
||||
char *bash_repair_command(const char *src);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
#ifndef R_CONTEXT_MANAGER_H
|
||||
#define R_CONTEXT_MANAGER_H
|
||||
|
||||
#include "messages.h"
|
||||
#include "r_error.h"
|
||||
|
||||
/**
|
||||
* Shrinks the context of the given messages to fit within model limits.
|
||||
* Uses a smart trimming algorithm:
|
||||
* 1. Truncates the middle of large messages (preserving start and end).
|
||||
* 2. Removes oldest conversation pairs (user/assistant) if needed.
|
||||
* 3. Never touches the 'system' message or the very last user message.
|
||||
*
|
||||
* Returns R_SUCCESS if shrinkage was performed, or error if not possible.
|
||||
*/
|
||||
r_status_t context_manager_shrink(messages_handle msgs);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
#ifndef JSON_REPAIR_H
|
||||
#define JSON_REPAIR_H
|
||||
|
||||
char *json_repair_string(const char *src);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
#ifndef PYTHON_REPAIR_H
|
||||
#define PYTHON_REPAIR_H
|
||||
|
||||
char *python_repair_code(const char *src);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
#ifndef R_DIFF_H
|
||||
#define R_DIFF_H
|
||||
|
||||
/**
|
||||
* Prints a beautiful, colorized diff between two strings to stderr.
|
||||
* Mimics the style of 'git diff'.
|
||||
*
|
||||
* @param path The path of the file being changed (for the header).
|
||||
* @param old_content The original content.
|
||||
* @param new_content The new content.
|
||||
*/
|
||||
void r_diff_print(const char *path, const char *old_content, const char *new_content);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user