Commit 602a402d by Jonathan Thomas

If a CreatureChat API Key is entered, automatically update the URL to the creaturechat API.

parent 635e9dec
Pipeline #12110 passed with stage
in 22 seconds
......@@ -63,7 +63,13 @@ public class ConfigurationHandler {
// Getters and setters for existing fields
public String getApiKey() { return apiKey; }
public void setApiKey(String apiKey) { this.apiKey = apiKey; }
public void setApiKey(String apiKey) {
// Update URL if a CreatureChat API key is detected
if (apiKey.startsWith("cc_") && apiKey.length() == 15) {
setUrl("https://api.creaturechat.com/v1/chat/completions");
}
this.apiKey = apiKey;
}
public String getUrl() { return url; }
public void setUrl(String url) { this.url = url; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment