Skip to content

Commit

Permalink
Removed MUI branch test code that broke chat
Browse files Browse the repository at this point in the history
  • Loading branch information
sacredbanana committed Sep 18, 2024
1 parent a4050ad commit 14bfda4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions bundle/AmigaGPT/AmigaGPT.guide
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion bundle/AmigaGPT/AmigaGPT.readme
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Kurz: App zum Chatten mit ChatGPT
Author: Cameron Armstrong (Nightfox) <[email protected]>
Uploader: Cameron Armstrong (Nightfox) <[email protected]>
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
Expand Down Expand Up @@ -215,6 +215,12 @@ Special Thanks:

Changelog:

------------------
1.6.3 (2024-09-18)
------------------

- Fixed error receiving chat messages

------------------
1.6.2 (2024-09-01)
------------------
Expand Down
4 changes: 2 additions & 2 deletions src/openai.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down
7 changes: 1 addition & 6 deletions src/openai.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ struct ConversationNode {
STRPTR content;
};

struct Conversation {
struct MinList *messages;
STRPTR name;
};

/**
* The chat model OpenAI should use
**/
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 14bfda4

Please sign in to comment.