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..d3b0a87 --- /dev/null +++ b/bridgeconfig/ai.tpl.yaml @@ -0,0 +1,26 @@ +# 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" -}} +{{ setfield . "BridgeTypeName" "AI Chats" -}} +{{ setfield . "BridgeTypeIcon" "mxc://beeper.com/51a668657dd9e0132cc823ad9402c6c2d0fc3321" -}} +{{ setfield . "DefaultPickleKey" "mautrix.bridge.e2ee" -}} +{{ 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 != "" {