Skip to content

Commit 43736fc

Browse files
committed
Add support for AI bridge in bbctl and config
This commit introduces support for the 'ai' bridge across build, configuration, and utility files. It updates bridge lists, repository URLs, and configuration templates to properly recognize and handle the AI bridge.
1 parent 3add69a commit 43736fc

4 files changed

Lines changed: 18 additions & 17 deletions

File tree

api/gitlab/build.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ func getRefFromBridge(bridge string) (string, error) {
7070
case "imessage":
7171
return "master", nil
7272
case "whatsapp", "discord", "slack", "gmessages", "gvoice", "signal",
73-
"imessagego", "meta", "twitter", "bluesky", "linkedin", "telegramgo":
73+
"imessagego", "meta", "twitter", "bluesky", "linkedin", "telegramgo",
74+
"ai":
7475
return "main", nil
7576
default:
7677
return "", fmt.Errorf("unknown bridge %s", bridge)

bridgeconfig/ai.tpl.yaml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
# AI Bridge network configuration
21
network:
3-
# Per-provider default models
2+
beeper:
3+
base_url: {{ .HungryAddress }}
4+
token: {{ .ProvisioningSecret }}
5+
46
providers:
7+
beeper:
8+
default_model: "openai/gpt-5.2"
59
openai:
6-
default_model: "gpt-5-nano"
7-
gemini:
8-
default_model: "gemini-2.0-flash"
9-
anthropic:
10-
default_model: "claude-sonnet-4-5-20250929"
11-
openrouter:
1210
default_model: "openai/gpt-4o-mini"
11+
openrouter:
12+
default_model: "openrouter/openai/gpt-4o-mini"
1313

14-
# Global settings
1514
default_system_prompt: |
16-
You are a helpful AI assistant.
15+
You are a helpful assistant.
1716
model_cache_duration: 6h
1817

1918
bridge:
2019
command_prefix: "!ai"
2120

22-
beeper:
23-
base_url: {{ .HungryAddress }}
24-
token: {{ .ProvisioningSecret }}
25-
2621
{{ setfield . "CommandPrefix" "!ai" -}}
2722
{{ setfield . "DatabaseFileName" "ai" -}}
2823
{{ setfield . "BridgeName" "ai" -}}

cmd/bbctl/bridgeutil.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type bridgeTypeToNames struct {
2121
}
2222

2323
var officialBridges = []bridgeTypeToNames{
24+
{"ai", []string{"ai"}},
2425
{"discord", []string{"discord"}},
2526
{"meta", []string{"meta", "instagram", "facebook"}},
2627
{"googlechat", []string{"googlechat", "gchat"}},
@@ -49,7 +50,7 @@ var websocketBridges = map[string]bool{
4950
"imessagego": true,
5051
"signal": true,
5152
"bridgev2": true,
52-
"beeper-ai": true,
53+
"ai": true,
5354
"meta": true,
5455
"twitter": true,
5556
"bluesky": true,

cmd/bbctl/run.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ func compileGoBridge(ctx context.Context, buildDir, binaryPath, bridgeType strin
134134
repo := fmt.Sprintf("https://github.com/mautrix/%s.git", bridgeType)
135135
if bridgeType == "imessagego" {
136136
repo = "https://github.com/beeper/imessage.git"
137+
} else if bridgeType == "ai" {
138+
repo = "https://github.com/beeper/ai-bridge.git"
137139
}
138140
log.Printf("Cloning [cyan]%s[reset] to [cyan]%s[reset]", repo, buildDir)
139141
err = makeCmd(ctx, buildDirParent, "git", "clone", repo, buildDir).Run()
@@ -309,7 +311,7 @@ func runBridge(ctx *cli.Context) error {
309311
var needsWebsocketProxy bool
310312
switch cfg.BridgeType {
311313
case "imessage", "imessagego", "whatsapp", "discord", "slack", "gmessages", "gvoice",
312-
"signal", "meta", "twitter", "bluesky", "linkedin", "telegram":
314+
"signal", "meta", "twitter", "bluesky", "linkedin", "telegram", "ai":
313315
ciBridgeType := cfg.BridgeType
314316
binaryName := fmt.Sprintf("mautrix-%s", cfg.BridgeType)
315317
ciV2 := false
@@ -319,6 +321,8 @@ func runBridge(ctx *cli.Context) error {
319321
ciBridgeType = "telegramgo"
320322
case "imessagego":
321323
binaryName = "beeper-imessage"
324+
case "ai":
325+
binaryName = "ai"
322326
}
323327
bridgeCmd = filepath.Join(dataDir, "binaries", binaryName)
324328
if localDev && overrideBridgeCmd == "" {

0 commit comments

Comments
 (0)