PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
betterdocs / react-src / gutenberg / docs-ai / api.js

api.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/gutenberg/docs-ai/api.js

26 lines 734 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import apiFetch from "@wordpress/api-fetch";
2
3 const config = window.betterdocsDocsAI || {};
4
5 export const i18n = config.i18n || {};
6 export const SUPPORTED_TAXONOMIES = config.taxonomies || [ "doc_category", "doc_tag" ];
7
8 /**
9 * Request AI-suggested taxonomy terms for the current doc.
10 *
11 * @return {Promise<Object>} REST response: { success, data: { taxonomy, suggestions, model } }
12 */
13 export function suggestTerms( { taxonomy, postId, content, title, maxSuggestions } ) {
14 return apiFetch( {
15 url: config.restSuggestTerms,
16 method: "POST",
17 data: {
18 taxonomy,
19 post_id: postId,
20 content,
21 title,
22 max_suggestions: maxSuggestions,
23 },
24 } );
25 }
26