35 lines
627 B
C
Raw Normal View History

2025-03-22 03:15:49 +01:00
#ifndef R_H
#define R_H
2025-03-28 06:56:36 +01:00
#include "auth.h"
2025-03-28 01:55:04 +01:00
#include "malloc.h"
2025-03-28 06:56:36 +01:00
#include "utils.h"
2025-03-22 03:15:49 +01:00
#include <stdbool.h>
2025-03-28 01:55:04 +01:00
#include <string.h>
2025-03-22 03:15:49 +01:00
bool is_verbose = false;
2025-03-28 06:56:36 +01:00
char *_model = NULL;
2025-03-28 01:55:04 +01:00
2025-03-28 06:55:22 +01:00
#define DB_FILE "~/.r.db"
static int prompt_max_tokens = 10000;
#define PROMPT_TEMPERATURE 0.1
2025-03-28 01:55:04 +01:00
void set_prompt_model(const char *model) {
2025-03-28 06:56:36 +01:00
if (_model != NULL) {
free(_model);
}
_model = strdup(model);
2025-03-28 01:55:04 +01:00
}
2025-03-28 06:56:36 +01:00
const char *get_prompt_model() {
if (auth_type != AUTH_TYPE_API_KEY) {
if (_model == NULL) {
_model = strdup("gpt-3.5-turbo");
2025-03-28 01:55:04 +01:00
}
2025-03-28 06:56:36 +01:00
} else if (_model == NULL) {
_model = strdup("gpt-4o-mini");
}
return _model;
2025-03-28 01:55:04 +01:00
}
2025-03-28 06:56:36 +01:00
#endif