feat: add C extension for OpenAI chat and reset in rpylib.c and streamline Makefile

- Updated Makefile to simplify build targets for both main app and Python extension
- Implemented rpylib.c with chat and reset functions for OpenAI API communication
This commit is contained in:
2025-03-20 03:13:26 +00:00
parent 62e0b497a0
commit 14c40d5fa7
2 changed files with 26 additions and 6 deletions
+2 -5
View File
@@ -1,4 +1,4 @@
all: build run
all: build build_rpylib run
# Variables for compiler and flags
CC = gcc
@@ -9,12 +9,9 @@ build:
$(CC) main.c $(CFLAGS) -o r
publish r
build_free:
$(CC) main.c -DFREE_VERSION $(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
publish rpylib.so
run:
./r