Commit Graph

28 Commits

Author SHA1 Message Date
0e8fdda063 fix: add error handling for memory allocation, database, and OpenAI failures across multiple C modules 2025-04-03 03:26:11 +00:00
f73f9b3c50 chore: remove placeholder progress message and add tools command with claude backend
- Remove the initial commit placeholder progress message from Makefile
- Add `!tools` command to REPL that prints available tools descriptions
- Include tools.h header and integrate tools_descriptions() function
- Switch default RD backend from DeepInfra/Llama to Anthropic/Claude models
- Update advanced_model and fast_model to claude-3-5-haiku-20241022
- Change completions_api_url to Anthropic API endpoint
- Enable verbose mode by default (is_verbose = true)
- Update README to reflect new Claude/Ollama focus and remove old download links
2025-04-02 13:37:59 +00:00
120fe71ecd chore: remove cgi-bin gpt scripts, malloc wrappers, and dead repl help/debug commands 2025-03-30 00:47:00 +00:00
f7561f291d feat: extend supported file extensions list and add cross-platform path handling in utils 2025-03-29 23:13:42 +00:00
605f396464 fix: correct typo in indexer.h header guard macro name and remove unused prompt_max_tokens 2025-03-28 22:22:57 +00:00
7befee245d feat: add Ollama support with conditional compilation and new build targets
Introduce conditional compilation via OLLAMA preprocessor flag to switch between OpenAI and Ollama API endpoints, model names, and URLs. Add `build_free` and `run_free` Makefile targets for the Ollama variant. Enhance REPL with `!models` command to list available models, improve error handling in `openai_process_chat_message`, and fix history line addition logic.
2025-03-28 19:50:10 +00:00
fec259097a chore: normalize indentation to 2 spaces and reorder includes in auth.h, browse.c, chat.h, db_utils.c, db_utils.h, http_curl.h 2025-03-28 05:56:36 +00:00
599a268e65 refactor: replace hardcoded prompt_temperature and db_file with PROMPT_TEMPERATURE and DB_FILE macros defined in r.h 2025-03-28 05:55:22 +00:00
7dfd1c0b44 fix: prevent infinite recursion in web_search and add upsert logic to db_set with new db_execute function 2025-03-28 04:37:22 +00:00
8dc66bbfaa feat: add web_search function and dynamic model switching with !dump/!model/!debug commands 2025-03-28 00:55:04 +00:00
eccb17d766 chore: add sqlite3 link flag, verbose mode, and new browse/db_utils modules to build system 2025-03-22 02:15:49 +00:00
aa0467475d chore: clear terminal on first SIGINT before printing exit prompt in main.c
Add explicit system("clear") call and newline in handle_sigint to visually reset the terminal display before showing the double-Ctrl+C exit message, ensuring clean output regardless of prior screen state.
2025-03-21 02:27:11 +00:00
50419881dd feat: add double-sigint exit, --free flag, model command, and index_source_directory tool
- Add SIGINT handler that exits on two Ctrl+C presses within 1 second
- Introduce --free flag to switch auth type to AUTH_TYPE_FREE via auth_free()
- Implement "model" REPL command to print current prompt model name
- Register index_source_directory tool description and function in tools.h
2025-03-21 00:15:40 +00:00
eb99686ce9 feat: add message_add_object helper and integrate into openai_chat flow
Add a new `message_add_object` function in messages.h that appends a json_object to the global message list. Modify openai_chat in openai.h to call this function after processing a chat completion, ensuring the assistant's response object is stored. Also comment out the previous `message_add_tool_call` call to avoid duplicate message storage when tool calls are present, and add a missing `continue` in main.c's repl loop after the dump command to prevent fallthrough.
2025-03-20 15:38:10 +00:00
1a77a5b692 fix: add dump command to repl and remove deprecated hello function from rpylib 2025-03-20 01:36:56 +00:00
0a18669f40 feat: add auth_init function and remove version-specific startup messages
Implement auth_init() in auth.h to detect API keys from environment variables (R_KEY or OPENAI_API_KEY) and set auth_type accordingly. In main.c, call auth_init() during init() and replace the conditional commercial/free version startup messages with a simple carriage return clear.
2025-03-19 21:02:39 +00:00
91553e1979 feat: replace compile-time free tier flag with runtime auth_type enum for model selection
Add AUTH_TYPE enum and global auth_type variable to auth.h, replacing the FREE_VERSION preprocessor conditional in chat.h with a dynamic get_prompt_model() function that returns "gpt-3.5-turbo" for free users and "gpt-4o-mini" for API key holders. Update all references to prompt_model to use the new function, enabling runtime model switching without recompilation.
2025-03-19 20:45:07 +00:00
6e3e899832 chore: remove FREE_VERSION conditional and add --py flag for python file inclusion 2025-03-16 21:46:09 +00:00
3aa4f0d02e chore: remove trailing whitespace from line.h and delete unused http.h module 2025-03-05 23:10:15 +00:00
8d1968ce97 fix: add null checks for openai responses and implement interactive terminal tool with home directory expansion 2025-03-05 22:53:35 +00:00
c054c5a019 chore: remove python3.14 linking and plugin include from build and main 2025-02-13 18:09:29 +00:00
b95d7d8e56 fix: add missing newlines at EOF, fix memory leaks, increase buffer sizes, and improve plugin imports 2025-01-26 01:54:45 +00:00
45246a1bd0 feat: add --stdin flag to read prompt from piped input and increase code highlight buffer to 4096 2025-01-25 13:19:01 +00:00
7160567726 feat: add free version build target with hardcoded api key and gpt-3.5-turbo model 2025-01-05 21:59:51 +00:00
ddc3cdcff6 feat: replace hardcoded api_key with resolve_api_key() and add .rcontext.txt loading 2025-01-04 15:54:48 +00:00
c797fe2be2 chore: add MIT license headers and fix formatting across all source files 2025-01-04 07:40:31 +00:00
6c9eb2e3e3 chore: remove commented debug prints and trailing whitespace across multiple source files 2025-01-04 07:35:39 +00:00
02ee32e718 chore: scaffold project with gitignore, makefile, cgi scripts, and core c headers
Add initial project structure including .gitignore for build artifacts,
Makefile with gcc build and run targets, README placeholder, cgi-bin
directory with gpt.py and gpt_template.html, and core C headers for
chat, http, line input, markdown rendering, and messages.
2025-01-04 05:00:03 +00:00