Update anthropic.js

This commit is contained in:
Namhyeon Go 2024-12-27 14:53:17 +09:00 committed by GitHub
parent 46c5a91032
commit 5a5526df63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,16 +8,12 @@
// //
var FILE = require("lib/file"); var FILE = require("lib/file");
var HTTP = require("lib/http"); var HTTP = require("lib/http");
var APIKEY = require("lib/apikey");
function loadApiKey() {
var s = FILE.readFile("data/anthropic-apikey.txt", FILE.CdoCharset.CdoUTF_8);
return s.trim();
}
function chat(content) { function chat(content) {
var answers = []; var answers = [];
var apikey = loadApiKey(); var apikey = APIKEY.getApiKey("anthropic");
console.log("Anthropic (Claude) API KEY:", apikey); console.log("Anthropic (Claude) API KEY:", apikey);
var response = HTTP.create("MSXML") var response = HTTP.create("MSXML")
@ -58,7 +54,7 @@ function chat(content) {
exports.chat = chat; exports.chat = chat;
exports.VERSIONINFO = "Anthropic (Claude) interface (anthropic.js) version 0.1.1"; exports.VERSIONINFO = "Anthropic (Claude) interface (anthropic.js) version 0.1.2";
exports.AUTHOR = "abuse@catswords.net"; exports.AUTHOR = "abuse@catswords.net";
exports.global = global; exports.global = global;
exports.require = global.require; exports.require = global.require;