| 开发者 | carmelosantana |
|---|---|
| 更新时间 | 2026年9月30日 20:45 |
| 捐献地址: | 去捐款 |
| PHP版本: | 8.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
alpaca-bot/v1 (docs/api.md) and a WP-CLI command.Alpaca Bot > Settings and, on the Provider tab, enter the endpoint's base URL. For Ollama it ends in /v1: http://localhost:11434/v1.Save Changes. The Models tab then lists what the provider serves; pick a default.Alpaca Bot > Settings. On the Provider tab enter the endpoint's base URL -- for Ollama it ends in /v1, as in http://localhost:11434/v1 -- and save.Yes. Alpaca Bot does not ship a model and sends nothing to a service of ours. Point it at an Ollama instance, or at any OpenAI-compatible endpoint, on the Provider tab. On WordPress 7.0 and later there is a second option: WordPress AI provider routes every turn through the AI client built into core, to whichever AI provider plugin the site has configured under Settings › Connectors. That path does not stream, because the WordPress client does not.
Whatever you type, and the recent messages of the conversation, go to the endpoint you configured, and nothing else. Conversations and usage receipts are rows in your own database. Turn conversation storage off entirely on the Privacy tab; a receipt is still written for every reply, because that is what the monthly caps count, and it never holds message text.
The chat screen is open to anyone who can edit posts, which includes Contributors. Settings › Access changes it, and the alpaca_bot/admin/menu_capability filter overrides that in code. The Settings screen is administrators only, whatever those rows say. Read Tools, and what they let the model reach, under Usage, before you open the chat to a role: a role admitted to chat gets no tools until their rows admit them, and web_fetch is the row to think about first.
Three brakes, and they are independent. Limits sets a monthly token cap for the whole site and another per user, counted from the receipts and enforced on the server. A shared per-minute rate limit (thirty requests a user, moved by the alpaca_bot/rate_limit filter) covers the chat screen, the REST routes, the abilities and the shortcodes together. And Tools decides what the model may do besides answer. Shortcode answers are cached, and never generated for a visitor or for the REST API.
Into one option, moved automatically on the first request after the upgrade. Two things do not survive the move: 0.4's API username and password were sent as HTTP Basic and 0.5 sends a Bearer token instead, so the Provider tab starts with an empty API key for you to fill in. Your 0.4 conversations are kept, and become private to their author, which is what 0.5 enforces everywhere.
Some small models advertise tool support and then write the call out as prose. On the Models tab, set that model's Tools override to off; it beats whatever the provider claims. A model too small to use tools well is usually too small for the tools to be worth it.
There is a price as well as a symptom. web_fetch, summarize and draft_post are on by default, and their schemas go with every turn they are offered on: measured on this plugin with those on, about 790 extra prompt tokens each time, against 36 with tools off. With the abilities tool on, each ability you tick adds its own schema to the turns it is offered on. On a large model that is noise in the bill; on a small one it is most of the prompt, which is why the answer degrades. Turning off the tools you do not use, under Tools, costs nothing and is worth doing before you tune anything else.
summarize). Within one request a turn now overshoots a cap by at most the call that crossed it, where it could run the rest of its tool budget past it (Kanboard #4701).402 alpaca_bot_cap_exceeded, now saying the reply stopped, with data.stopped and data.conversation_id so a client can find the saved reply. alpaca_bot/chat/failed fires for it with the CapExceeded. wp alpaca-bot chat names the conversation it was saved on, in plain output and in --json.alpaca_bot_settings goes through the settings checks. wp option update|set|patch|add alpaca_bot_settings is now cleaned by the schema, clears the API key when the provider address moves, and checks MCP rows and addresses, however the option's name reaches WP-CLI: typed, read by --prompt, or a wp-cli.yml default. A refused row exits non-zero and writes nothing, and so does another spelling the database treats as the same option (Kanboard #4695).wp option update keeps the keys it leaves out, so '{}' no longer resets the settings. wp option patch delete alpaca_bot_settings <key> resets one key, and wp option delete alpaca_bot_settings resets them all (Kanboard #4695).--autoload=off is refused on that option, since the settings row stays autoloaded; --autoload=on is honoured.wp alpaca-bot settings all show no key (Kanboard #4699).bin/test-integration.sh -- --filter X works on a WP Harness site (Kanboard #4697), and the CI step without cURL is named for everything it covers (Kanboard #4698).provider.base_url to another scheme, host or port, on the settings page, over PUT /settings or with WP-CLI, now drops the stored key unless the same save sends a new one, so a key can no longer follow the address to a host it was never meant for. REST names it in an X-Alpaca-Bot-Cleared: provider.api_key response header, the settings page shows a notice and WP-CLI warns (Kanboard #4539).alpaca_bot_provider_key, which is not autoloaded, out of alpaca_bot_settings, which is. An existing key moves on the first request after the upgrade, and uninstalling removes the new option too. Downgrading to 0.6.0 afterwards sends the masked placeholder instead of the key; upgrading again restores it (Kanboard #4384).wp alpaca-bot settings toolkits.mcp_servers refuses a row it cannot keep the way REST does, exiting non-zero, naming the row and writing nothing, where it dropped the row silently (Kanboard #4540).POST /chat and [alpacabot], and logs a filter's error to the debug log (Kanboard #4537, #4694).Toolkit\Registry::enabled() drops every toolkit whose row the user fails before the alpaca_bot/toolkits filter runs. A default site sees no change: web_fetch, summarize and draft_post start at edit_posts, the capability the chat already asked for. A site that opened the chat to a wider role in code keeps the chat for that role and loses the tools until an administrator lowers a tool's row, or code opens it with alpaca_bot/capability/tool/{id}. [alpacabot_agent] fetches through web_fetch, so it asks that row too (Kanboard #4331).alpaca_bot/admin/menu_capability now decides more than the menu. The users it admits also get the chat launcher on most admin screens and the chat sidebar in the block editor. Both load the chat from a new route, GET /view/panel, and the drawer the launcher opens remembers its state through another, POST /view/drawer; the two routes' keys, view/panel and view/drawer, start from the Chat row as the other chat routes do. A site that opened the chat to a role in 0.5 by filtering the menu and the 0.5 route keys one by one shows that role a launcher whose chat answers 403 until it also filters alpaca_bot/capability/view/panel and alpaca_bot/capability/view/drawer, or lowers the Chat row.GET /settings and GET /settings/schema ask alpaca_bot/capability/settings/read, PUT /settings asks alpaca_bot/capability/settings/write, and both start from what the old alpaca_bot/capability/settings returns, so an existing filter keeps working and can now be split. alpaca_bot/capability/settings/schema is no longer applied: the schema route asks …/settings/read with the rest of the read. ?reveal=1 still needs manage_options whatever the filters say. Settings › Access calls these filters, and alpaca_bot/capability/chat, with a request it builds itself, to show whether code has moved a row; that request authorises nothing (Kanboard #4332).429 alpaca_bot_stream_concurrency with data.limit, where it answered alpaca_bot_rate_limited; the per-minute limit keeps the old code. A client that matched the old code for both now tells them apart, and the chat screen shows the refusal as a warning and gives the message back (Kanboard #4333).web_fetch pins the addresses it checked into the connection, and refuses to fetch where it cannot. It looks a name up once, checks every address, and hands them to cURL (the first alone on a libcurl older than 7.59), for the request and for each redirect, which it now follows itself, up to three. On a server whose PHP would send the request without cURL the tool refuses every fetch rather than connect unpinned, and Tools › Site Health says so (Kanboard #4330, #4483).alpaca_bot/toolkits could take a built-in tool's name, web_fetch say, and the model's calls to it. Now the built-ins, which come first, keep their names, and the site's tool of the same name is left out without a notice. A filter that puts its own toolkit first in the array it returns keeps the name for it.Errors and RateLimit left the AlpacaBot\Rest namespace, and are AlpacaBot\Errors and AlpacaBot\RateLimit now. Site code that used them from AlpacaBot\Rest has to move; the REST routes, the hooks and the wire are unchanged.Shortcodes\Chat::CAPABILITY is gone. Who generates a shortcode answer is the Shortcodes row of Settings › Access, edit_posts by default as before, filtered by alpaca_bot/capability/shortcode.tool_result_bytes (on POST /chat, the stream's done frame and alpaca_bot/usage/recorded), each entry of meta.tool_calls carries result_bytes, and every stream delta frame carries held. GET /settings and GET /settings/schema answer eleven more fields (the nine access.* rows, toolkits.abilities and toolkits.mcp_servers), and toolkits.enabled has an abilities option. A PUT /settings that drops a moved MCP server's header value names the server in an X-Alpaca-Bot-Mcp-Cleared response header. A client that validated those shapes strictly will see them.alpaca-bot/chat ability is annotated destructive. Storing a turn does more than add to the conversation: it rewrites the conversation's excerpt, and its title while that is empty or the default, and a transcript past its storage budget drops its oldest images and then its oldest messages. A client of the Abilities API that treats a destructive ability with more care now does so for this one.wp plugin uninstall, removes its settings, conversations, usage receipts, user preferences, transients and cron event, and what 0.4 left behind, on every site of a network. On a persistent object cache the transients named at run time cannot be listed, so they are left to expire; and while another active plugin registers chat_history or chat_log, every post of that type stays, the plugin's own included. Drafts draft_post wrote are ordinary posts and stay. Deactivating keeps all of it (Kanboard #4431).alpaca_bot/admin/menu_capability admits, and are served by two new routes, GET /view/panel and POST /view/drawer.alpaca_bot/capability/tool/web_fetch for the fetch tool's, and the Chat row is filtered by alpaca_bot/admin/menu_capability and each chat route's own filter. An Access help tab says what each row decides.prefix__tool, which may not end in _, hold __ or be ability, and is one server's alone. Each tool is approved one at a time and pinned to a SHA-256 fingerprint of the definition approved, and one the server has since changed is withheld until it is approved again. The header value reads back masked and is kept out of the autoloaded settings. An address is checked when it is saved from the settings page or over REST, and a PUT with a refused address, or with a row it cannot keep, answers 400 alpaca_bot_mcp_address or 400 alpaca_bot_mcp_row and writes nothing; it is checked again each time a connection to the server is built, which also refuses one that is not https or carries a user name or password. The connection goes only to an address that check passed (every one on PHP's cURL where its libcurl reads a list of them, the first otherwise), through no proxy, and follows no redirect. The Tools tab asks a new route, GET /view/mcp-tools/{id}, for a server's tools. Each server has its own Access row, starting at administrators; the alpaca_bot/toolkits filter sees it as mcp.<id>, after the built-in tools; and every call fires alpaca_bot/mcp/called.web_fetch can run pinned on this server.<tool_call>…</tool_call>, no longer flashes the markup through the reply while it streams; the chat shows "Calling a tool…" in its place (Kanboard #4329).web_fetch's default user agent names the installed version, where it named 0.5 whatever was installed. A site that has saved its settings keeps the value it saved, and can empty the field to send the default.alpaca-bot/chat and alpaca-bot/summarize abilities answer 409 alpaca_bot_turn_running, which the model reads as the tool's result, and the turn goes on (Kanboard #4538).AlpacaBot\Agents, AlpacaBot\Api\*, AlpacaBot\Define, AlpacaBot\Help, AlpacaBot\Log\Post and AlpacaBot\Utils\* were deleted, and with them the alpaca_bot_* hooks they applied. What 0.5 fires is in docs/hooks.md, generated from the call sites.alpaca-bot/v1, but 0.4's htmx/* and wp/* fragment endpoints are gone. 0.5 serves /chat, /chat/{id}/stream, /conversations, /conversations/{id}, /models, /settings, /settings/schema, /usage and a /view/* group; docs/api.md is the reference.[alpacabot] no longer reads the shortcode's content as the prompt. 0.4 sent the text between the tags; 0.5 reads a prompt attribute, and with no prompt it renders the chat screen on the page. An enclosing [alpacabot]…[/alpacabot] left over from 0.4 therefore renders a chat screen, not an answer.alpaca_bot/shortcode/allow_guests filter. The REST API and the block editor never generate either, whoever is asking.cache attribute changed, and so did its default. This is the one that costs money. In 0.4 a bare [alpacabot] cached its answer permanently — in the post's meta inside the loop, in an option outside it — so a page generated once and never again. In 0.5 the default is a one-hour transient: the same page regenerates every hour, at the provider's price, the next time a viewer who may generate opens it. Write cache="365d" for the old behaviour, which is the longest 0.5 accepts. The spellings changed with it: 0.4 read postmeta, option, a number of seconds, and 0, disable or false to switch caching off, while 0.5 caches in a transient only, for a duration written as 45s, 30m, 1h or 2d. off is now the only word that disables it, and 0.4's five other spellings — postmeta, option, 0, disable and false — all fall through to that one-hour default.[alpacabot_agent] is deprecated. It still fetches its URL and still asks the model for a summarize, but it logs a deprecation notice and goes away in a later 0.x release. Its fetch is now the web_fetch tool, so it does nothing while that tool is off under Settings › Tools, and it refuses a private, local or non-http(s) address.web_fetch reads one public web page as text under a two-stage address guard, summarize condenses text through the model, and draft_post writes a draft it never publishes. All three are on by default and switchable per site.alpaca-bot/chat, alpaca-bot/summarize and alpaca-bot/draft-post — so other plugins and the MCP adapter can call the same code the screen does.alpaca-bot/v1 covering everything the screen does, and wp alpaca-bot chat|models|usage|settings on the command line.alpaca_bot/rate_limit filter.[alpacabot] for an answer in a page or the chat screen on it, and the [alpacabot_agent] shim above.