From 92a19215add7f094abe62f31cefd30c31ba2f9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?batuhan=20i=C3=A7=C3=B6z?= Date: Fri, 29 May 2026 13:39:07 +0200 Subject: [PATCH 1/3] add ai bridge --- README.md | 2 ++ bridgeconfig/ai.tpl.yaml | 24 ++++++++++++++++++++++++ cmd/bbctl/bridgeutil.go | 2 ++ cmd/bbctl/config.go | 6 ++++++ 4 files changed, 34 insertions(+) create mode 100644 bridgeconfig/ai.tpl.yaml diff --git a/README.md b/README.md index 8db3c1c..09f228e 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ used with the `--type` flag. | [beeper-imessage] | imessagego | | [mautrix-linkedin] | linkedin | | [heisenbridge] | heisenbridge, irc | +| [ai] | ai, aichats, openai | [mautrix-telegram]: https://github.com/mautrix/telegram [mautrix-whatsapp]: https://github.com/mautrix/whatsapp @@ -118,6 +119,7 @@ used with the `--type` flag. [beeper-imessage]: https://github.com/beeper/imessage [mautrix-linkedin]: https://github.com/mautrix/linkedin [heisenbridge]: https://github.com/hifi/heisenbridge +[ai]: https://github.com/beeper/ai-bridge ### 3rd party bridgev2-based bridges If you have a 3rd party bridge that's built on top of mautrix-go's bridgev2 diff --git a/bridgeconfig/ai.tpl.yaml b/bridgeconfig/ai.tpl.yaml new file mode 100644 index 0000000..7ec7ea1 --- /dev/null +++ b/bridgeconfig/ai.tpl.yaml @@ -0,0 +1,24 @@ +# Network-specific config options +network: + default_provider: + provider: openai + api: openai-responses + default_model: gpt-5.5 + allowed_models: [] + providers: {} + default_system_prompt: You are a helpful assistant inside Beeper. + default_reasoning_level: "off" + fetch: + timeout_ms: 10000 + max_bytes: 2097152 + max_chars: 20000 + search: + enabled: false + endpoint: "" + api_key: "" + +{{ setfield . "CommandPrefix" "!ai" -}} +{{ setfield . "DatabaseFileName" "ai" -}} +{{ setfield . "BridgeTypeName" "AI Chats" -}} +{{ setfield . "BridgeTypeIcon" "mxc://beeper.com/51a668657dd9e0132cc823ad9402c6c2d0fc3321" -}} +{{ template "bridgev2.tpl.yaml" . }} diff --git a/cmd/bbctl/bridgeutil.go b/cmd/bbctl/bridgeutil.go index 4a7eaf8..2ca44f0 100644 --- a/cmd/bbctl/bridgeutil.go +++ b/cmd/bbctl/bridgeutil.go @@ -21,6 +21,7 @@ type bridgeTypeToNames struct { } var officialBridges = []bridgeTypeToNames{ + {"ai", []string{"ai", "aichats", "openai"}}, {"discord", []string{"discord"}}, {"meta", []string{"meta", "instagram", "facebook"}}, {"googlechat", []string{"googlechat", "gchat"}}, @@ -54,6 +55,7 @@ var websocketBridges = map[string]bool{ "bluesky": true, "linkedin": true, "telegram": true, + "ai": true, } func doOutputFile(ctx *cli.Context, name, data string) error { diff --git a/cmd/bbctl/config.go b/cmd/bbctl/config.go index 0620b26..afac578 100644 --- a/cmd/bbctl/config.go +++ b/cmd/bbctl/config.go @@ -207,6 +207,7 @@ type generatedBridgeConfig struct { // These should match the last 2 digits of https://mau.fi/ports var bridgeIPSuffix = map[string]string{ + "ai": "44", "telegram": "17", "whatsapp": "18", "meta": "19", @@ -352,6 +353,11 @@ func generateBridgeConfig(ctx *cli.Context) error { startupCommand += " -c " + outputPath } installInstructions = fmt.Sprintf("https://docs.mau.fi/bridges/go/setup.html?bridge=%s#installation", cfg.BridgeType) + case "ai": + startupCommand = "ai" + if outputPath != "config.yaml" && outputPath != "" { + startupCommand += " -c " + outputPath + } case "imessagego": startupCommand = "beeper-imessage" if outputPath != "config.yaml" && outputPath != "" { From 006a110ae00b00e315bd27789701894c088d4a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?batuhan=20i=C3=A7=C3=B6z?= Date: Fri, 29 May 2026 13:44:32 +0200 Subject: [PATCH 2/3] Update ai.tpl.yaml --- bridgeconfig/ai.tpl.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/bridgeconfig/ai.tpl.yaml b/bridgeconfig/ai.tpl.yaml index 7ec7ea1..55fde8d 100644 --- a/bridgeconfig/ai.tpl.yaml +++ b/bridgeconfig/ai.tpl.yaml @@ -21,4 +21,5 @@ network: {{ setfield . "DatabaseFileName" "ai" -}} {{ setfield . "BridgeTypeName" "AI Chats" -}} {{ setfield . "BridgeTypeIcon" "mxc://beeper.com/51a668657dd9e0132cc823ad9402c6c2d0fc3321" -}} +{{ setfield . "DefaultPickleKey" "mautrix.bridge.e2ee" -}} {{ template "bridgev2.tpl.yaml" . }} From 9a124e6bb3e996bce64e7d4b3a272bcaf5dac32d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?batuhan=20i=C3=A7=C3=B6z?= Date: Sun, 31 May 2026 02:22:08 +0200 Subject: [PATCH 3/3] Update ai.tpl.yaml --- bridgeconfig/ai.tpl.yaml | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/bridgeconfig/ai.tpl.yaml b/bridgeconfig/ai.tpl.yaml index 55fde8d..d3b0a87 100644 --- a/bridgeconfig/ai.tpl.yaml +++ b/bridgeconfig/ai.tpl.yaml @@ -1,21 +1,22 @@ -# Network-specific config options -network: - default_provider: - provider: openai - api: openai-responses - default_model: gpt-5.5 - allowed_models: [] - providers: {} - default_system_prompt: You are a helpful assistant inside Beeper. - default_reasoning_level: "off" - fetch: - timeout_ms: 10000 - max_bytes: 2097152 - max_chars: 20000 - search: - enabled: false - endpoint: "" - api_key: "" +# Network-specific config options. +# +# ai-bridge owns the defaults for this section. Keep these commented unless +# this generated config intentionally needs to override bridge defaults. +# +# Supported override fields: +# +# network: +# default_system_prompt: | +# Custom system prompt. +# default_reasoning_level: "off" +# fetch: +# timeout_ms: 10000 +# max_bytes: 2097152 +# max_chars: 20000 +# compaction: +# enabled: true +# reserve_tokens: 16384 +# keep_recent_tokens: 20000 {{ setfield . "CommandPrefix" "!ai" -}} {{ setfield . "DatabaseFileName" "ai" -}}