內容簡介
Vachr Web Search Connector for DeepSeek 將 WordPress 連接至 DeepSeek 的 Anthropic 兼容消息 API,能夠透過 DeepSeek 的搜尋工具進行實際的網頁搜尋,並利用結果回答問題。此外掛提供訪客聊天功能、受保護的伺服器端 REST API,以及 PHP 幫助器,確保 API 金鑰不會暴露給訪客或外部應用程式。
【主要功能】
• 提供 [deepseek_chat] 短碼以啟用訪客聊天功能
• 增加受保護的 POST /wp-json/ai-deepseek/v1/chat 端點
• 提供 ai_deepseek_connector_websearch_query() 供其他外掛和佈景主題使用
• 使用 WordPress AI Client 進行聊天和網頁搜尋
• 支援禁用特定請求的網頁搜尋功能
• 返回生成的文本和來源連結
外掛標籤
開發者團隊
② 後台搜尋「Vachr Web Search Connector for DeepSeek」→ 直接安裝(推薦)
原文外掛簡介
Vachr Web Search Connector for DeepSeek connects WordPress to DeepSeek’s Anthropic-compatible Messages API. It can perform real web searches through DeepSeek’s hosted search tool, then use the results to answer questions. Web Search is enabled by default and can be disabled for an individual request. The plugin also provides an optional visitor chat, a protected server-side REST API, and a PHP helper for other plugins and themes. Your DeepSeek API key stays on the WordPress server and is never exposed to visitors or external applications.
All requests use the WordPress AI Client and the centrally configured DeepSeek connector. When Web Search is enabled, the DeepSeek provider adapter sends the provider-specific server-tool request through the AI Client’s authenticated transport.
What it does
Adds the [deepseek_chat] shortcode for an optional visitor chat.
Adds a protected POST /wp-json/ai-deepseek/v1/chat endpoint for external applications.
Provides ai_deepseek_connector_websearch_query() for other plugins and themes on the same site.
Uses the WordPress AI Client for chat and provider-hosted Web Search, with one key managed in Settings > Connectors.
Pass web_search: false to disable provider-hosted Web Search for one request.
Returns generated text, provider-returned source links when available, and token-usage data.
Registers DeepSeek in the native Connectors screen.
How Web Search works
Web Search is performed by DeepSeek’s server-side tool, not by WordPress and not by a crawler included in this plugin. It is enabled by default for the visitor chat, REST API, and PHP helper.
To disable it for one request, set web_search: false in a REST request, clear the chat checkbox, or pass false as the third PHP-helper argument.
Chat and search use the same DeepSeek API key from Settings > Connectors; the AI Client supplies the key to the provider adapter without the plugin reading it. DeepSeek may send the question to its search infrastructure and can make an additional model request to turn tool results into a final response. This can increase latency and API cost. Source links are returned only when the provider includes them.
External service and privacy
This plugin sends the following data to DeepSeek through the WordPress AI Client: the question, selected model, system instructions, and whether Web Search was requested. Web Search can cause DeepSeek to process the question through its search service. The DeepSeek API key is sent only from the WordPress server to DeepSeek; it is never exposed to visitors or REST clients.
The plugin does not store questions, responses, source links, or conversations in the WordPress database. It does not use analytics or tracking.
If the site owner explicitly enables the WordPress AI feature AI Request Logging, requests made through this connector are added to its central AI Request Logs screen. That feature can retain request and response previews, model, token usage, duration, and errors according to its own settings. No connector request is added there while the feature is disabled.
Before enabling public chat, inform visitors about the data transfer and establish a lawful basis appropriate to your jurisdiction. Do not submit sensitive personal data. Review the DeepSeek Privacy Policy and applicable DeepSeek terms.
Security
The external REST endpoint requires an integration bearer token, generated on activation and visible only to WordPress administrators. Treat it as a password and replace it immediately if it may have been exposed. Browser chat requests use a WordPress REST nonce, and public chat is disabled by default. Public browser requests are limited to 12 per five minutes per IP address.
Developer usage
REST API
Send a JSON request to your own WordPress site. Never place the integration token in browser JavaScript.
POST https://your-site.example/wp-json/ai-deepseek/v1/chat
Headers:
Authorization: Bearer YOUR_INTEGRATION_TOKEN
Content-Type: application/json
Example request:
curl -X POST https://your-site.example/wp-json/ai-deepseek/v1/chat -H "Authorization: Bearer YOUR_INTEGRATION_TOKEN" -H "Content-Type: application/json" -d '{"message":"What changed in WordPress this week?","web_search":true}'
Request fields:
message (string, required): question, up to 12,000 characters.
web_search (boolean, optional): use DeepSeek’s web-search tool; defaults to true. Set it to false to use standard text generation instead.
Successful response fields:
text (string): generated final answer.
sources (array): links returned by DeepSeek, when available.
usage (object): provider token-usage object.
Errors use normal WordPress REST error objects and appropriate HTTP status codes, including 400 for invalid messages, 403 for authentication or disabled chat, 429 for the public-chat rate limit, and 502 for upstream failures.
PHP API
Other code running on the same WordPress site can call:
$result = ai_deepseek_connector_websearch_query( 'What is the latest WordPress release?', 'deepseek-flash' );
Supported model IDs are deepseek-flash and deepseek-v4-pro. For compatibility, the aliases deepseek-v4-flash and deepseek-v4.1-flash are normalized to deepseek-flash. Web Search is enabled by default. Pass false as the third argument to disable it: $result = ai_deepseek_connector_websearch_query( 'Summarize this text', 'deepseek-flash', false );. The helper returns the same text, sources, and usage array as the REST endpoint, or a WP_Error. Check errors before accessing the response:
if ( is_wp_error( $result ) ) { /* handle $result->get_error_message() */ }
