diff --git a/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Chat.cs b/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Chat.cs index bf5c1ec4..f482933a 100644 --- a/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Chat.cs +++ b/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Chat.cs @@ -33,7 +33,7 @@ public class Chat public Chat(string apiKey, string basicAddress = "https://open.bigmodel.cn/api/paas/v4/") { this._apiKey = apiKey; - this._baseAddress = basicAddress; + this._baseAddress = basicAddress.TrimEnd('/'); } private async IAsyncEnumerable CompletionBase(TextRequestBase textRequestBody,string apiKey) diff --git a/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Embeddings.cs b/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Embeddings.cs index 1eb48146..9d7f357f 100644 --- a/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Embeddings.cs +++ b/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Embeddings.cs @@ -10,7 +10,7 @@ public class Embeddings public Embeddings(string apiKey, string basicAddress = "https://open.bigmodel.cn/api/paas/v4/") { this._apiKey = apiKey; - this._baseAddress = basicAddress; + this._baseAddress = basicAddress.TrimEnd('/'); } diff --git a/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Images.cs b/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Images.cs index dd23a868..22fd81ad 100644 --- a/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Images.cs +++ b/src/Plugins/BotSharp.Plugin.MetaGLM/Modules/Images.cs @@ -10,7 +10,7 @@ public class Images public Images(string apiKey, string basicAddress = "https://open.bigmodel.cn/api/paas/v4/") { this._apiKey = apiKey; - this._baseAddress = basicAddress; + this._baseAddress = basicAddress.TrimEnd('/'); } private IEnumerable GenerateBase(ImageRequestBase requestBody) diff --git a/src/WebStarter/appsettings.json b/src/WebStarter/appsettings.json index 0db89cbd..91c429c7 100644 --- a/src/WebStarter/appsettings.json +++ b/src/WebStarter/appsettings.json @@ -93,6 +93,17 @@ "CompletionCost": 0.002 } ] + }, + { + "Provider": "metaglm", + "Models": [ + { + "Name": "chatglm3_6b", + "Type": "chat", + "PromptCost": 0.0015, + "CompletionCost": 0.002 + } + ] } ], @@ -219,12 +230,19 @@ "ApiSecret": "", "ModelVersion": "V3_5" }, + "MetaGLM": { + "ApiKey": "6b6c8b3fca3e5da21d633e350980744d.938gruOqrK4BDqW8", + "BaseAddress": "http://localhost:8100/v1/", + "ModelId": "chatglm3_6b", + "Temperature": 0.7, + "TopP": 0.7 + }, "GoogleApi": { "ApiKey": "", "Map": { "Endpoint": "https://maps.googleapis.com/maps/api/geocode/json", - "Components": "country=US|country=CA", + "Components": "country=US|country=CA" }, "Youtube": { "Endpoint": "https://www.googleapis.com/youtube/v3/search", @@ -251,7 +269,8 @@ "BotSharp.Plugin.PizzaBot", "BotSharp.Plugin.WebDriver", "BotSharp.Plugin.LLamaSharp", - "BotSharp.Plugin.SparkDesk" + "BotSharp.Plugin.SparkDesk", + "BotSharp.Plugin.MetaGLM" ] } }