From 14bfda49ad0921ac0f8f175685cd1c67d2079a0b Mon Sep 17 00:00:00 2001 From: "Cameron Armstrong (Nightfox)" Date: Wed, 18 Sep 2024 17:33:41 +0800 Subject: [PATCH] Removed MUI branch test code that broke chat --- CHANGELOG.md | 4 ++++ bundle/AmigaGPT/AmigaGPT.guide | 4 ++++ bundle/AmigaGPT/AmigaGPT.readme | 8 +++++++- src/openai.c | 4 ++-- src/openai.h | 7 +------ src/version.h | 4 ++-- 6 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b79d18..5844708 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.6.3 (2024-09-18) + +- Fixed error receiving chat messages + ## 1.6.2 (2024-09-01) - Increase max OpenAI API key size to 256 characters diff --git a/bundle/AmigaGPT/AmigaGPT.guide b/bundle/AmigaGPT/AmigaGPT.guide index 4cfe346..1164b7b 100644 --- a/bundle/AmigaGPT/AmigaGPT.guide +++ b/bundle/AmigaGPT/AmigaGPT.guide @@ -715,6 +715,10 @@ Training data: Up to Sep 2021 @node changelog "Changelog" @{b}Changelog@{ub} +@{b}1.6.3 (2024-09-18)@{ub} + +- Fixed error receiving chat messages + @{b}1.6.2 (2024-09-01)@{ub} - Increase max OpenAI API key size to 256 characters diff --git a/bundle/AmigaGPT/AmigaGPT.readme b/bundle/AmigaGPT/AmigaGPT.readme index 9e838ff..bf6ab99 100644 --- a/bundle/AmigaGPT/AmigaGPT.readme +++ b/bundle/AmigaGPT/AmigaGPT.readme @@ -3,7 +3,7 @@ Kurz: App zum Chatten mit ChatGPT Author: Cameron Armstrong (Nightfox) Uploader: Cameron Armstrong (Nightfox) Type: util/misc -Version: 1.6.1 +Version: 1.6.3 Architecture: m68k-amigaos >= 3.9; ppc-amigaos Requires: AmigaOS 3.9+/68020+ util/libs/AmiSSL-5.9-OS3.lha Replaces: util/misc/AmigaGPT.lha @@ -215,6 +215,12 @@ Special Thanks: Changelog: +------------------ +1.6.3 (2024-09-18) +------------------ + +- Fixed error receiving chat messages + ------------------ 1.6.2 (2024-09-01) ------------------ diff --git a/src/openai.c b/src/openai.c index 7b06ee7..0eaa135 100644 --- a/src/openai.c +++ b/src/openai.c @@ -347,7 +347,7 @@ static ULONG createSSLConnection(CONST_STRPTR host, UWORD port) { * @param stream whether to stream the response or not * @return a pointer to a new array of json_object containing the response(s) or NULL -- Free it with json_object_put() for all responses then FreeVec() for the array when you are done using it **/ -struct json_object** postChatMessageToOpenAI(struct Conversation *conversation, enum ChatModel model, CONST_STRPTR openAiApiKey, BOOL stream) { +struct json_object** postChatMessageToOpenAI(struct MinList *conversation, enum ChatModel model, CONST_STRPTR openAiApiKey, BOOL stream) { struct json_object **responses = AllocVec(sizeof(struct json_object *) * RESPONSE_ARRAY_BUFFER_LENGTH, MEMF_ANY | MEMF_CLEAR); static BOOL streamingInProgress = FALSE; UWORD responseIndex = 0; @@ -360,7 +360,7 @@ struct json_object** postChatMessageToOpenAI(struct Conversation *conversation, json_object_object_add(obj, "model", json_object_new_string(CHAT_MODEL_NAMES[model])); struct json_object *conversationArray = json_object_new_array(); - struct MinNode *conversationNode = conversation->messages->mlh_Head; + struct MinNode *conversationNode = conversation->mlh_Head; while (conversationNode->mln_Succ != NULL) { struct ConversationNode *message = (struct ConversationNode *)conversationNode; struct json_object *messageObj = json_object_new_object(); diff --git a/src/openai.h b/src/openai.h index 7f890ba..1a97a36 100644 --- a/src/openai.h +++ b/src/openai.h @@ -24,11 +24,6 @@ struct ConversationNode { STRPTR content; }; -struct Conversation { - struct MinList *messages; - STRPTR name; -}; - /** * The chat model OpenAI should use **/ @@ -132,7 +127,7 @@ LONG initOpenAIConnector(); * @param stream whether to stream the response or not * @return a pointer to a new array of json_object containing the response(s) or NULL -- Free it with json_object_put() for all responses then FreeVec() for the array when you are done using it **/ -struct json_object** postChatMessageToOpenAI(struct Conversation *conversation, enum ChatModel model, CONST_STRPTR openAiApiKey, BOOL stream); +struct json_object** postChatMessageToOpenAI(struct MinList *conversation, enum ChatModel model, CONST_STRPTR openAiApiKey, BOOL stream); /** * Post a image creation request to OpenAI diff --git a/src/version.h b/src/version.h index f3d65b0..d0c28a5 100644 --- a/src/version.h +++ b/src/version.h @@ -1,3 +1,3 @@ -#define APP_VERSION "1.6.2" -#define BUILD_NUMBER "3425" +#define APP_VERSION "1.6.3" +#define BUILD_NUMBER "3428" #define APP_NAME "AmigaGPT" \ No newline at end of file