Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
b7bdb13e
Commit
b7bdb13e
authored
May 14, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed chats broken when OS locale is non-English language
parent
b99db363
Pipeline
#12206
passed with stage
in 1 minute 49 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
CHANGELOG.md
CHANGELOG.md
+3
-0
ChatGPTRequest.java
src/main/java/com/owlmaddie/chat/ChatGPTRequest.java
+2
-5
No files found.
CHANGELOG.md
View file @
b7bdb13e
...
...
@@ -15,6 +15,9 @@ All notable changes to **CreatureChat** are documented in this file. The format
-
Updated
`/creaturechat help`
output
-
Updated
`README.md`
with new command documentation
### Fixed
-
Chats broken when OS locale is non-English language (i.e.
`assistant to ass\u0131stant`
)
## [1.0.3] - 2024-05-10
### Changed
...
...
src/main/java/com/owlmaddie/chat/ChatGPTRequest.java
View file @
b7bdb13e
...
...
@@ -13,10 +13,7 @@ import java.io.*;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.regex.Pattern
;
...
...
@@ -138,7 +135,7 @@ public class ChatGPTRequest {
// Iterate backwards through the message history
for
(
int
i
=
messageHistory
.
size
()
-
1
;
i
>=
0
;
i
--)
{
ChatDataManager
.
ChatMessage
chatMessage
=
messageHistory
.
get
(
i
);
String
senderName
=
chatMessage
.
sender
.
toString
().
toLowerCase
();
String
senderName
=
chatMessage
.
sender
.
toString
().
toLowerCase
(
Locale
.
ENGLISH
);
String
messageText
=
replacePlaceholders
(
chatMessage
.
message
,
context
);
int
messageTokens
=
estimateTokenSize
(
senderName
+
": "
+
messageText
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment