Mercurial
comparison mrjunejune/inference_bridge.h @ 265:056790c4fb0d
add role-aware Epi assistant prompts
Add verified June knowledge, guest/member/admin Copilot profiles, profile-isolated session recovery, animated Epi greetings, and a single authoritative runtime config workflow for inference.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Fri, 07 Aug 2026 10:50:30 -0700 |
| parents | b401627fc49e |
| children |
comparison
equal
deleted
inserted
replaced
| 264:04fee26ecce0 | 265:056790c4fb0d |
|---|---|
| 2 #define MRJUNEJUNE_INFERENCE_BRIDGE_H | 2 #define MRJUNEJUNE_INFERENCE_BRIDGE_H |
| 3 | 3 |
| 4 #include "dowa/dowa.h" | 4 #include "dowa/dowa.h" |
| 5 | 5 |
| 6 typedef struct Inference_Bridge Inference_Bridge; | 6 typedef struct Inference_Bridge Inference_Bridge; |
| 7 | |
| 8 #define INFERENCE_BRIDGE_HISTORY_MAX 20 | |
| 9 | |
| 10 /* A single prior-turn entry for transcript rehydration. */ | |
| 11 typedef struct { | |
| 12 const char *role; /* must be "user" or "assistant"; never NULL */ | |
| 13 const char *content; /* non-NULL; may be empty string */ | |
| 14 } Inference_Bridge_History_Message; | |
| 15 | |
| 16 typedef enum { | |
| 17 INFERENCE_PROMPT_PROFILE_PUBLIC_VISITOR = 0, | |
| 18 INFERENCE_PROMPT_PROFILE_INVITED_FRIEND = 1, | |
| 19 INFERENCE_PROMPT_PROFILE_JUNE_ADMIN = 2, | |
| 20 } Inference_Prompt_Profile; | |
| 7 | 21 |
| 8 typedef struct { | 22 typedef struct { |
| 9 const char *type; | 23 const char *type; |
| 10 const char *request_id; | 24 const char *request_id; |
| 11 const char *conversation_id; | 25 const char *conversation_id; |
| 32 void *p_user_data); | 46 void *p_user_data); |
| 33 | 47 |
| 34 boolean Inference_Bridge_Start(Inference_Bridge *p_bridge); | 48 boolean Inference_Bridge_Start(Inference_Bridge *p_bridge); |
| 35 boolean Inference_Bridge_Is_Ready(const Inference_Bridge *p_bridge); | 49 boolean Inference_Bridge_Is_Ready(const Inference_Bridge *p_bridge); |
| 36 | 50 |
| 51 /* | |
| 52 * Start an inference turn. | |
| 53 * | |
| 54 * p_history / history_count: optional bounded history for transcript | |
| 55 * rehydration. Pass NULL / 0 if no prior context is available. | |
| 56 * history_count must not exceed INFERENCE_BRIDGE_HISTORY_MAX (20). | |
| 57 * Every entry must have role "user" or "assistant" and a non-NULL content. | |
| 58 * Returns FALSE and writes nothing if any validation constraint is violated. | |
| 59 */ | |
| 37 boolean Inference_Bridge_Start_Turn( | 60 boolean Inference_Bridge_Start_Turn( |
| 38 Inference_Bridge *p_bridge, | 61 Inference_Bridge *p_bridge, |
| 39 const char *request_id, | 62 const char *request_id, |
| 40 const char *conversation_id, | 63 const char *conversation_id, |
| 41 const char *prompt); | 64 const char *prompt, |
| 65 Inference_Prompt_Profile prompt_profile, | |
| 66 uint32 prompt_version, | |
| 67 uint32 knowledge_version, | |
| 68 const Inference_Bridge_History_Message *p_history, | |
| 69 uint32 history_count); | |
| 42 | 70 |
| 43 boolean Inference_Bridge_Abort_Turn( | 71 boolean Inference_Bridge_Abort_Turn( |
| 44 Inference_Bridge *p_bridge, | 72 Inference_Bridge *p_bridge, |
| 45 const char *request_id, | 73 const char *request_id, |
| 46 const char *conversation_id); | 74 const char *conversation_id); |