| 开发者 | idanishrangaiz |
|---|---|
| 更新时间 | 2026年11月14日 02:16 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
search_site, read_page — search and read your public pages and postshandoff — WhatsApp, email and booking buttons with a conversation summarysend_enquiry (Confirm) — emails the visitor's enquiry to youreport_gap — logs questions your site could not answer to the Content Gaps screensearch_products, get_product, compare_products, list_attribute_values, get_shipping_info, get_cart, add_to_cart (Confirm), update_cart_item (Confirm), apply_coupon (Confirm), checkout, track_order[oozzy_ai_agent] and [ozy_agent_ask] shortcodesoozzy_open, oozzy_message, view_item, add_to_cart, begin_checkout, purchase, oozzy_handoffadd_action( 'oozzy_register_tools', function () { OOZZY_Tools::register( [ 'name' => 'calculate_fabric', 'description' => 'Metres of fabric needed for a garment.', 'parameters' => [ 'type' => 'object', 'properties' => [ 'height_cm' => [ 'type' => 'integer' ] ], 'required' => [ 'height_cm' ] ], 'callback' => function ( $args, $ctx ) { return [ 'metres' => 4.5 ]; }, 'confirm' => false, ] ); } );
Filters: oozzy_tools, oozzy_system_prompt, oozzy_messages, oozzy_tool_result, oozzy_response, oozzy_client_ip, oozzy_product_fields, oozzy_product_card, oozzy_product_search_handler, oozzy_order_lookup_allowed, oozzy_find_order, oozzy_order_view, oozzy_phone_normalize, oozzy_inchat_gateways, oozzy_currency_markers, oozzy_page_content, oozzy_context_chars, oozzy_time_budget, oozzy_front_config.
Actions: oozzy_register_tools, oozzy_tool_called, oozzy_action_confirmed, oozzy_conversation_ended, oozzy_gap_logged, oozzy_lead_captured, oozzy_handoff.
JavaScript: window.OzyAgent.open( { prompt, context: { productId } } ), OzyAgent.send( text ), OzyAgent.close(). Window events: oozzy:open, oozzy:message, oozzy:card_click, oozzy:action_confirmed, oozzy:handoff.
API keys can be set in wp-config.php instead of the database: OOZZY_GROQ_KEY, OOZZY_GEMINI_KEY, OOZZY_MISTRAL_KEY, OOZZY_OPENAI_KEY, OOZZY_CLAUDE_KEY.
POST /wp-json/oozzy/v1/chat with "stream": true answers as text/event-stream: status events while tools run, delta text as the model writes, reset when a fallback provider takes over, then one done event carrying the full response.
Tests: composer install, bin/install-wp-tests.sh <db> <user> <pass>, then vendor/bin/phpunit.
If OZY Smart Search is active, product search uses its ozy_smart_search_query() engine automatically.
Shortcodes
[oozzy_ai_agent] — inline chat panel
[oozzy_ai_agent mode="button" label="Chat with us"] — button that opens the popup
[oozzy_ai_agent mode="loader"] — load the floating widget on this page only
[ozy_agent_ask product="current" label="Ask AI about this product"] — opens the chat about a product
ozy-chat-assistant folder to /wp-content/plugins/No. Tools that change anything return a Confirm button. Nothing happens until the visitor taps it, and the change itself is made by WooCommerce's Store API in the visitor's own browser session.
No. It declines requests such as writing code, homework or general knowledge questions and brings the conversation back to your business.
Prices, stock, coupons and delivery times must come from tool results. The price guard checks every reply and removes amounts no tool returned.
Yes. The page HTML contains no nonce; the widget asks for a fresh one when it opens.
Yes. Service sites get enquiries and bookings, blogs get a guide to their content. Choose or confirm the site type under Tools & Store.
Turn on Place orders inside the chat under Tools & Store. Payment methods that need no redirect (Cash on delivery, Bank transfer, Cheque) are offered in the chat; for any other method the visitor is sent to your checkout page.
Every configured provider failed. The exact reason is shown to administrators on the WordPress dashboard and on the plugin screens. Use Test connection on the AI Provider screen.
Yes. The slug and folder stay ozy-chat-assistant, so updates arrive normally and settings carry over.
No. One working key is enough; others are used as fallbacks. For tool use, Groq (openai/gpt-oss-120b), Gemini Flash, GPT-4o mini and Claude Haiku all work well. On WordPress 7 you can also use a connector from Settings → Connectors instead of a key.
Some hosts, proxies or caching layers buffer responses. The chat still works; the reply simply arrives in one piece. You can turn streaming off under AI Provider.
openai/gpt-oss-120b (Groq) and gemini-flash-latest (Gemini); sites still set to a retired default are moved automatically.oozzy_time_budget).oozzy/v1) with a cache-safe session, signed actions and a real client IP option for sites behind Cloudflare/proxies.window.OzyAgent JS API and events; GA4/GTM events.[ozy_agent_ask] shortcode.ozy-chat-assistant, so this is a normal update and all settings are preserved.mode, height, title, label and quick attributes on the [oozzy_ai_agent] shortcode.ozy-chat-assistant; the text domain now matches the slug.ozy/OZY_ code prefixes with the unique oozzy/OOZZY_ prefix on functions, classes, options, transients, nonces, AJAX actions, and the shortcode (now [oozzy_ai_agent]).wp_remote_post()) exclusively; removed all direct cURL calls.load_plugin_textdomain() call — WordPress.org loads translations automatically since WP 4.6.<style> tag output with wp_add_inline_style() for the accent color CSS variables, as required by WordPress.org guidelines.idanishrangaiz.languages/ directory (with a ozy-chat-assistant.pot translation template) so the Domain Path: /languages header in the plugin file now resolves to an existing folder.standalone/ folder (Vercel/Node.js demo code unrelated to the WordPress plugin).class-ozy-api.php explaining why cURL is used in the SSE streaming path (WP HTTP API does not support response streaming).