view mrjunejune/conversation_api.h @ 264:04fee26ecce0

add authenticated JRPG conversation platform Add reusable auth/session storage, owned conversation recovery, guest quotas, admin workflows, URL-routed conversation UI, mobile frame support, and parallel browser acceptance. Co-authored-by: Copilot <[email protected]>
author MrJuneJune <me@mrjunejune.com>
date Fri, 07 Aug 2026 07:34:12 -0700
parents 1f9877b637e9
children
line wrap: on
line source

#ifndef MRJUNEJUNE_CONVERSATION_API_H
#define MRJUNEJUNE_CONVERSATION_API_H

#include "dowa/dowa.h"

/*
 * Guest quota policy passed from the config loader into Conversation_API_Init.
 * All fields must be validated (positive integers within supported ranges)
 * before passing; Init returns FALSE if any field is out of range.
 * Set guest_inference_enabled = FALSE to block all guest inference; TRUE to
 * allow it subject to quota.
 * request_output_tokens: per-request reservation cap; must be <= daily_output_tokens.
 */
typedef struct {
  boolean guest_inference_enabled;
  int64   daily_turns;
  int64   daily_output_tokens;
  int64   request_output_tokens;
} Conversation_API_Guest_Policy;

boolean Conversation_API_Init(
    const char                      *database_path,
    const Conversation_API_Guest_Policy *p_policy);

boolean Conversation_API_Enable_Inference(
    const char *sidecar_path,
    const char *copilot_cli_path);
void Conversation_API_Register_Routes(void);
void Conversation_API_Destroy(void);

#endif