Files
plugins/packages/bub/README.md
T
GabiandGabyran 51f179057b agent-bub 0.1.0: Bub as a magpie agent plugin (#81)
Adds packages/bub: Bub (bub.build) as a magpie agent plugin. It writes
~/.bub/config.yml with the model as magpie:<provider>/<model> and a
providers.magpie entry (type openai, magpie's /v1, Bub's own key), and
puts the file back when one of Bub's own models is picked or it is turned
off. Needs Bub 0.5.1 or later (bubbuild/bub#343). Plus its row in the
README's Agents table, which is now in alphabetical order.

Reviewed at 4b879fb (2026-10-11), with a real Bub 0.5.1 run against a
sandbox magpie. Since then only merges of main; the PR's own diff from the
merge base is the five files above, packages/bub unchanged since 4b879fb.
It waited only for a first npm publish, which the repo no longer requires
(README: a new plugin merges once its review is done; served from dist).

Run on mote at the merged tree (origin/main 202ec68 + head 13058fe92),
Bun 1.4.2: bun test packages/bub 7 pass; bun scripts/check.mjs all ok;
whole bun test with a temp HOME and TMPDIR 2949 pass, 8 skip, 0 fail.

Co-authored-by: Gabyran <Gabyran@users.noreply.github.com>
2026-10-28 12:31:02 +08:00

84 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# @magpie-community/agent-bub
(中文说明在下面。)
[Bub](https://bub.build) as a magpie agent. magpie has no setup of its own for
Bub; with this plugin it is on magpie's Agents page like the agents magpie
ships with.
```sh
magpie plugin add @magpie-community/agent-bub
```
Then pick one of magpie's models in Bub's row. magpie writes into
`~/.bub/config.yml`:
```yaml
model: magpie:deepseek/deepseek-flash # magpie's model, through the provider below
providers:
magpie:
type: openai
api_base: http://127.0.0.1:3425/v1
api_key: magpie-bub # Bub's own key, so Usage names it
```
Your comments, `fallback_models` and your own providers stay. Picking one of
Bub's own models again, `magpie bub default`, or switching it off puts every
key back as it was (a file that had no `providers:` is left with
`providers: {}`, which Bub reads). Restart `bub gateway` and open `bub chat`
sessions after a change: Bub reads its settings when it starts.
## The Bub it needs
Bub 0.5.1 or later: from 0.5.1 Bub takes named providers under `providers:`
([bubbuild/bub#343](https://github.com/bubbuild/bub/pull/343)). 0.5.0 and
older don't. To update:
```sh
uv tool install --reinstall bub # installed with pip: pip install -U bub
```
An older Bub fails every turn on a `magpie:` model, before any request
goes out: `'magpie' is not a supported provider`. If you see that, update Bub,
or pick one of Bub's own models in the row (or run `magpie bub default`) to put
the file back.
How agent plugins work: [usemagpie.ai/docs/plugins#agents](https://usemagpie.ai/docs/plugins#agents).
---
## 中文
[Bub](https://bub.build) 作为 magpie 的 Agent。magpie 没有内置 Bub 的接入;装上这个插件后,Bub 就和 magpie 自带的 Agent 一样出现在 Agent 页。
```sh
magpie plugin add @magpie-community/agent-bub
```
然后在 Bub 那一行选一个 magpie 的模型。magpie 会改写 `~/.bub/config.yml`:
```yaml
model: magpie:deepseek/deepseek-flash # magpie 的模型,经下面这个 provider 访问
providers:
magpie:
type: openai
api_base: http://127.0.0.1:3425/v1
api_key: magpie-bub # Bub 自己的 key,用量里能认出它
```
你的注释、`fallback_models` 和自己的 provider 都会保留。再选回 Bub 自己的模型、运行 `magpie bub default`,或者关掉开关,每个键都恢复原样(原来没有 `providers:` 的文件会留下 `providers: {}`,Bub 能正常读)。改完要重启 `bub gateway`,并重新打开 `bub chat` 会话:Bub 在启动时才读设置。
## 需要的 Bub 版本
需要 Bub 0.5.1 或更新版本:从 0.5.1 起,Bub 支持在 `providers:` 下写具名 provider
([bubbuild/bub#343](https://github.com/bubbuild/bub/pull/343))。0.5.0 及更早的版本没有。更新:
```sh
uv tool install --reinstall bub # 用 pip 装的:pip install -U bub
```
更早的 Bub 遇到 `magpie:` 模型,每一轮都会在请求发出之前失败:
`'magpie' is not a supported provider`。看到这个报错,就更新 Bub;或者在这一行选回 Bub 自己的模型(或运行 `magpie bub default`),把文件恢复。
Agent 插件怎么工作:[usemagpie.ai/docs/zh/plugins#agents](https://usemagpie.ai/docs/zh/plugins#agents)。