evoltagent 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2865,7 +2865,6 @@ GitTool = __decorateClass([
|
|
|
2865
2865
|
|
|
2866
2866
|
// src/model.ts
|
|
2867
2867
|
import OpenAI from "openai";
|
|
2868
|
-
import Anthropic from "@anthropic-ai/sdk";
|
|
2869
2868
|
import { GoogleGenerativeAI } from "@google/generative-ai";
|
|
2870
2869
|
var Model = class {
|
|
2871
2870
|
modelName;
|
|
@@ -2890,6 +2889,7 @@ var Model = class {
|
|
|
2890
2889
|
const provider = this.config.provider.toLowerCase();
|
|
2891
2890
|
switch (provider) {
|
|
2892
2891
|
case "openai":
|
|
2892
|
+
case "anthropic":
|
|
2893
2893
|
this.openaiClient = new OpenAI({
|
|
2894
2894
|
apiKey: this.config.apiKey || process.env.OPENAI_API_KEY,
|
|
2895
2895
|
baseURL: this.config.baseUrl,
|
|
@@ -2903,16 +2903,16 @@ var Model = class {
|
|
|
2903
2903
|
timeout: 6e4
|
|
2904
2904
|
});
|
|
2905
2905
|
break;
|
|
2906
|
-
case
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2906
|
+
// case 'anthropic':
|
|
2907
|
+
// if (this.config.baseUrl.endsWith('/v1') || this.config.baseUrl.endsWith('v1/')) {
|
|
2908
|
+
// this.config.baseUrl = this.config.baseUrl.slice(0, -3);
|
|
2909
|
+
// }
|
|
2910
|
+
// this.anthropicClient = new Anthropic({
|
|
2911
|
+
// apiKey: this.config.apiKey || process.env.ANTHROPIC_API_KEY,
|
|
2912
|
+
// baseURL: this.config.baseUrl,
|
|
2913
|
+
// timeout: 60000,
|
|
2914
|
+
// });
|
|
2915
|
+
// break;
|
|
2916
2916
|
case "gemini":
|
|
2917
2917
|
const apiKey = this.config.apiKey || process.env.GEMINI_API_KEY || "";
|
|
2918
2918
|
this.geminiClient = new GoogleGenerativeAI(apiKey);
|
|
@@ -2931,9 +2931,8 @@ var Model = class {
|
|
|
2931
2931
|
switch (provider) {
|
|
2932
2932
|
case "openai":
|
|
2933
2933
|
case "deepseek":
|
|
2934
|
-
return await this._callOpenAICompatible(messages, tools2, useStream);
|
|
2935
2934
|
case "anthropic":
|
|
2936
|
-
return await this.
|
|
2935
|
+
return await this._callOpenAICompatible(messages, tools2, useStream);
|
|
2937
2936
|
case "gemini":
|
|
2938
2937
|
return await this._callGemini(messages, tools2, useStream);
|
|
2939
2938
|
default:
|