#ifndef __H_AI_HTTP_STUB #define __H_AI_HTTP_STUB #include /* * Spawn the Python AI stub script (tests/functionaltests/ai_http_stub.py). * * mode — one of "ok", "openai", "401", "500", "models" (see the stub * script). Selects the response body and HTTP status. * reply — body text used by "ok"/"openai"/"401" modes. Pass NULL for * the default ("MOCK-REPLY"). * * Returns the listening port (>0) on success, 0 on failure. The child's * pid is recorded internally; call ai_http_stub_stop() to terminate it. */ int ai_http_stub_start(const char* mode, const char* reply); /* * Send SIGTERM to the most recently spawned stub and reap it. * No-op if no stub is running. */ void ai_http_stub_stop(void); #endif