Skip to content

Commit

Permalink
Remove experimental LLM backend (#298)
Browse files Browse the repository at this point in the history
* Remove experimental LLM backend

* Fix
  • Loading branch information
crspeller authored Feb 17, 2025
1 parent 00e0c95 commit ab826dc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 376 deletions.
116 changes: 0 additions & 116 deletions server/asksage/asksage.go

This file was deleted.

186 changes: 0 additions & 186 deletions server/asksage/client.go

This file was deleted.

3 changes: 0 additions & 3 deletions server/llm/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const (
ServiceTypeOpenAI = "openai"
ServiceTypeOpenAICompatible = "openaicompatible"
ServiceTypeAzure = "azure"
ServiceTypeAskSage = "asksage"
ServiceTypeAnthropic = "anthropic"
)

Expand Down Expand Up @@ -88,8 +87,6 @@ func (c *BotConfig) IsValid() bool {
return c.Service.APIKey != "" && c.Service.APIURL != ""
case ServiceTypeAnthropic:
return c.Service.APIKey != ""
case ServiceTypeAskSage:
return c.Service.Username != "" && c.Service.Password != ""
default:
return false
}
Expand Down
42 changes: 0 additions & 42 deletions server/llm/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,48 +263,6 @@ func TestBotConfig_IsValid(t *testing.T) {
},
want: true,
},
{
name: "Ask Sage service requires username to be set",
fields: fields{
ID: "xxx",
Name: "xxx",
DisplayName: "xxx",
CustomInstructions: "",
Service: ServiceConfig{
Name: "Copilot",
Type: "asksage",
Username: "", // bad
Password: "topsecret",
DefaultModel: "xxx",
InputTokenLimit: 100,
StreamingTimeoutSeconds: 60,
},
ChannelAccessLevel: ChannelAccessLevelAll,
UserAccessLevel: UserAccessLevelAll,
},
want: false,
},
{
name: "Ask Sage service requires password to be set",
fields: fields{
ID: "xxx",
Name: "xxx",
DisplayName: "xxx",
CustomInstructions: "",
Service: ServiceConfig{
Name: "Copilot",
Type: "asksage",
Username: "myuser",
Password: "", // bad
DefaultModel: "xxx",
InputTokenLimit: 100,
StreamingTimeoutSeconds: 60,
},
ChannelAccessLevel: ChannelAccessLevelAll,
UserAccessLevel: UserAccessLevelAll,
},
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
3 changes: 0 additions & 3 deletions server/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
sq "github.com/Masterminds/squirrel"
"github.com/jmoiron/sqlx"
"github.com/mattermost/mattermost-plugin-ai/server/anthropic"
"github.com/mattermost/mattermost-plugin-ai/server/asksage"
"github.com/mattermost/mattermost-plugin-ai/server/enterprise"
"github.com/mattermost/mattermost-plugin-ai/server/llm"
"github.com/mattermost/mattermost-plugin-ai/server/metrics"
Expand Down Expand Up @@ -147,8 +146,6 @@ func (p *Plugin) getLLM(llmBotConfig llm.BotConfig) llm.LanguageModel {
result = openai.NewAzure(llmBotConfig.Service, p.llmUpstreamHTTPClient, llmMetrics)
case llm.ServiceTypeAnthropic:
result = anthropic.New(llmBotConfig.Service, p.llmUpstreamHTTPClient, llmMetrics)
case llm.ServiceTypeAskSage:
result = asksage.New(llmBotConfig.Service, p.llmUpstreamHTTPClient, llmMetrics)
}

cfg := p.getConfiguration()
Expand Down
Loading

0 comments on commit ab826dc

Please sign in to comment.