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
0a403a5f
Commit
0a403a5f
authored
May 24, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If OpenAI key is set, switch URL automatically back to OpenAI endpoint
parent
b261c286
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
CHANGELOG.md
CHANGELOG.md
+1
-0
ConfigurationHandler.java
...ain/java/com/owlmaddie/commands/ConfigurationHandler.java
+4
-1
No files found.
CHANGELOG.md
View file @
0a403a5f
...
...
@@ -12,6 +12,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
### Fixed
-
Parse OpenAI JSON error messages, to display a more readable error message
-
Remove quotes from CreatureChat API error messages
-
If OpenAI key is set, switch URL automatically back to OpenAI endpoint
## [1.0.4] - 2024-05-15
...
...
src/main/java/com/owlmaddie/commands/ConfigurationHandler.java
View file @
0a403a5f
...
...
@@ -73,9 +73,12 @@ public class ConfigurationHandler {
// Getters and setters for existing fields
public
String
getApiKey
()
{
return
apiKey
;
}
public
void
setApiKey
(
String
apiKey
)
{
// Update URL if a CreatureChat API key is detected
if
(
apiKey
.
startsWith
(
"cc_"
)
&&
apiKey
.
length
()
==
15
)
{
// Update URL if a CreatureChat API key is detected
setUrl
(
"https://api.creaturechat.com/v1/chat/completions"
);
}
else
if
(
apiKey
.
startsWith
(
"sk-"
))
{
// Update URL if a OpenAI API key is detected
setUrl
(
"https://api.openai.com/v1/chat/completions"
);
}
this
.
apiKey
=
apiKey
;
}
...
...
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