Mercurial
comparison mrjunejune/conversation_store.h @ 260:1f9877b637e9
Add Copilot-powered cyberpunk JRPG chat
Integrate the production JRPG chat with Seobeo streaming, Deita persistence, and a Bazel-managed Copilot SDK and LiteLLM inference stack.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <mrjunejune@users.noreply.github.com> |
|---|---|
| date | Wed, 05 Aug 2026 09:19:41 -0700 |
| parents | |
| children | 04fee26ecce0 |
comparison
equal
deleted
inserted
replaced
| 259:667156fcd3e3 | 260:1f9877b637e9 |
|---|---|
| 1 #ifndef MRJUNEJUNE_CONVERSATION_STORE_H | |
| 2 #define MRJUNEJUNE_CONVERSATION_STORE_H | |
| 3 | |
| 4 #include "dowa/dowa.h" | |
| 5 | |
| 6 typedef struct Conversation_Store Conversation_Store; | |
| 7 | |
| 8 typedef enum { | |
| 9 CONVERSATION_STORE_ERROR = -1, | |
| 10 CONVERSATION_STORE_OK = 0, | |
| 11 CONVERSATION_STORE_NOT_FOUND = 1, | |
| 12 CONVERSATION_STORE_CONFLICT = 2, | |
| 13 } Conversation_Store_Result; | |
| 14 | |
| 15 typedef struct { | |
| 16 int64 id; | |
| 17 int64 sequence; | |
| 18 char *role; | |
| 19 char *content; | |
| 20 char *status; | |
| 21 char *request_id; | |
| 22 char *error_message; | |
| 23 int64 input_tokens; | |
| 24 int64 output_tokens; | |
| 25 int64 created_at; | |
| 26 int64 completed_at; | |
| 27 } Conversation_Turn; | |
| 28 | |
| 29 typedef struct { | |
| 30 char *id; | |
| 31 char *copilot_session_id; | |
| 32 char *title; | |
| 33 char *status; | |
| 34 int64 created_at; | |
| 35 int64 updated_at; | |
| 36 Conversation_Turn *turns; | |
| 37 } Conversation_Record; | |
| 38 | |
| 39 Conversation_Store *Conversation_Store_Create(const char *database_path); | |
| 40 void Conversation_Store_Destroy(Conversation_Store *p_store); | |
| 41 boolean Conversation_Store_Generate_UUID(char output[37]); | |
| 42 | |
| 43 Conversation_Store_Result Conversation_Store_Create_Conversation( | |
| 44 Conversation_Store *p_store, | |
| 45 const char *title, | |
| 46 char output_id[37]); | |
| 47 | |
| 48 Conversation_Store_Result Conversation_Store_Get( | |
| 49 Conversation_Store *p_store, | |
| 50 const char *conversation_id, | |
| 51 Conversation_Record *p_record, | |
| 52 Dowa_Arena *p_arena); | |
| 53 | |
| 54 Conversation_Store_Result Conversation_Store_Update_Title( | |
| 55 Conversation_Store *p_store, | |
| 56 const char *conversation_id, | |
| 57 const char *title); | |
| 58 | |
| 59 Conversation_Store_Result Conversation_Store_Delete( | |
| 60 Conversation_Store *p_store, | |
| 61 const char *conversation_id); | |
| 62 | |
| 63 Conversation_Store_Result Conversation_Store_Begin_Turn( | |
| 64 Conversation_Store *p_store, | |
| 65 const char *conversation_id, | |
| 66 const char *request_id, | |
| 67 const char *prompt); | |
| 68 | |
| 69 Conversation_Store_Result Conversation_Store_Complete_Turn( | |
| 70 Conversation_Store *p_store, | |
| 71 const char *conversation_id, | |
| 72 const char *request_id, | |
| 73 const char *content, | |
| 74 int64 input_tokens, | |
| 75 int64 output_tokens); | |
| 76 | |
| 77 Conversation_Store_Result Conversation_Store_Fail_Turn( | |
| 78 Conversation_Store *p_store, | |
| 79 const char *conversation_id, | |
| 80 const char *request_id, | |
| 81 const char *error_message, | |
| 82 boolean aborted); | |
| 83 | |
| 84 #endif |