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.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
all: build build_rpylib run
|
||||
all: build build_free build_rpylib run_free
|
||||
|
||||
# Variables for compiler and flags
|
||||
CC = gcc
|
||||
@@ -9,9 +9,16 @@ build:
|
||||
$(CC) main.c $(CFLAGS) -o r
|
||||
publish r
|
||||
|
||||
build_free:
|
||||
$(CC) -DOLLAMA main.c $(CFLAGS) -o rf
|
||||
publish rf
|
||||
|
||||
build_rpylib:
|
||||
$(CC) -shared -o rpylib.so -fPIC rpylib.c -lpython3.12 `python3-config --includes` -I/usr/include/CL -ljson-c -lcurl -lsqlite3
|
||||
publish rpylib.so
|
||||
|
||||
run:
|
||||
./r --verbose
|
||||
|
||||
run_free:
|
||||
./rf --verbose
|
||||
|
||||
Reference in New Issue
Block a user