@ai-stack/payloadcms 3.68.0 → 3.76.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/core/media/image/generateImage.js +2 -6
- package/dist/ai/core/media/image/generateImage.js.map +1 -1
- package/dist/ai/core/media/image/handlers/multimodal.js +5 -0
- package/dist/ai/core/media/image/handlers/multimodal.js.map +1 -1
- package/dist/ai/core/streamObject.js +3 -3
- package/dist/ai/core/streamObject.js.map +1 -1
- package/dist/ai/core/types.d.ts +3 -0
- package/dist/ai/core/types.js.map +1 -1
- package/dist/ai/prompts.d.ts +1 -2
- package/dist/ai/prompts.js +0 -110
- package/dist/ai/prompts.js.map +1 -1
- package/dist/ai/providers/blocks/anthropic.js +2 -1
- package/dist/ai/providers/blocks/anthropic.js.map +1 -1
- package/dist/ai/providers/blocks/elevenlabs.js +3 -2
- package/dist/ai/providers/blocks/elevenlabs.js.map +1 -1
- package/dist/ai/providers/blocks/fal.js +2 -1
- package/dist/ai/providers/blocks/fal.js.map +1 -1
- package/dist/ai/providers/blocks/google.js +11 -6
- package/dist/ai/providers/blocks/google.js.map +1 -1
- package/dist/ai/providers/blocks/openai-compatible.js +2 -1
- package/dist/ai/providers/blocks/openai-compatible.js.map +1 -1
- package/dist/ai/providers/blocks/openai.js +3 -2
- package/dist/ai/providers/blocks/openai.js.map +1 -1
- package/dist/ai/providers/blocks/xai.js +2 -1
- package/dist/ai/providers/blocks/xai.js.map +1 -1
- package/dist/ai/providers/icons.d.ts +7 -0
- package/dist/ai/providers/icons.js +9 -0
- package/dist/ai/providers/icons.js.map +1 -0
- package/dist/ai/providers/registry.js +34 -24
- package/dist/ai/providers/registry.js.map +1 -1
- package/dist/ai/utils/filterEditorSchemaByNodes.d.ts +9 -0
- package/dist/ai/utils/filterEditorSchemaByNodes.js +30 -3
- package/dist/ai/utils/filterEditorSchemaByNodes.js.map +1 -1
- package/dist/ai/utils/nodeToSchemaMap.d.ts +22 -0
- package/dist/ai/utils/nodeToSchemaMap.js +72 -0
- package/dist/ai/utils/nodeToSchemaMap.js.map +1 -0
- package/dist/collections/AIJobs.js +1 -1
- package/dist/collections/AIJobs.js.map +1 -1
- package/dist/collections/AISettings.js +47 -20
- package/dist/collections/AISettings.js.map +1 -1
- package/dist/collections/Instructions.js +37 -0
- package/dist/collections/Instructions.js.map +1 -1
- package/dist/defaults.d.ts +1 -0
- package/dist/defaults.js +8 -0
- package/dist/defaults.js.map +1 -1
- package/dist/endpoints/chat.d.ts +4 -0
- package/dist/endpoints/fetchFields.js +10 -0
- package/dist/endpoints/fetchFields.js.map +1 -1
- package/dist/endpoints/fetchVoices.js +41 -24
- package/dist/endpoints/fetchVoices.js.map +1 -1
- package/dist/endpoints/index.js +194 -16
- package/dist/endpoints/index.js.map +1 -1
- package/dist/exports/fields.d.ts +1 -0
- package/dist/exports/fields.js +1 -0
- package/dist/exports/fields.js.map +1 -1
- package/dist/fields/ArrayComposeField/ArrayComposeField.d.ts +15 -0
- package/dist/fields/ArrayComposeField/ArrayComposeField.js +87 -0
- package/dist/fields/ArrayComposeField/ArrayComposeField.js.map +1 -0
- package/dist/fields/ArrayComposeField/ArrayComposeField.jsx +73 -0
- package/dist/fields/PromptEditorField/PromptEditorField.js +7 -2
- package/dist/fields/PromptEditorField/PromptEditorField.js.map +1 -1
- package/dist/fields/PromptEditorField/PromptEditorField.jsx +5 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/payload-ai.d.ts +152 -0
- package/dist/plugin.js +16 -32
- package/dist/plugin.js.map +1 -1
- package/dist/providers/InstructionsProvider/InstructionsProvider.js +47 -15
- package/dist/providers/InstructionsProvider/InstructionsProvider.js.map +1 -1
- package/dist/providers/InstructionsProvider/InstructionsProvider.jsx +39 -16
- package/dist/providers/InstructionsProvider/context.d.ts +3 -0
- package/dist/providers/InstructionsProvider/context.js +2 -0
- package/dist/providers/InstructionsProvider/context.js.map +1 -1
- package/dist/providers/InstructionsProvider/useInstructions.js +21 -2
- package/dist/providers/InstructionsProvider/useInstructions.js.map +1 -1
- package/dist/styles.d.ts +11 -0
- package/dist/types/handlebars-async-helpers.d.ts +1 -0
- package/dist/types/handlebars-dist-handlebars.d.ts +1 -0
- package/dist/types/react-mentions.d.ts +1 -0
- package/dist/types.d.ts +34 -5
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/dist/ui/AIConfigDashboard/index.js +198 -22
- package/dist/ui/AIConfigDashboard/index.js.map +1 -1
- package/dist/ui/AIConfigDashboard/index.jsx +159 -13
- package/dist/ui/Compose/Compose.d.ts +1 -0
- package/dist/ui/Compose/Compose.js +23 -4
- package/dist/ui/Compose/Compose.js.map +1 -1
- package/dist/ui/Compose/Compose.jsx +23 -4
- package/dist/ui/Compose/UndoRedoActions.d.ts +2 -2
- package/dist/ui/Compose/UndoRedoActions.js +8 -5
- package/dist/ui/Compose/UndoRedoActions.js.map +1 -1
- package/dist/ui/Compose/UndoRedoActions.jsx +6 -5
- package/dist/ui/Compose/compose.module.css +56 -16
- package/dist/ui/Compose/hooks/menu/itemsMap.js +12 -6
- package/dist/ui/Compose/hooks/menu/itemsMap.js.map +1 -1
- package/dist/ui/Compose/hooks/menu/useMenu.js +26 -15
- package/dist/ui/Compose/hooks/menu/useMenu.js.map +1 -1
- package/dist/ui/Compose/hooks/menu/useMenu.jsx +25 -12
- package/dist/ui/Compose/hooks/useGenerate.js +26 -174
- package/dist/ui/Compose/hooks/useGenerate.js.map +1 -1
- package/dist/ui/Compose/hooks/useGenerateUpload.d.ts +11 -0
- package/dist/ui/Compose/hooks/useGenerateUpload.js +150 -0
- package/dist/ui/Compose/hooks/useGenerateUpload.js.map +1 -0
- package/dist/ui/Compose/hooks/useHistory.d.ts +0 -1
- package/dist/ui/Compose/hooks/useHistory.js +65 -25
- package/dist/ui/Compose/hooks/useHistory.js.map +1 -1
- package/dist/ui/Compose/hooks/useStreamingUpdate.d.ts +8 -0
- package/dist/ui/Compose/hooks/useStreamingUpdate.js +48 -0
- package/dist/ui/Compose/hooks/useStreamingUpdate.js.map +1 -0
- package/dist/ui/DynamicVoiceSelect/index.js +63 -11
- package/dist/ui/DynamicVoiceSelect/index.js.map +1 -1
- package/dist/ui/DynamicVoiceSelect/index.jsx +47 -14
- package/dist/ui/EncryptedTextField/index.js +4 -4
- package/dist/ui/EncryptedTextField/index.js.map +1 -1
- package/dist/ui/EncryptedTextField/index.jsx +4 -4
- package/dist/ui/VoicesFetcher/index.js +34 -16
- package/dist/ui/VoicesFetcher/index.js.map +1 -1
- package/dist/ui/VoicesFetcher/index.jsx +32 -15
- package/dist/utilities/buildSmartPrompt.d.ts +22 -0
- package/dist/utilities/buildSmartPrompt.js +141 -0
- package/dist/utilities/buildSmartPrompt.js.map +1 -0
- package/dist/utilities/encryption.js +2 -1
- package/dist/utilities/encryption.js.map +1 -1
- package/dist/utilities/fieldToJsonSchema.js +32 -3
- package/dist/utilities/fieldToJsonSchema.js.map +1 -1
- package/dist/utilities/resolveImageReferences.d.ts +3 -1
- package/dist/utilities/resolveImageReferences.js +21 -2
- package/dist/utilities/resolveImageReferences.js.map +1 -1
- package/dist/utilities/seedProperties.d.ts +7 -0
- package/dist/utilities/seedProperties.js +100 -0
- package/dist/utilities/seedProperties.js.map +1 -0
- package/dist/utilities/setSafeLexicalState.js +79 -6
- package/dist/utilities/setSafeLexicalState.js.map +1 -1
- package/dist/utilities/updateFieldsConfig.d.ts +1 -1
- package/dist/utilities/updateFieldsConfig.js +8 -1
- package/dist/utilities/updateFieldsConfig.js.map +1 -1
- package/package.json +35 -33
- package/dist/endpoints/chat.d.js +0 -3
- package/dist/endpoints/chat.d.js.map +0 -1
- package/dist/init.d.ts +0 -7
- package/dist/init.js +0 -135
- package/dist/init.js.map +0 -1
- package/dist/payload-ai.d.js +0 -3
- package/dist/payload-ai.d.js.map +0 -1
- package/dist/styles.d.js +0 -2
- package/dist/styles.d.js.map +0 -1
- package/dist/types/handlebars-async-helpers.d.js +0 -2
- package/dist/types/handlebars-async-helpers.d.js.map +0 -1
- package/dist/types/handlebars-dist-handlebars.d.js +0 -2
- package/dist/types/handlebars-dist-handlebars.d.js.map +0 -1
- package/dist/types/react-mentions.d.js +0 -2
- package/dist/types/react-mentions.d.js.map +0 -1
|
@@ -6,7 +6,6 @@ import { generateStandardImage } from './handlers/standard.js';
|
|
|
6
6
|
* Routes to appropriate handler based on model capabilities
|
|
7
7
|
*/ export async function generateImage(args) {
|
|
8
8
|
const { model: modelId, payload, provider } = args;
|
|
9
|
-
console.log('args: ', args.images);
|
|
10
9
|
// Get provider registry and model configuration
|
|
11
10
|
const registry = await getProviderRegistry(payload);
|
|
12
11
|
const providerConfig = registry[provider || ''];
|
|
@@ -15,7 +14,8 @@ import { generateStandardImage } from './handlers/standard.js';
|
|
|
15
14
|
}
|
|
16
15
|
const modelConfig = providerConfig.models?.find((m)=>m.id === modelId);
|
|
17
16
|
// Determine if this is a multimodal text-to-image model
|
|
18
|
-
|
|
17
|
+
// It must support both TEXT and IMAGE modalities (or at least TEXT) to be treated as a language model
|
|
18
|
+
const isMultimodalText = modelConfig?.responseModalities?.includes('IMAGE') && modelConfig?.responseModalities?.includes('TEXT');
|
|
19
19
|
// Merge provider's default image options with instruction-level overrides
|
|
20
20
|
const mergedProviderOptions = {
|
|
21
21
|
...providerConfig.options?.image || {},
|
|
@@ -23,10 +23,6 @@ import { generateStandardImage } from './handlers/standard.js';
|
|
|
23
23
|
};
|
|
24
24
|
// Get appropriate model instance
|
|
25
25
|
const model = await getImageModel(payload, provider, modelId, mergedProviderOptions, isMultimodalText);
|
|
26
|
-
console.log('isMultimodalText : ', isMultimodalText);
|
|
27
|
-
console.log('modelConfig : ', modelConfig);
|
|
28
|
-
console.log('mergedProviderOptions : ', mergedProviderOptions);
|
|
29
|
-
console.log('model : ', model);
|
|
30
26
|
// Pass merged options to handlers
|
|
31
27
|
const argsWithMergedOptions = {
|
|
32
28
|
...args,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/ai/core/media/image/generateImage.ts"],"sourcesContent":["import type { ImageModel, LanguageModel } from 'ai'\n\nimport type { ImageGenerationArgs, MediaResult } from '../types.js'\n\nimport { getImageModel, getProviderRegistry } from '../../../providers/registry.js'\nimport { generateMultimodalImage } from './handlers/multimodal.js'\nimport { generateStandardImage } from './handlers/standard.js'\n\n/**\n * Main image generation handler\n * Routes to appropriate handler based on model capabilities\n */\nexport async function generateImage(args: ImageGenerationArgs): Promise<MediaResult> {\n const { model: modelId, payload, provider } = args\n
|
|
1
|
+
{"version":3,"sources":["../../../../../src/ai/core/media/image/generateImage.ts"],"sourcesContent":["import type { ImageModel, LanguageModel } from 'ai'\n\nimport type { ImageGenerationArgs, MediaResult } from '../types.js'\n\nimport { getImageModel, getProviderRegistry } from '../../../providers/registry.js'\nimport { generateMultimodalImage } from './handlers/multimodal.js'\nimport { generateStandardImage } from './handlers/standard.js'\n\n/**\n * Main image generation handler\n * Routes to appropriate handler based on model capabilities\n */\nexport async function generateImage(args: ImageGenerationArgs): Promise<MediaResult> {\n const { model: modelId, payload, provider } = args\n // Get provider registry and model configuration\n const registry = await getProviderRegistry(payload)\n const providerConfig = registry[provider || '']\n\n if (!providerConfig) {\n throw new Error(`Provider ${provider} not found in registry`)\n }\n\n const modelConfig = providerConfig.models?.find((m) => m.id === modelId)\n\n // Determine if this is a multimodal text-to-image model\n // It must support both TEXT and IMAGE modalities (or at least TEXT) to be treated as a language model\n const isMultimodalText =\n modelConfig?.responseModalities?.includes('IMAGE') &&\n modelConfig?.responseModalities?.includes('TEXT')\n\n // Merge provider's default image options with instruction-level overrides\n const mergedProviderOptions = {\n ...(providerConfig.options?.image || {}),\n ...(args.providerOptions || {}),\n }\n\n // Get appropriate model instance\n const model = await getImageModel(\n payload,\n provider,\n modelId,\n mergedProviderOptions,\n isMultimodalText,\n )\n // Pass merged options to handlers\n const argsWithMergedOptions = { ...args, providerOptions: mergedProviderOptions }\n\n if (isMultimodalText) {\n return generateMultimodalImage(model as LanguageModel, argsWithMergedOptions)\n }\n\n return generateStandardImage(model as ImageModel, argsWithMergedOptions)\n}\n"],"names":["getImageModel","getProviderRegistry","generateMultimodalImage","generateStandardImage","generateImage","args","model","modelId","payload","provider","registry","providerConfig","Error","modelConfig","models","find","m","id","isMultimodalText","responseModalities","includes","mergedProviderOptions","options","image","providerOptions","argsWithMergedOptions"],"mappings":"AAIA,SAASA,aAAa,EAAEC,mBAAmB,QAAQ,iCAAgC;AACnF,SAASC,uBAAuB,QAAQ,2BAA0B;AAClE,SAASC,qBAAqB,QAAQ,yBAAwB;AAE9D;;;CAGC,GACD,OAAO,eAAeC,cAAcC,IAAyB;IAC3D,MAAM,EAAEC,OAAOC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGJ;IAC9C,gDAAgD;IAChD,MAAMK,WAAW,MAAMT,oBAAoBO;IAC3C,MAAMG,iBAAiBD,QAAQ,CAACD,YAAY,GAAG;IAE/C,IAAI,CAACE,gBAAgB;QACnB,MAAM,IAAIC,MAAM,CAAC,SAAS,EAAEH,SAAS,sBAAsB,CAAC;IAC9D;IAEA,MAAMI,cAAcF,eAAeG,MAAM,EAAEC,KAAK,CAACC,IAAMA,EAAEC,EAAE,KAAKV;IAEhE,wDAAwD;IACxD,sGAAsG;IACtG,MAAMW,mBACJL,aAAaM,oBAAoBC,SAAS,YAC1CP,aAAaM,oBAAoBC,SAAS;IAE5C,0EAA0E;IAC1E,MAAMC,wBAAwB;QAC5B,GAAIV,eAAeW,OAAO,EAAEC,SAAS,CAAC,CAAC;QACvC,GAAIlB,KAAKmB,eAAe,IAAI,CAAC,CAAC;IAChC;IAEA,iCAAiC;IACjC,MAAMlB,QAAQ,MAAMN,cAClBQ,SACAC,UACAF,SACAc,uBACAH;IAEF,kCAAkC;IAClC,MAAMO,wBAAwB;QAAE,GAAGpB,IAAI;QAAEmB,iBAAiBH;IAAsB;IAEhF,IAAIH,kBAAkB;QACpB,OAAOhB,wBAAwBI,OAAwBmB;IACzD;IAEA,OAAOtB,sBAAsBG,OAAqBmB;AACpD"}
|
|
@@ -18,6 +18,11 @@ import { convertToBuffer, getExtensionFromMimeType } from '../../utils.js';
|
|
|
18
18
|
// },
|
|
19
19
|
// ]
|
|
20
20
|
console.log('providerOptions: ', providerOptions);
|
|
21
|
+
console.log('images to pass to AI model: ', images.length, 'items', images.map((img)=>({
|
|
22
|
+
type: img.type,
|
|
23
|
+
hasData: !!img.image,
|
|
24
|
+
mediaType: img.mediaType
|
|
25
|
+
})));
|
|
21
26
|
// Build Google-specific options with required defaults
|
|
22
27
|
const googleOptions = {
|
|
23
28
|
imageConfig: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/ai/core/media/image/handlers/multimodal.ts"],"sourcesContent":["import { generateText, type LanguageModel, ModelMessage } from 'ai'\n\nimport type { ImageGenerationArgs, MediaResult, MultimodalImageFile } from '../../types.js'\n\nimport { convertToBuffer, getExtensionFromMimeType } from '../../utils.js'\n\n/**\n * Handle multimodal text-to-image generation (e.g., Gemini Nano Banana)\n * Uses generateText with image response modalities\n */\nexport async function generateMultimodalImage(\n model: LanguageModel,\n args: ImageGenerationArgs,\n): Promise<MediaResult> {\n const { images = [], prompt, providerOptions = {} } = args\n //\n // const promptParts: ModelMessage[] = [\n // { role: 'user', content: [{ type: 'text', text: prompt } }],\n // ...,\n // ]\n //\n // const messages = [\n // {\n // content: promptParts,\n // role: 'user' as const,\n // },\n // ]\n\n console.log('providerOptions: ', providerOptions)\n \n // Build Google-specific options with required defaults\n const googleOptions = {\n imageConfig: {\n aspectRatio: args.aspectRatio || providerOptions?.aspectRatio || '16:9',\n ...(providerOptions?.personGeneration && { personGeneration: providerOptions.personGeneration }),\n ...(providerOptions?.addWatermark !== undefined && { addWatermark: providerOptions.addWatermark }),\n },\n responseModalities: ['IMAGE', 'TEXT'],\n }\n \n const result = await generateText({\n model,\n // onStepFinish: (step) => {\n // console.log('step finish: ', step.files)\n // console.log('step finish: ', step.response)\n // },\n prompt: [\n {\n content: [{ type: 'text', text: prompt }, ...images],\n role: 'user',\n },\n ],\n providerOptions: {\n google: googleOptions,\n },\n })\n\n // console.log(\"model -->\", model)\n // console.log('result.files: ', result.files)\n // console.log('result.text: ', result.text)\n // console.log('result.response: ', JSON.stringify(result.response, null, 2))\n\n // Extract images from result.files\n const resultImages = (result.files?.filter((f: MultimodalImageFile) =>\n f.mediaType?.startsWith('image/'),\n ) || []) as MultimodalImageFile[]\n\n if (resultImages.length === 0) {\n // Check if Google returned a specific error message\n const responseBody = result.response?.body as { candidates?: Array<{ finishMessage?: string; finishReason?: string }> } | undefined\n const candidate = responseBody?.candidates?.[0]\n \n if (candidate?.finishMessage) {\n throw new Error(`Image generation failed: ${candidate.finishMessage}`)\n }\n if (candidate?.finishReason && candidate.finishReason !== 'STOP') {\n throw new Error(`Image generation failed with reason: ${candidate.finishReason}`)\n }\n \n throw new Error('No images returned from the model. The model may have generated only text.')\n }\n\n const firstImage = resultImages[0]\n const mimeType = firstImage.mediaType || 'image/png'\n const imageData = firstImage.base64Data || firstImage.uint8Array\n\n if (!imageData) {\n throw new Error('Image data is missing from the response.')\n }\n\n const buffer = convertToBuffer(imageData)\n const extension = getExtensionFromMimeType(mimeType)\n\n return {\n file: {\n name: `generated.${extension}`,\n data: buffer,\n mimetype: mimeType,\n size: buffer.byteLength,\n },\n }\n}\n"],"names":["generateText","convertToBuffer","getExtensionFromMimeType","generateMultimodalImage","model","args","images","prompt","providerOptions","console","log","googleOptions","imageConfig","aspectRatio","personGeneration","addWatermark","undefined","responseModalities","result","content","
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/ai/core/media/image/handlers/multimodal.ts"],"sourcesContent":["import { generateText, type LanguageModel, ModelMessage } from 'ai'\n\nimport type { ImageGenerationArgs, MediaResult, MultimodalImageFile } from '../../types.js'\n\nimport { convertToBuffer, getExtensionFromMimeType } from '../../utils.js'\n\n/**\n * Handle multimodal text-to-image generation (e.g., Gemini Nano Banana)\n * Uses generateText with image response modalities\n */\nexport async function generateMultimodalImage(\n model: LanguageModel,\n args: ImageGenerationArgs,\n): Promise<MediaResult> {\n const { images = [], prompt, providerOptions = {} } = args\n //\n // const promptParts: ModelMessage[] = [\n // { role: 'user', content: [{ type: 'text', text: prompt } }],\n // ...,\n // ]\n //\n // const messages = [\n // {\n // content: promptParts,\n // role: 'user' as const,\n // },\n // ]\n\n console.log('providerOptions: ', providerOptions)\n console.log('images to pass to AI model: ', images.length, 'items', images.map((img: any) => ({ type: img.type, hasData: !!img.image, mediaType: img.mediaType })))\n \n // Build Google-specific options with required defaults\n const googleOptions = {\n imageConfig: {\n aspectRatio: args.aspectRatio || providerOptions?.aspectRatio || '16:9',\n ...(providerOptions?.personGeneration && { personGeneration: providerOptions.personGeneration }),\n ...(providerOptions?.addWatermark !== undefined && { addWatermark: providerOptions.addWatermark }),\n },\n responseModalities: ['IMAGE', 'TEXT'],\n }\n \n const result = await generateText({\n model,\n // onStepFinish: (step) => {\n // console.log('step finish: ', step.files)\n // console.log('step finish: ', step.response)\n // },\n prompt: [\n {\n content: [{ type: 'text', text: prompt }, ...images],\n role: 'user',\n },\n ],\n providerOptions: {\n google: googleOptions,\n },\n })\n\n // console.log(\"model -->\", model)\n // console.log('result.files: ', result.files)\n // console.log('result.text: ', result.text)\n // console.log('result.response: ', JSON.stringify(result.response, null, 2))\n\n // Extract images from result.files\n const resultImages = (result.files?.filter((f: MultimodalImageFile) =>\n f.mediaType?.startsWith('image/'),\n ) || []) as MultimodalImageFile[]\n\n if (resultImages.length === 0) {\n // Check if Google returned a specific error message\n const responseBody = result.response?.body as { candidates?: Array<{ finishMessage?: string; finishReason?: string }> } | undefined\n const candidate = responseBody?.candidates?.[0]\n \n if (candidate?.finishMessage) {\n throw new Error(`Image generation failed: ${candidate.finishMessage}`)\n }\n if (candidate?.finishReason && candidate.finishReason !== 'STOP') {\n throw new Error(`Image generation failed with reason: ${candidate.finishReason}`)\n }\n \n throw new Error('No images returned from the model. The model may have generated only text.')\n }\n\n const firstImage = resultImages[0]\n const mimeType = firstImage.mediaType || 'image/png'\n const imageData = firstImage.base64Data || firstImage.uint8Array\n\n if (!imageData) {\n throw new Error('Image data is missing from the response.')\n }\n\n const buffer = convertToBuffer(imageData)\n const extension = getExtensionFromMimeType(mimeType)\n\n return {\n file: {\n name: `generated.${extension}`,\n data: buffer,\n mimetype: mimeType,\n size: buffer.byteLength,\n },\n }\n}\n"],"names":["generateText","convertToBuffer","getExtensionFromMimeType","generateMultimodalImage","model","args","images","prompt","providerOptions","console","log","length","map","img","type","hasData","image","mediaType","googleOptions","imageConfig","aspectRatio","personGeneration","addWatermark","undefined","responseModalities","result","content","text","role","google","resultImages","files","filter","f","startsWith","responseBody","response","body","candidate","candidates","finishMessage","Error","finishReason","firstImage","mimeType","imageData","base64Data","uint8Array","buffer","extension","file","name","data","mimetype","size","byteLength"],"mappings":"AAAA,SAASA,YAAY,QAA0C,KAAI;AAInE,SAASC,eAAe,EAAEC,wBAAwB,QAAQ,iBAAgB;AAE1E;;;CAGC,GACD,OAAO,eAAeC,wBACpBC,KAAoB,EACpBC,IAAyB;IAEzB,MAAM,EAAEC,SAAS,EAAE,EAAEC,MAAM,EAAEC,kBAAkB,CAAC,CAAC,EAAE,GAAGH;IACtD,EAAE;IACF,wCAAwC;IACxC,iEAAiE;IACjE,SAAS;IACT,IAAI;IACJ,EAAE;IACF,qBAAqB;IACrB,MAAM;IACN,4BAA4B;IAC5B,6BAA6B;IAC7B,OAAO;IACP,IAAI;IAEJI,QAAQC,GAAG,CAAC,qBAAqBF;IACjCC,QAAQC,GAAG,CAAC,gCAAgCJ,OAAOK,MAAM,EAAE,SAASL,OAAOM,GAAG,CAAC,CAACC,MAAc,CAAA;YAAEC,MAAMD,IAAIC,IAAI;YAAEC,SAAS,CAAC,CAACF,IAAIG,KAAK;YAAEC,WAAWJ,IAAII,SAAS;QAAC,CAAA;IAE/J,uDAAuD;IACvD,M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F,WAAWG,UAAU,IAAIH,WAAWI,UAAU;IAEhE,IAAI,CAACF,WAAW;QACd,MAAM,IAAIJ,MAAM;IAClB;IAEA,MAAMO,SAAS/C,gBAAgB4C;IAC/B,MAAMI,YAAY/C,yBAAyB0C;IAE3C,OAAO;QACLM,MAAM;YACJC,MAAM,CAAC,UAAU,EAAEF,UAAU,CAAC;YAC9BG,MAAMJ;YACNK,UAAUT;YACVU,MAAMN,OAAOO,UAAU;QACzB;IACF;AACF"}
|
|
@@ -45,12 +45,12 @@ function isZodSchema(schema) {
|
|
|
45
45
|
} else {
|
|
46
46
|
options.prompt = prompt;
|
|
47
47
|
}
|
|
48
|
-
console.log("options.messages : ", options.messages);
|
|
49
|
-
console.log('prompt : ', prompt);
|
|
50
|
-
console.log('args.images : ', args.images);
|
|
51
48
|
if (providerOptions) {
|
|
52
49
|
options.providerOptions = providerOptions;
|
|
53
50
|
}
|
|
51
|
+
if (rest.onFinish) {
|
|
52
|
+
options.onFinish = rest.onFinish;
|
|
53
|
+
}
|
|
54
54
|
return sdkStreamObject(options);
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ai/core/streamObject.ts"],"sourcesContent":["import { type ImagePart, jsonSchema, streamObject as sdkStreamObject, type TextPart } from 'ai'\n\nimport type { PayloadGenerateObjectArgs } from './types.js'\n\nimport { getLanguageModel } from '../providers/registry.js'\n\nfunction isZodSchema(schema: unknown): boolean {\n return typeof schema === 'object' && schema !== null && '_def' in schema\n}\n\n/**\n * Stream structured output using AI SDK's streamObject\n * This is a thin wrapper that resolves the model from the registry\n * and passes everything directly to the AI SDK for streaming\n */\nexport async function streamObject(args: PayloadGenerateObjectArgs) {\n const { \n maxTokens, \n mode,\n model: modelId,\n payload,\n prompt,\n provider,\n providerOptions,\n schema,\n system,\n temperature,\n ...rest\n } = args\n \n // Resolve model from registry\n const model = await getLanguageModel(payload, provider, modelId, providerOptions)\n \n // Return streaming result from AI SDK\n const options: Record<string, unknown> = {\n mode: mode || 'auto',\n model,\n schema: schema ? (isZodSchema(schema) ? schema : jsonSchema(schema as Record<string, unknown>)) : undefined,\n system,\n temperature: temperature ?? 0.7,\n ...(maxTokens ? { maxOutputTokens: maxTokens } : {}),\n }\n\n // Handle multimodal input\n if ((args.images && args.images.length > 0) || (args.messages && args.messages.length > 0)) {\n if (args.messages) {\n options.messages = args.messages\n } else {\n // Construct multimodal message from prompt and images\n const content: Array<ImagePart | TextPart> = [\n { type: 'text', text: prompt },\n ...(args.images || []),\n ]\n\n options.messages = [\n { content, role: 'user' as const },\n ]\n }\n } else {\n options.prompt = prompt\n }\n\n
|
|
1
|
+
{"version":3,"sources":["../../../src/ai/core/streamObject.ts"],"sourcesContent":["import { type ImagePart, jsonSchema, streamObject as sdkStreamObject, type TextPart } from 'ai'\n\nimport type { PayloadGenerateObjectArgs } from './types.js'\n\nimport { getLanguageModel } from '../providers/registry.js'\n\nfunction isZodSchema(schema: unknown): boolean {\n return typeof schema === 'object' && schema !== null && '_def' in schema\n}\n\n/**\n * Stream structured output using AI SDK's streamObject\n * This is a thin wrapper that resolves the model from the registry\n * and passes everything directly to the AI SDK for streaming\n */\nexport async function streamObject(args: PayloadGenerateObjectArgs) {\n const { \n maxTokens, \n mode,\n model: modelId,\n payload,\n prompt,\n provider,\n providerOptions,\n schema,\n system,\n temperature,\n ...rest\n } = args\n \n // Resolve model from registry\n const model = await getLanguageModel(payload, provider, modelId, providerOptions)\n \n // Return streaming result from AI SDK\n const options: Record<string, unknown> = {\n mode: mode || 'auto',\n model,\n schema: schema ? (isZodSchema(schema) ? schema : jsonSchema(schema as Record<string, unknown>)) : undefined,\n system,\n temperature: temperature ?? 0.7,\n ...(maxTokens ? { maxOutputTokens: maxTokens } : {}),\n }\n\n // Handle multimodal input\n if ((args.images && args.images.length > 0) || (args.messages && args.messages.length > 0)) {\n if (args.messages) {\n options.messages = args.messages\n } else {\n // Construct multimodal message from prompt and images\n const content: Array<ImagePart | TextPart> = [\n { type: 'text', text: prompt },\n ...(args.images || []),\n ]\n\n options.messages = [\n { content, role: 'user' as const },\n ]\n }\n } else {\n options.prompt = prompt\n }\n\n\n if (providerOptions) {\n options.providerOptions = providerOptions\n }\n\n if (rest.onFinish) {\n options.onFinish = rest.onFinish\n }\n\n return sdkStreamObject(options as Parameters<typeof sdkStreamObject>[0])\n}\n"],"names":["jsonSchema","streamObject","sdkStreamObject","getLanguageModel","isZodSchema","schema","args","maxTokens","mode","model","modelId","payload","prompt","provider","providerOptions","system","temperature","rest","options","undefined","maxOutputTokens","images","length","messages","content","type","text","role","onFinish"],"mappings":"AAAA,SAAyBA,UAAU,EAAEC,gBAAgBC,eAAe,QAAuB,KAAI;AAI/F,SAASC,gBAAgB,QAAQ,2BAA0B;AAE3D,SAASC,YAAYC,MAAe;IAClC,OAAO,OAAOA,WAAW,YAAYA,WAAW,QAAQ,UAAUA;AACpE;AAEA;;;;CAIC,GACD,OAAO,eAAeJ,aAAaK,IAA+B;IAChE,MAAM,EACJC,SAAS,EACTC,IAAI,EACJC,OAAOC,OAAO,EACdC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,eAAe,EACfT,MAAM,EACNU,MAAM,EACNC,WAAW,EACX,GAAGC,MACJ,GAAGX;IAEJ,8BAA8B;IAC9B,MAAMG,QAAQ,MAAMN,iBAAiBQ,SAASE,UAAUH,SAASI;IAEjE,sCAAsC;IACtC,MAAMI,UAAmC;QACvCV,MAAMA,QAAQ;QACdC;QACAJ,QAAQA,SAAUD,YAAYC,UAAUA,SAASL,WAAWK,UAAsCc;QAClGJ;QACAC,aAAaA,eAAe;QAC5B,GAAIT,YAAY;YAAEa,iBAAiBb;QAAU,IAAI,CAAC,CAAC;IACrD;IAEA,0BAA0B;IAC1B,IAAI,AAACD,KAAKe,MAAM,IAAIf,KAAKe,MAAM,CAACC,MAAM,GAAG,KAAOhB,KAAKiB,QAAQ,IAAIjB,KAAKiB,QAAQ,CAACD,MAAM,GAAG,GAAI;QAC1F,IAAIhB,KAAKiB,QAAQ,EAAE;YACjBL,QAAQK,QAAQ,GAAGjB,KAAKiB,QAAQ;QAClC,OAAO;YACL,sDAAsD;YACtD,MAAMC,UAAuC;gBAC3C;oBAAEC,MAAM;oBAAQC,MAAMd;gBAAO;mBACzBN,KAAKe,MAAM,IAAI,EAAE;aACtB;YAEDH,QAAQK,QAAQ,GAAG;gBACjB;oBAAEC;oBAASG,MAAM;gBAAgB;aAClC;QACH;IACF,OAAO;QACLT,QAAQN,MAAM,GAAGA;IACnB;IAGA,IAAIE,iBAAiB;QACnBI,QAAQJ,eAAe,GAAGA;IAC5B;IAEA,IAAIG,KAAKW,QAAQ,EAAE;QACjBV,QAAQU,QAAQ,GAAGX,KAAKW,QAAQ;IAClC;IAEA,OAAO1B,gBAAgBgB;AACzB"}
|
package/dist/ai/core/types.d.ts
CHANGED
|
@@ -27,6 +27,9 @@ export interface PayloadGenerationBaseArgs {
|
|
|
27
27
|
export interface PayloadGenerateObjectArgs extends PayloadGenerationBaseArgs {
|
|
28
28
|
images?: ImagePart[];
|
|
29
29
|
mode?: 'auto' | 'json' | 'tool';
|
|
30
|
+
onFinish?: (event: {
|
|
31
|
+
object?: any;
|
|
32
|
+
}) => Promise<void> | void;
|
|
30
33
|
schema?: Record<string, unknown> | z.ZodTypeAny;
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ai/core/types.ts"],"sourcesContent":["import type { ImagePart, JSONValue, ModelMessage } from 'ai'\nimport type { Payload } from 'payload'\nimport type { z } from 'zod'\n\n/**\n * Provider options compatible with AI SDK's SharedV2ProviderOptions\n * SharedV2ProviderOptions = Record<string, Record<string, JSONValue>>\n */\nexport type ProviderOptions = Record<string, Record<string, JSONValue>>\n\n/**\n * Base arguments for all generation methods\n */\nexport interface PayloadGenerationBaseArgs {\n extractAttachments?: boolean\n maxTokens?: number\n messages?: ModelMessage[]\n model?: string\n payload: Payload\n prompt: string\n provider?: string\n providerOptions?: ProviderOptions\n system?: string\n temperature?: number\n}\n\n/**\n * Arguments for generateObject - structured output generation\n */\nexport interface PayloadGenerateObjectArgs extends PayloadGenerationBaseArgs {\n images?: ImagePart[]\n mode?: 'auto' | 'json' | 'tool'\n schema?: Record<string, unknown> | z.ZodTypeAny\n}\n\n/**\n * Arguments for generateText - simple text generation\n */\nexport interface PayloadGenerateTextArgs extends PayloadGenerationBaseArgs {\n // No additional fields needed for basic text generation\n}\n\n/**\n * Arguments for generateMedia - image/video generation\n */\nexport interface PayloadGenerateMediaArgs {\n aspectRatio?: string\n audioFormat?: string\n callbackUrl?: string\n duration?: number\n fps?: number\n images?: ImagePart[]\n instructionId?: number | string\n mode?: 'i2v' | 't2v'\n model?: string\n n?: number\n payload: Payload\n prompt: string\n provider?: string\n providerOptions?: ProviderOptions\n seed?: number\n size?: { height: number; width: number }\n speed?: number\n voice?: string\n}\n\n/**\n * Result from generateMedia - can be immediate file or async job\n */\nexport interface MediaResult {\n // Immediate result (image generation)\n file?: {\n data: Buffer\n mimetype: string\n name: string\n size: number\n }\n \n // Async job result (video generation)\n jobId?: string\n progress?: number\n status?: 'completed' | 'failed' | 'queued' | 'running'\n taskId?: string\n}\n\n/**\n * Internal type for multimodal image files\n */\nexport interface MultimodalImageFile {\n base64Data?: string\n mediaType?: string\n uint8Array?: Uint8Array\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/ai/core/types.ts"],"sourcesContent":["import type { ImagePart, JSONValue, ModelMessage } from 'ai'\nimport type { Payload } from 'payload'\nimport type { z } from 'zod'\n\n/**\n * Provider options compatible with AI SDK's SharedV2ProviderOptions\n * SharedV2ProviderOptions = Record<string, Record<string, JSONValue>>\n */\nexport type ProviderOptions = Record<string, Record<string, JSONValue>>\n\n/**\n * Base arguments for all generation methods\n */\nexport interface PayloadGenerationBaseArgs {\n extractAttachments?: boolean\n maxTokens?: number\n messages?: ModelMessage[]\n model?: string\n payload: Payload\n prompt: string\n provider?: string\n providerOptions?: ProviderOptions\n system?: string\n temperature?: number\n}\n\n/**\n * Arguments for generateObject - structured output generation\n */\nexport interface PayloadGenerateObjectArgs extends PayloadGenerationBaseArgs {\n images?: ImagePart[]\n mode?: 'auto' | 'json' | 'tool'\n onFinish?: (event: { object?: any }) => Promise<void> | void\n schema?: Record<string, unknown> | z.ZodTypeAny\n}\n\n/**\n * Arguments for generateText - simple text generation\n */\nexport interface PayloadGenerateTextArgs extends PayloadGenerationBaseArgs {\n // No additional fields needed for basic text generation\n}\n\n/**\n * Arguments for generateMedia - image/video generation\n */\nexport interface PayloadGenerateMediaArgs {\n aspectRatio?: string\n audioFormat?: string\n callbackUrl?: string\n duration?: number\n fps?: number\n images?: ImagePart[]\n instructionId?: number | string\n mode?: 'i2v' | 't2v'\n model?: string\n n?: number\n payload: Payload\n prompt: string\n provider?: string\n providerOptions?: ProviderOptions\n seed?: number\n size?: { height: number; width: number }\n speed?: number\n voice?: string\n}\n\n/**\n * Result from generateMedia - can be immediate file or async job\n */\nexport interface MediaResult {\n // Immediate result (image generation)\n file?: {\n data: Buffer\n mimetype: string\n name: string\n size: number\n }\n \n // Async job result (video generation)\n jobId?: string\n progress?: number\n status?: 'completed' | 'failed' | 'queued' | 'running'\n taskId?: string\n}\n\n/**\n * Internal type for multimodal image files\n */\nexport interface MultimodalImageFile {\n base64Data?: string\n mediaType?: string\n uint8Array?: Uint8Array\n}\n"],"names":[],"mappings":"AAsFA;;CAEC,GACD,WAIC"}
|
package/dist/ai/prompts.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ActionPrompt
|
|
1
|
+
import type { ActionPrompt } from '../types.js';
|
|
2
2
|
export declare const defaultSystemPrompt = "IMPORTANT INSTRUCTION:\nProduce only the requested output text.\nDo not add any explanations, comments, or engagement.\nDo not use quotation marks in the response.\nBEGIN OUTPUT:";
|
|
3
3
|
export declare const defaultPrompts: ActionPrompt[];
|
|
4
|
-
export declare const defaultSeedPrompts: SeedPromptFunction;
|
package/dist/ai/prompts.js
CHANGED
|
@@ -100,115 +100,5 @@ INSTRUCTIONS:
|
|
|
100
100
|
-------------`
|
|
101
101
|
}
|
|
102
102
|
];
|
|
103
|
-
export const defaultSeedPrompts = ({ fieldLabel, fieldSchemaPaths, fieldType, path })=>{
|
|
104
|
-
return {
|
|
105
|
-
prompt: `field-type: ${fieldType}
|
|
106
|
-
field-name: ${fieldLabel}
|
|
107
|
-
schema-path: ${path}
|
|
108
|
-
|
|
109
|
-
Give me a prompt that relate to the given field type and schema path.
|
|
110
|
-
|
|
111
|
-
Generated prompt:
|
|
112
|
-
`,
|
|
113
|
-
system: `# AI Assistant for CMS Prompt Generation
|
|
114
|
-
|
|
115
|
-
Your role: Generate prompts for Content Management System (CMS) fields based on field-type and schema-path.
|
|
116
|
-
|
|
117
|
-
## Key Guidelines:
|
|
118
|
-
- Tailor prompts to specific field-type and purpose
|
|
119
|
-
- Use schema-path for context
|
|
120
|
-
- Include " {{ title }} " in every prompt
|
|
121
|
-
- Be clear, concise, and instructive
|
|
122
|
-
- Focus on content generation, not user perspective
|
|
123
|
-
- For Image, Voice, or Banner fields, use provided example prompts verbatim
|
|
124
|
-
- Image, Banner prompt MUST NOT CONTAIN ANY TYPOGRAPHY/TEXT DETAILS
|
|
125
|
-
|
|
126
|
-
## Field Types and Prompts:
|
|
127
|
-
|
|
128
|
-
1. richText:
|
|
129
|
-
- Craft detailed, structured content
|
|
130
|
-
- Include intro, sections, body, formatting, and conclusion
|
|
131
|
-
- Aim for engaging, informative, and valuable content
|
|
132
|
-
|
|
133
|
-
2. text:
|
|
134
|
-
- For titles: Generate concise, engaging titles
|
|
135
|
-
- For keywords: List relevant SEO terms
|
|
136
|
-
|
|
137
|
-
3. textarea:
|
|
138
|
-
- Provide comprehensive details (e.g., event information)
|
|
139
|
-
|
|
140
|
-
4. upload:
|
|
141
|
-
- Describe high-quality images or media
|
|
142
|
-
|
|
143
|
-
## Schema-path Examples:
|
|
144
|
-
- posts.title: Blog/article title
|
|
145
|
-
- products.name: Product name
|
|
146
|
-
|
|
147
|
-
## Must Follow:
|
|
148
|
-
- Adapt prompts to schema-path context
|
|
149
|
-
- Generate content directly, avoid personal pronouns
|
|
150
|
-
- Use provided examples as guidelines
|
|
151
|
-
|
|
152
|
-
### Examples for each field type along with generated prompt:
|
|
153
|
-
|
|
154
|
-
For richText:
|
|
155
|
-
field-type: richText
|
|
156
|
-
field-name: Content
|
|
157
|
-
schema-path: posts.content
|
|
158
|
-
Generated prompt: Craft compelling content for a blog post with the title " {{ title }} ". Develop a well-structured narrative that captivates readers from start to finish. Incorporate the following elements to create a polished and engaging piece:
|
|
159
|
-
|
|
160
|
-
- Engaging introduction that hooks the reader
|
|
161
|
-
- Clearly defined sections with relevant subheadings
|
|
162
|
-
- Well-researched and informative body paragraphs
|
|
163
|
-
- Creative use of formatting to enhance readability (e.g., bullet points, blockquotes, italics, headings, bolds, other text formats)
|
|
164
|
-
- Compelling conclusion that reinforces the main theme
|
|
165
|
-
- Make the format easily digestible and clear for enhanced readability and improved CTR.
|
|
166
|
-
- The user should be engaged, consistently interested, and feel that they’ve gained the knowledge they were seeking.
|
|
167
|
-
|
|
168
|
-
Infuse the content with your expertise and a touch of personality to make it both informative and enjoyable to read. Aim to provide value to your target audience while maintaining a professional tone that aligns with the blog's overall style.
|
|
169
|
-
Feel free to incorporate relevant anecdotes, statistics, or examples to support your points and add depth to the post. Remember, the goal is to create content that not only informs but also inspires and entertains your readers.
|
|
170
|
-
|
|
171
|
-
For text:
|
|
172
|
-
field-type: text
|
|
173
|
-
field-name: title
|
|
174
|
-
schema-path: posts.title
|
|
175
|
-
Generated prompt: Generate a captivating title for the blog post based on " {{ title }} " that effectively encapsulates the main theme and draws in readers. The title should be concise, engaging, and relevant to the content being presented. If no input is provided then generate creative title.
|
|
176
|
-
|
|
177
|
-
For text:
|
|
178
|
-
field-type: text
|
|
179
|
-
field-name: keywords
|
|
180
|
-
schema-path: posts.keywords
|
|
181
|
-
Generated prompt: Identify and list relevant keywords for the blog post titled " {{ title }} ". Focus on terms that enhance search engine optimization and accurately reflect the main themes and topics of the content.
|
|
182
|
-
keywords will with comma separated.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
For textarea:
|
|
186
|
-
field-type: textarea:
|
|
187
|
-
field-name: details
|
|
188
|
-
schema-path: posts.details
|
|
189
|
-
Generated prompt: Provide comprehensive details for the event " {{ title }} ". Include essential information such as date, time, location, and any specific instructions or requirements.
|
|
190
|
-
|
|
191
|
-
For upload:
|
|
192
|
-
field-type: upload
|
|
193
|
-
field-name: Featured Image
|
|
194
|
-
schema-path: posts.image
|
|
195
|
-
Generated prompt: Imagine {{ title }}
|
|
196
|
-
|
|
197
|
-
For upload:
|
|
198
|
-
field-type: upload
|
|
199
|
-
field-name: Voice
|
|
200
|
-
schema-path: posts.upload
|
|
201
|
-
Generated prompt: {{ title }} {{ toHTML [provide schema-path here...] }}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
Remember to adapt the prompts based on the specific schema-path provided, considering the context and purpose of the field within the CMS structure. The prompts should directly instruct the AI model on what content to generate or describe, without assuming a user perspective.
|
|
205
|
-
|
|
206
|
-
Schema Map Context:
|
|
207
|
-
${JSON.stringify(fieldSchemaPaths)}
|
|
208
|
-
|
|
209
|
-
${defaultSystemPrompt}
|
|
210
|
-
`
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
103
|
|
|
214
104
|
//# sourceMappingURL=prompts.js.map
|
package/dist/ai/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ai/prompts.ts"],"sourcesContent":["import type { ActionPrompt, SeedPromptFunction } from '../types.js'\n\n//TODO: This is a temporary solution make use of structured output\nexport const defaultSystemPrompt = `IMPORTANT INSTRUCTION:\nProduce only the requested output text.\nDo not add any explanations, comments, or engagement.\nDo not use quotation marks in the response.\nBEGIN OUTPUT:`\n\nexport const defaultPrompts: ActionPrompt[] = [\n {\n name: 'Rephrase',\n system: ({\n prompt = '',\n systemPrompt = '',\n }) => `You are a skilled language expert. Rephrase the given text while maintaining its original meaning, tone, and emotional content. Use different words and sentence structures where possible, but preserve the overall style and sentiment of the original.\n \n -------------\n INSTRUCTIONS:\n - Rephrase the text according to the guidelines of the ORIGINAL SYSTEM PROMPT, if provided.\n - Retain the original meaning, tone, and emotional content.\n - Use different vocabulary and sentence structures where appropriate.\n - Ensure the rephrased text conveys the same message and feeling as the original.\n ${prompt ? '\\n\\nPrevious prompt:\\n' + prompt : ''}\n ${systemPrompt ? '\\n\\nORIGINAL SYSTEM PROMPT:\\n' + systemPrompt : ''}\n -------------`,\n },\n {\n name: 'Expand',\n system:\n () => `You are a creative writer and subject matter expert. Expand the given text by adding depth, detail, and relevant information while maintaining the original tone and style.\n \n -------------\n INSTRUCTIONS:\n - Understand the main ideas and tone of the text.\n - Add more details, examples, explanations, or context.\n - Maintain the original tone, style, and intent.\n - Ensure the expanded version flows naturally and coherently.\n - Do not contradict or alter the original meaning.\n -------------`,\n },\n {\n name: 'Proofread',\n system:\n () => `You are an English language expert. Proofread the given text, focusing on correcting grammar and spelling mistakes without altering the content, style, or tone.\n \n -------------\n INSTRUCTIONS:\n - Correct grammar and spelling errors.\n - Do not change the content, meaning, tone, or style.\n - Return the full text, whether corrections were made or not.\n - Do not provide additional comments or analysis.\n -------------`,\n },\n {\n name: 'Simplify',\n system: ({\n prompt = '',\n }) => `You are a skilled communicator specializing in clear and concise writing. Simplify the given text to make it easier to understand while retaining its core message.\n \n -------------\n INSTRUCTIONS:\n - Simplify the language, using more common words and shorter sentences.\n - Remove unnecessary details or jargon while keeping essential information.\n - Maintain the original meaning and key points.\n - Aim for clarity and readability for a general audience.\n - The simplified text should be more concise than the original.\n ${prompt ? '\\n\\nPREVIOUS PROMPT:\\n' + prompt : ''}\n -------------`,\n },\n {\n name: 'Summarize',\n layout: () => `\n[heading] - Summary\n[paragraph] - Your summary goes here...\n `,\n system: () =>\n `You are an expert at summarizing information. Your task is to create a concise summary of the given text that captures its key points and essential details while preserving the original meaning.\n\nINSTRUCTIONS:\n1. Carefully read and analyze the provided text.\n2. Identify and extract the main ideas and crucial supporting details.\n3. Condense the information into a clear and coherent summary that maintains the core message.\n4. Preserve the original tone and intent of the text.\n5. Ensure your summary is approximately 25-30% of the original text length.\n6. Use clear and precise language, avoiding unnecessary jargon or complexity.\n`,\n },\n {\n name: 'Tone',\n system: () =>\n `You are a tone adjustment specialist. Modify the tone of the given text as specified while keeping the original message and content intact.\n \n -------------\n INSTRUCTIONS:\n - Adjust the tone to match the specified style (e.g., formal, informal, professional, friendly).\n - Maintain the original content and meaning.\n - Ensure the adjusted text flows naturally with the new tone.\n -------------`,\n },\n {\n name: 'Translate',\n system: ({ locale, prompt = '', systemPrompt = '' }) =>\n `You are a skilled translator. Translate the following text into ${locale}, ensuring the original meaning, tone, and context are preserved.\n \n -------------\n INSTRUCTIONS:\n - Accurately translate the text into ${locale}.\n - Preserve the original meaning, tone, and context.\n - Ensure the translation is culturally appropriate and natural in the target language.\n ${prompt ? '\\n\\nPREVIOUS PROMPT:\\n' + prompt : ''}\n ${systemPrompt ? '\\n\\nORIGINAL SYSTEM PROMPT:\\n' + systemPrompt : ''}\n -------------`,\n },\n]\n\nexport const defaultSeedPrompts: SeedPromptFunction = ({\n fieldLabel,\n fieldSchemaPaths,\n fieldType,\n path,\n}: {\n fieldLabel: string\n fieldSchemaPaths: any\n fieldType: string\n path: string\n}) => {\n return {\n prompt: `field-type: ${fieldType}\nfield-name: ${fieldLabel}\nschema-path: ${path}\n\nGive me a prompt that relate to the given field type and schema path.\n\nGenerated prompt:\n`,\n system: `# AI Assistant for CMS Prompt Generation\n\nYour role: Generate prompts for Content Management System (CMS) fields based on field-type and schema-path.\n\n## Key Guidelines:\n- Tailor prompts to specific field-type and purpose\n- Use schema-path for context\n- Include \" {{ title }} \" in every prompt\n- Be clear, concise, and instructive\n- Focus on content generation, not user perspective\n- For Image, Voice, or Banner fields, use provided example prompts verbatim\n- Image, Banner prompt MUST NOT CONTAIN ANY TYPOGRAPHY/TEXT DETAILS\n\n## Field Types and Prompts:\n\n1. richText:\n - Craft detailed, structured content\n - Include intro, sections, body, formatting, and conclusion\n - Aim for engaging, informative, and valuable content\n\n2. text:\n - For titles: Generate concise, engaging titles\n - For keywords: List relevant SEO terms\n\n3. textarea:\n - Provide comprehensive details (e.g., event information)\n\n4. upload:\n - Describe high-quality images or media\n\n## Schema-path Examples:\n- posts.title: Blog/article title\n- products.name: Product name\n\n## Must Follow:\n- Adapt prompts to schema-path context\n- Generate content directly, avoid personal pronouns\n- Use provided examples as guidelines\n\n### Examples for each field type along with generated prompt:\n\nFor richText:\n field-type: richText\n field-name: Content\n schema-path: posts.content\n Generated prompt: Craft compelling content for a blog post with the title \" {{ title }} \". Develop a well-structured narrative that captivates readers from start to finish. Incorporate the following elements to create a polished and engaging piece:\n\n- Engaging introduction that hooks the reader\n- Clearly defined sections with relevant subheadings\n- Well-researched and informative body paragraphs\n- Creative use of formatting to enhance readability (e.g., bullet points, blockquotes, italics, headings, bolds, other text formats)\n- Compelling conclusion that reinforces the main theme\n- Make the format easily digestible and clear for enhanced readability and improved CTR. \n- The user should be engaged, consistently interested, and feel that they’ve gained the knowledge they were seeking. \n\nInfuse the content with your expertise and a touch of personality to make it both informative and enjoyable to read. Aim to provide value to your target audience while maintaining a professional tone that aligns with the blog's overall style.\nFeel free to incorporate relevant anecdotes, statistics, or examples to support your points and add depth to the post. Remember, the goal is to create content that not only informs but also inspires and entertains your readers.\n\nFor text:\n field-type: text\n field-name: title\n schema-path: posts.title\n Generated prompt: Generate a captivating title for the blog post based on \" {{ title }} \" that effectively encapsulates the main theme and draws in readers. The title should be concise, engaging, and relevant to the content being presented. If no input is provided then generate creative title.\n\nFor text:\n field-type: text\n field-name: keywords\n schema-path: posts.keywords\n Generated prompt: Identify and list relevant keywords for the blog post titled \" {{ title }} \". Focus on terms that enhance search engine optimization and accurately reflect the main themes and topics of the content.\nkeywords will with comma separated.\n\n\nFor textarea:\n field-type: textarea:\n field-name: details\n schema-path: posts.details\n Generated prompt: Provide comprehensive details for the event \" {{ title }} \". Include essential information such as date, time, location, and any specific instructions or requirements.\n\nFor upload:\n field-type: upload\n field-name: Featured Image\n schema-path: posts.image\n Generated prompt: Imagine {{ title }}\n\nFor upload:\n field-type: upload\n field-name: Voice\n schema-path: posts.upload\n Generated prompt: {{ title }} {{ toHTML [provide schema-path here...] }}\n\n\nRemember to adapt the prompts based on the specific schema-path provided, considering the context and purpose of the field within the CMS structure. The prompts should directly instruct the AI model on what content to generate or describe, without assuming a user perspective.\n\nSchema Map Context:\n${JSON.stringify(fieldSchemaPaths)}\n\n${defaultSystemPrompt}\n`,\n }\n}\n"],"names":["defaultSystemPrompt","defaultPrompts","name","system","prompt","systemPrompt","layout","locale","defaultSeedPrompts","fieldLabel","fieldSchemaPaths","fieldType","path","JSON","stringify"],"mappings":"AAEA,kEAAkE;AAClE,OAAO,MAAMA,sBAAsB,CAAC;;;;aAIvB,CAAC,CAAA;AAEd,OAAO,MAAMC,iBAAiC;IAC5C;QACEC,MAAM;QACNC,QAAQ,CAAC,EACPC,SAAS,EAAE,EACXC,eAAe,EAAE,EAClB,GAAK,CAAC;;;;;;;;MAQL,EAAED,SAAS,2BAA2BA,SAAS,GAAG;MAClD,EAAEC,eAAe,kCAAkCA,eAAe,GAAG;mBACxD,CAAC;IAClB;IACA;QACEH,MAAM;QACNC,QACE,IAAM,CAAC;;;;;;;;;mBASM,CAAC;IAClB;IACA;QACED,MAAM;QACNC,QACE,IAAM,CAAC;;;;;;;;mBAQM,CAAC;IAClB;IACA;QACED,MAAM;QACNC,QAAQ,CAAC,EACPC,SAAS,EAAE,EACZ,GAAK,CAAC;;;;;;;;;MASL,EAAEA,SAAS,2BAA2BA,SAAS,GAAG;mBACrC,CAAC;IAClB;IACA;QACEF,MAAM;QACNI,QAAQ,IAAM,CAAC;;;IAGf,CAAC;QACDH,QAAQ,IACN,CAAC;;;;;;;;;AASP,CAAC;IACC;IACA;QACED,MAAM;QACNC,QAAQ,IACN,CAAC;;;;;;;mBAOY,CAAC;IAClB;IACA;QACED,MAAM;QACNC,QAAQ,CAAC,EAAEI,MAAM,EAAEH,SAAS,EAAE,EAAEC,eAAe,EAAE,EAAE,GACjD,CAAC,gEAAgE,EAAEE,OAAO;;;;yCAIvC,EAAEA,OAAO;;;IAG9C,EAAEH,SAAS,2BAA2BA,SAAS,GAAG;IAClD,EAAEC,eAAe,kCAAkCA,eAAe,GAAG;iBACxD,CAAC;IAChB;CACD,CAAA;AAED,OAAO,MAAMG,qBAAyC,CAAC,EACrDC,UAAU,EACVC,gBAAgB,EAChBC,SAAS,EACTC,IAAI,EAML;IACC,OAAO;QACLR,QAAQ,CAAC,YAAY,EAAEO,UAAU;YACzB,EAAEF,WAAW;aACZ,EAAEG,KAAK;;;;;AAKpB,CAAC;QACGT,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8Fb,EAAEU,KAAKC,SAAS,CAACJ,kBAAkB;;AAEnC,EAAEV,oBAAoB;AACtB,CAAC;IACC;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/ai/prompts.ts"],"sourcesContent":["import type { ActionPrompt } from '../types.js'\n\n//TODO: This is a temporary solution make use of structured output\nexport const defaultSystemPrompt = `IMPORTANT INSTRUCTION:\nProduce only the requested output text.\nDo not add any explanations, comments, or engagement.\nDo not use quotation marks in the response.\nBEGIN OUTPUT:`\n\nexport const defaultPrompts: ActionPrompt[] = [\n {\n name: 'Rephrase',\n system: ({\n prompt = '',\n systemPrompt = '',\n }) => `You are a skilled language expert. Rephrase the given text while maintaining its original meaning, tone, and emotional content. Use different words and sentence structures where possible, but preserve the overall style and sentiment of the original.\n \n -------------\n INSTRUCTIONS:\n - Rephrase the text according to the guidelines of the ORIGINAL SYSTEM PROMPT, if provided.\n - Retain the original meaning, tone, and emotional content.\n - Use different vocabulary and sentence structures where appropriate.\n - Ensure the rephrased text conveys the same message and feeling as the original.\n ${prompt ? '\\n\\nPrevious prompt:\\n' + prompt : ''}\n ${systemPrompt ? '\\n\\nORIGINAL SYSTEM PROMPT:\\n' + systemPrompt : ''}\n -------------`,\n },\n {\n name: 'Expand',\n system:\n () => `You are a creative writer and subject matter expert. Expand the given text by adding depth, detail, and relevant information while maintaining the original tone and style.\n \n -------------\n INSTRUCTIONS:\n - Understand the main ideas and tone of the text.\n - Add more details, examples, explanations, or context.\n - Maintain the original tone, style, and intent.\n - Ensure the expanded version flows naturally and coherently.\n - Do not contradict or alter the original meaning.\n -------------`,\n },\n {\n name: 'Proofread',\n system:\n () => `You are an English language expert. Proofread the given text, focusing on correcting grammar and spelling mistakes without altering the content, style, or tone.\n \n -------------\n INSTRUCTIONS:\n - Correct grammar and spelling errors.\n - Do not change the content, meaning, tone, or style.\n - Return the full text, whether corrections were made or not.\n - Do not provide additional comments or analysis.\n -------------`,\n },\n {\n name: 'Simplify',\n system: ({\n prompt = '',\n }) => `You are a skilled communicator specializing in clear and concise writing. Simplify the given text to make it easier to understand while retaining its core message.\n \n -------------\n INSTRUCTIONS:\n - Simplify the language, using more common words and shorter sentences.\n - Remove unnecessary details or jargon while keeping essential information.\n - Maintain the original meaning and key points.\n - Aim for clarity and readability for a general audience.\n - The simplified text should be more concise than the original.\n ${prompt ? '\\n\\nPREVIOUS PROMPT:\\n' + prompt : ''}\n -------------`,\n },\n {\n name: 'Summarize',\n layout: () => `\n[heading] - Summary\n[paragraph] - Your summary goes here...\n `,\n system: () =>\n `You are an expert at summarizing information. Your task is to create a concise summary of the given text that captures its key points and essential details while preserving the original meaning.\n\nINSTRUCTIONS:\n1. Carefully read and analyze the provided text.\n2. Identify and extract the main ideas and crucial supporting details.\n3. Condense the information into a clear and coherent summary that maintains the core message.\n4. Preserve the original tone and intent of the text.\n5. Ensure your summary is approximately 25-30% of the original text length.\n6. Use clear and precise language, avoiding unnecessary jargon or complexity.\n`,\n },\n {\n name: 'Tone',\n system: () =>\n `You are a tone adjustment specialist. Modify the tone of the given text as specified while keeping the original message and content intact.\n \n -------------\n INSTRUCTIONS:\n - Adjust the tone to match the specified style (e.g., formal, informal, professional, friendly).\n - Maintain the original content and meaning.\n - Ensure the adjusted text flows naturally with the new tone.\n -------------`,\n },\n {\n name: 'Translate',\n system: ({ locale, prompt = '', systemPrompt = '' }) =>\n `You are a skilled translator. Translate the following text into ${locale}, ensuring the original meaning, tone, and context are preserved.\n \n -------------\n INSTRUCTIONS:\n - Accurately translate the text into ${locale}.\n - Preserve the original meaning, tone, and context.\n - Ensure the translation is culturally appropriate and natural in the target language.\n ${prompt ? '\\n\\nPREVIOUS PROMPT:\\n' + prompt : ''}\n ${systemPrompt ? '\\n\\nORIGINAL SYSTEM PROMPT:\\n' + systemPrompt : ''}\n -------------`,\n },\n]\n"],"names":["defaultSystemPrompt","defaultPrompts","name","system","prompt","systemPrompt","layout","locale"],"mappings":"AAEA,kEAAkE;AAClE,OAAO,MAAMA,sBAAsB,CAAC;;;;aAIvB,CAAC,CAAA;AAEd,OAAO,MAAMC,iBAAiC;IAC5C;QACEC,MAAM;QACNC,QAAQ,CAAC,EACPC,SAAS,EAAE,EACXC,eAAe,EAAE,EAClB,GAAK,CAAC;;;;;;;;MAQL,EAAED,SAAS,2BAA2BA,SAAS,GAAG;MAClD,EAAEC,eAAe,kCAAkCA,eAAe,GAAG;mBACxD,CAAC;IAClB;IACA;QACEH,MAAM;QACNC,QACE,IAAM,CAAC;;;;;;;;;mBASM,CAAC;IAClB;IACA;QACED,MAAM;QACNC,QACE,IAAM,CAAC;;;;;;;;mBAQM,CAAC;IAClB;IACA;QACED,MAAM;QACNC,QAAQ,CAAC,EACPC,SAAS,EAAE,EACZ,GAAK,CAAC;;;;;;;;;MASL,EAAEA,SAAS,2BAA2BA,SAAS,GAAG;mBACrC,CAAC;IAClB;IACA;QACEF,MAAM;QACNI,QAAQ,IAAM,CAAC;;;IAGf,CAAC;QACDH,QAAQ,IACN,CAAC;;;;;;;;;AASP,CAAC;IACC;IACA;QACED,MAAM;QACNC,QAAQ,IACN,CAAC;;;;;;;mBAOY,CAAC;IAClB;IACA;QACED,MAAM;QACNC,QAAQ,CAAC,EAAEI,MAAM,EAAEH,SAAS,EAAE,EAAEC,eAAe,EAAE,EAAE,GACjD,CAAC,gEAAgE,EAAEE,OAAO;;;;yCAIvC,EAAEA,OAAO;;;IAG9C,EAAEH,SAAS,2BAA2BA,SAAS,GAAG;IAClD,EAAEC,eAAe,kCAAkCA,eAAe,GAAG;iBACxD,CAAC;IAChB;CACD,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnthropicIcon } from '../icons.js';
|
|
1
2
|
export const anthropicBlock = {
|
|
2
3
|
slug: 'anthropic',
|
|
3
4
|
fields: [
|
|
@@ -212,7 +213,7 @@ export const anthropicBlock = {
|
|
|
212
213
|
]
|
|
213
214
|
}
|
|
214
215
|
],
|
|
215
|
-
imageURL:
|
|
216
|
+
imageURL: AnthropicIcon,
|
|
216
217
|
labels: {
|
|
217
218
|
plural: 'Anthropic Providers',
|
|
218
219
|
singular: 'Anthropic'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ai/providers/blocks/anthropic.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nexport const anthropicBlock: Block = {\n slug: 'anthropic',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description: 'Your Anthropic API key. Will be encrypted in the database.',\n },\n label: 'API Key',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Provider Options tab\n {\n fields: [\n {\n name: 'textProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for text generation models.',\n },\n fields: [\n {\n name: 'temperature',\n type: 'number',\n defaultValue: 1.0,\n label: 'Default Temperature',\n max: 1.0,\n min: 0.0,\n },\n {\n name: 'max_tokens',\n type: 'number',\n defaultValue: 4096,\n label: 'Max Tokens',\n },\n {\n name: 'top_p',\n type: 'number',\n label: 'Top P',\n max: 1.0,\n min: 0.0,\n },\n {\n name: 'top_k',\n type: 'number',\n label: 'Top K',\n },\n ],\n label: 'Text Provider Options',\n },\n ],\n label: 'Provider Options',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n initCollapsed: true,\n },\n defaultValue: [\n { id: 'claude-opus-4-1', name: 'Claude Opus 4.1', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'claude-opus-4-0', name: 'Claude Opus 4.0', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'claude-sonnet-4-0', name: 'Claude Sonnet 4.0', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n {\n id: 'claude-3-5-sonnet-latest',\n name: 'Claude 3.5 Sonnet',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'claude-3-5-haiku-latest',\n name: 'Claude 3.5 Haiku',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'anthropic-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [{ label: 'Text Generation', value: 'text' }],\n },\n ],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'anthropic-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL:
|
|
1
|
+
{"version":3,"sources":["../../../../src/ai/providers/blocks/anthropic.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { AnthropicIcon } from '../icons.js'\n\nexport const anthropicBlock: Block = {\n slug: 'anthropic',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description: 'Your Anthropic API key. Will be encrypted in the database.',\n },\n label: 'API Key',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Provider Options tab\n {\n fields: [\n {\n name: 'textProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for text generation models.',\n },\n fields: [\n {\n name: 'temperature',\n type: 'number',\n defaultValue: 1.0,\n label: 'Default Temperature',\n max: 1.0,\n min: 0.0,\n },\n {\n name: 'max_tokens',\n type: 'number',\n defaultValue: 4096,\n label: 'Max Tokens',\n },\n {\n name: 'top_p',\n type: 'number',\n label: 'Top P',\n max: 1.0,\n min: 0.0,\n },\n {\n name: 'top_k',\n type: 'number',\n label: 'Top K',\n },\n ],\n label: 'Text Provider Options',\n },\n ],\n label: 'Provider Options',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n initCollapsed: true,\n },\n defaultValue: [\n { id: 'claude-opus-4-1', name: 'Claude Opus 4.1', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'claude-opus-4-0', name: 'Claude Opus 4.0', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'claude-sonnet-4-0', name: 'Claude Sonnet 4.0', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n {\n id: 'claude-3-5-sonnet-latest',\n name: 'Claude 3.5 Sonnet',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'claude-3-5-haiku-latest',\n name: 'Claude 3.5 Haiku',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'anthropic-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [{ label: 'Text Generation', value: 'text' }],\n },\n ],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'anthropic-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: AnthropicIcon,\n labels: {\n plural: 'Anthropic Providers',\n singular: 'Anthropic',\n },\n}\n\n"],"names":["AnthropicIcon","anthropicBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","max","min","RowLabel","initCollapsed","id","enabled","responseModalities","useCase","width","dbName","options","value","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,SAASA,aAAa,QAAQ,cAAa;AAE3C,OAAO,MAAMC,iBAAwB;IACnCC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aAAa;4BACf;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;qBACD;oBACDL,OAAO;gBACT;gBAEA,0BAA0B;gBAC1B;oBACEL,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLG,aAAa;4BACf;4BACAT,QAAQ;gCACN;oCACEG,MAAM;oCACNF,MAAM;oCACNG,cAAc;oCACdC,OAAO;oCACPM,KAAK;oCACLC,KAAK;gCACP;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNG,cAAc;oCACdC,OAAO;gCACT;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNI,OAAO;oCACPM,KAAK;oCACLC,KAAK;gCACP;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNI,OAAO;gCACT;6BACD;4BACDA,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;gBAEA,gBAAgB;gBAChB;oBACEL,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVM,UAAU;gCACZ;gCACAC,eAAe;4BACjB;4BACAV,cAAc;gCACZ;oCAAEW,IAAI;oCAAmBZ,MAAM;oCAAmBa,SAAS;oCAAMC,oBAAoB;wCAAC;qCAAO;oCAAEC,SAAS;gCAAO;gCAC/G;oCAAEH,IAAI;oCAAmBZ,MAAM;oCAAmBa,SAAS;oCAAMC,oBAAoB;wCAAC;qCAAO;oCAAEC,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B,UAAU3B;IACV4B,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ElevenLabsIcon } from '../icons.js';
|
|
1
2
|
export const elevenlabsBlock = {
|
|
2
3
|
slug: 'elevenlabs',
|
|
3
4
|
custom: {
|
|
@@ -308,7 +309,7 @@ export const elevenlabsBlock = {
|
|
|
308
309
|
RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
|
|
309
310
|
},
|
|
310
311
|
description: 'Configure TTS models. Use the Voices and Provider Options tabs for detailed settings.',
|
|
311
|
-
initCollapsed:
|
|
312
|
+
initCollapsed: true
|
|
312
313
|
},
|
|
313
314
|
defaultValue: [
|
|
314
315
|
{
|
|
@@ -438,7 +439,7 @@ export const elevenlabsBlock = {
|
|
|
438
439
|
]
|
|
439
440
|
}
|
|
440
441
|
],
|
|
441
|
-
imageURL:
|
|
442
|
+
imageURL: ElevenLabsIcon,
|
|
442
443
|
labels: {
|
|
443
444
|
plural: 'ElevenLabs Providers',
|
|
444
445
|
singular: 'ElevenLabs'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ai/providers/blocks/elevenlabs.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nexport const elevenlabsBlock: Block = {\n slug: 'elevenlabs',\n custom: {\n providerOptionsSchemas: {\n tts: {\n fields: [\n 'stability',\n 'similarity_boost',\n 'style',\n 'use_speaker_boost',\n 'seed',\n 'language_code',\n 'apply_text_normalization',\n 'apply_language_text_normalization',\n ],\n },\n },\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description:\n 'Your ElevenLabs API key. Will be encrypted in the database. Get yours at elevenlabs.io',\n },\n label: 'API Key',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Connection tab\n {\n fields: [\n {\n type: 'collapsible',\n admin: {\n initCollapsed: false,\n },\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://api.elevenlabs.io/v1).',\n },\n defaultValue: 'https://api.elevenlabs.io/v1',\n label: 'Base URL',\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description: 'Optional. Custom headers to send with every request.',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'key',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Name',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Value',\n required: true,\n },\n ],\n },\n ],\n label: 'Custom Headers',\n },\n ],\n label: 'API & Network Settings',\n },\n ],\n label: 'Connection',\n },\n\n // 3. Voices tab (Existing)\n {\n fields: [\n {\n name: 'voicesFetcherUI',\n type: 'ui',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#VoicesFetcher',\n },\n },\n },\n {\n name: 'voices',\n type: 'array',\n admin: {\n description:\n 'Use the \"Fetch Voices\" button above to populate this list from your ElevenLabs account.',\n initCollapsed: false,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID from ElevenLabs',\n width: '40%',\n },\n label: 'Voice ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '40%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '20%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'category',\n type: 'select',\n admin: {\n width: '50%',\n },\n dbName: 'eleven-voice-category',\n label: 'Category',\n options: [\n { label: 'Premade', value: 'premade' },\n { label: 'Cloned', value: 'cloned' },\n { label: 'Professional', value: 'professional' },\n { label: 'Generated', value: 'generated' },\n ],\n },\n {\n name: 'preview_url',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Preview URL',\n },\n ],\n },\n {\n name: 'labels',\n type: 'json',\n admin: {\n description:\n 'Voice attributes like gender, age, accent (JSON object). Example: {\"gender\": \"female\", \"age\": \"young\", \"accent\": \"american\"}',\n },\n label: 'Labels',\n },\n ],\n label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n // 4. Provider Options (NEW)\n {\n fields: [\n {\n name: 'ttsProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for ElevenLabs TTS.',\n },\n fields: [\n {\n name: 'voice_settings',\n type: 'group',\n fields: [\n {\n name: 'stability',\n type: 'number',\n defaultValue: 0.5,\n label: 'Default Stability',\n max: 1,\n min: 0,\n },\n {\n name: 'similarity_boost',\n type: 'number',\n defaultValue: 0.75,\n label: 'Default Similarity Boost',\n max: 1,\n min: 0,\n },\n {\n name: 'style',\n type: 'number',\n defaultValue: 0,\n label: 'Default Style',\n max: 1,\n min: 0,\n },\n {\n name: 'use_speaker_boost',\n type: 'checkbox',\n defaultValue: false,\n label: 'Use Speaker Boost',\n },\n ],\n label: 'Voice Settings',\n },\n {\n name: 'seed',\n type: 'number',\n label: 'Default Seed',\n max: 4294967295,\n min: 0,\n },\n {\n name: 'apply_text_normalization',\n type: 'select',\n dbName: 'eleven-tts-normalization',\n defaultValue: 'auto',\n label: 'Text Normalization',\n options: [\n { label: 'Auto', value: 'auto' },\n { label: 'On', value: 'on' },\n { label: 'Off', value: 'off' },\n ],\n },\n {\n name: 'language_code',\n type: 'text',\n admin: {\n placeholder: 'en',\n },\n label: 'Language Code',\n },\n ],\n label: 'TTS Provider Options',\n },\n ],\n label: 'Provider Options',\n },\n\n // 5. Models (SIMPLIFIED - no per-model settings)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n description:\n 'Configure TTS models. Use the Voices and Provider Options tabs for detailed settings.',\n initCollapsed: false,\n },\n defaultValue: [\n {\n id: 'eleven_flash_v2_5',\n name: 'Flash V2.5 (Fastest)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_turbo_v2_5',\n name: 'Turbo V2.5 (Latest)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_multilingual_v2',\n name: 'Multilingual V2',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_turbo_v2',\n name: 'Turbo V2',\n enabled: false,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Model ID (e.g., eleven_flash_v2_5)',\n width: '50%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Display Name',\n required: true,\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'eleven-model-useCase',\n defaultValue: 'tts',\n label: 'Use Case',\n options: [{ label: 'Text-to-Speech', value: 'tts' }],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '33%',\n },\n dbName: 'eleven-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '33%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: '/provider-icons/elevenlabs.webp',\n labels: {\n plural: 'ElevenLabs Providers',\n singular: 'ElevenLabs',\n },\n}\n"],"names":["elevenlabsBlock","slug","custom","providerOptionsSchemas","tts","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","dbName","options","value","max","min","placeholder","RowLabel","id","enabled","responseModalities","useCase","hasMany","labels","plural","singular","imageURL"],"mappings":"AAEA,OAAO,MAAMA,kBAAyB;IACpCC,MAAM;IACNC,QAAQ;QACNC,wBAAwB;YACtBC,KAAK;gBACHC,QAAQ;oBACN;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;iBACD;YACH;QACF;IACF;IACAA,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aACE;4BACJ;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;qBACD;oBACDL,OAAO;gBACT;gBAEA,oBAAoB;gBACpB;oBACEL,QAAQ;wBACN;4BACEC,MAAM;4BACNK,OAAO;gCACLK,eAAe;4BACjB;4BACAX,QAAQ;gCACN;oCACEG,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aACE;oCACJ;oCACAL,cAAc;oCACdC,OAAO;gCACT;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;oCACf;oCACAT,QAAQ;wCACN;4CACEC,MAAM;4CACND,QAAQ;gDACN;oDACEG,MAAM;oDACNF,MAAM;oDACNK,OAAO;wDACLM,OAAO;oDACT;oDACAP,OAAO;oDACPK,UAAU;gDACZ;gDACA;oDACEP,MAAM;oDACNF,MAAM;oDACNK,OAAO;wDACLM,OAAO;oDACT;oDACAP,OAAO;oDACPK,UAAU;gDACZ;6CACD;wCACH;qCACD;oCACDL,OAAO;gCACT;6BACD;4BACDA,OAAO;wBACT;qBACD;oBACDA,OAAO;g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;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/ai/providers/blocks/elevenlabs.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { ElevenLabsIcon } from '../icons.js'\n\nexport const elevenlabsBlock: Block = {\n slug: 'elevenlabs',\n custom: {\n providerOptionsSchemas: {\n tts: {\n fields: [\n 'stability',\n 'similarity_boost',\n 'style',\n 'use_speaker_boost',\n 'seed',\n 'language_code',\n 'apply_text_normalization',\n 'apply_language_text_normalization',\n ],\n },\n },\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description:\n 'Your ElevenLabs API key. Will be encrypted in the database. Get yours at elevenlabs.io',\n },\n label: 'API Key',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Connection tab\n {\n fields: [\n {\n type: 'collapsible',\n admin: {\n initCollapsed: false,\n },\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://api.elevenlabs.io/v1).',\n },\n defaultValue: 'https://api.elevenlabs.io/v1',\n label: 'Base URL',\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description: 'Optional. Custom headers to send with every request.',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'key',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Name',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Value',\n required: true,\n },\n ],\n },\n ],\n label: 'Custom Headers',\n },\n ],\n label: 'API & Network Settings',\n },\n ],\n label: 'Connection',\n },\n\n // 3. Voices tab (Existing)\n {\n fields: [\n {\n name: 'voicesFetcherUI',\n type: 'ui',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#VoicesFetcher',\n },\n },\n },\n {\n name: 'voices',\n type: 'array',\n admin: {\n description:\n 'Use the \"Fetch Voices\" button above to populate this list from your ElevenLabs account.',\n initCollapsed: false,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID from ElevenLabs',\n width: '40%',\n },\n label: 'Voice ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '40%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '20%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'category',\n type: 'select',\n admin: {\n width: '50%',\n },\n dbName: 'eleven-voice-category',\n label: 'Category',\n options: [\n { label: 'Premade', value: 'premade' },\n { label: 'Cloned', value: 'cloned' },\n { label: 'Professional', value: 'professional' },\n { label: 'Generated', value: 'generated' },\n ],\n },\n {\n name: 'preview_url',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Preview URL',\n },\n ],\n },\n {\n name: 'labels',\n type: 'json',\n admin: {\n description:\n 'Voice attributes like gender, age, accent (JSON object). Example: {\"gender\": \"female\", \"age\": \"young\", \"accent\": \"american\"}',\n },\n label: 'Labels',\n },\n ],\n label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n // 4. Provider Options (NEW)\n {\n fields: [\n {\n name: 'ttsProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for ElevenLabs TTS.',\n },\n fields: [\n {\n name: 'voice_settings',\n type: 'group',\n fields: [\n {\n name: 'stability',\n type: 'number',\n defaultValue: 0.5,\n label: 'Default Stability',\n max: 1,\n min: 0,\n },\n {\n name: 'similarity_boost',\n type: 'number',\n defaultValue: 0.75,\n label: 'Default Similarity Boost',\n max: 1,\n min: 0,\n },\n {\n name: 'style',\n type: 'number',\n defaultValue: 0,\n label: 'Default Style',\n max: 1,\n min: 0,\n },\n {\n name: 'use_speaker_boost',\n type: 'checkbox',\n defaultValue: false,\n label: 'Use Speaker Boost',\n },\n ],\n label: 'Voice Settings',\n },\n {\n name: 'seed',\n type: 'number',\n label: 'Default Seed',\n max: 4294967295,\n min: 0,\n },\n {\n name: 'apply_text_normalization',\n type: 'select',\n dbName: 'eleven-tts-normalization',\n defaultValue: 'auto',\n label: 'Text Normalization',\n options: [\n { label: 'Auto', value: 'auto' },\n { label: 'On', value: 'on' },\n { label: 'Off', value: 'off' },\n ],\n },\n {\n name: 'language_code',\n type: 'text',\n admin: {\n placeholder: 'en',\n },\n label: 'Language Code',\n },\n ],\n label: 'TTS Provider Options',\n },\n ],\n label: 'Provider Options',\n },\n\n // 5. Models (SIMPLIFIED - no per-model settings)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n description:\n 'Configure TTS models. Use the Voices and Provider Options tabs for detailed settings.',\n initCollapsed: true,\n },\n defaultValue: [\n {\n id: 'eleven_flash_v2_5',\n name: 'Flash V2.5 (Fastest)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_turbo_v2_5',\n name: 'Turbo V2.5 (Latest)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_multilingual_v2',\n name: 'Multilingual V2',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_turbo_v2',\n name: 'Turbo V2',\n enabled: false,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Model ID (e.g., eleven_flash_v2_5)',\n width: '50%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Display Name',\n required: true,\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'eleven-model-useCase',\n defaultValue: 'tts',\n label: 'Use Case',\n options: [{ label: 'Text-to-Speech', value: 'tts' }],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '33%',\n },\n dbName: 'eleven-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '33%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: ElevenLabsIcon,\n labels: {\n plural: 'ElevenLabs Providers',\n singular: 'ElevenLabs',\n },\n}\n"],"names":["ElevenLabsIcon","elevenlabsBlock","slug","custom","providerOptionsSchemas","tts","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","dbName","options","value","max","min","placeholder","RowLabel","id","enabled","responseModalities","useCase","hasMany","labels","plural","singular","imageURL"],"mappings":"AAEA,SAASA,cAAc,QAAQ,cAAa;AAE5C,OAAO,MAAMC,kBAAyB;IACpCC,MAAM;IACNC,QAAQ;QACNC,wBAAwB;YACtBC,KAAK;gBACHC,QAAQ;oBACN;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;iBACD;YACH;QACF;IACF;IACAA,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aACE;4BACJ;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;qBACD;oBACDL,OAAO;gBACT;gBAEA,oBAAoB;gBACpB;oBACEL,QAAQ;wBACN;4BACEC,MAAM;4BACNK,OAAO;gCACLK,eAAe;4BACjB;4BACAX,QAAQ;gCACN;oCACEG,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aACE;oCACJ;oCACAL,cAAc;oCACdC,OAAO;gCACT;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;oCACf;oCACAT,QAAQ;wCACN;4CACEC,MAAM;4CACND,QAAQ;gDACN;oDACEG,MAAM;oDACNF,MAAM;oDACNK,OAAO;wDACLM,OAAO;oDACT;oDACAP,OAAO;oDACPK,UAAU;gDACZ;gDACA;oDACEP,MAAM;oDACNF,MAAM;oDACNK,OAAO;wDACLM,OAAO;oDACT;oDACAP,OAAO;oDACPK,UAAU;gDACZ;6CACD;wCACH;qCACD;oCACDL,OAAO;gCACT;6BACD;4BACDA,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;gBAEA,2BAA2B;gBAC3B;oBACEL,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;4BACF;wBACF;wBACA;4BACEL,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLG,aACE;gCACFE,eAAe;4BACjB;4BACAX,QAAQ;gCACN;oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aAAa;gDACbG,OAAO;4CACT;4CACAP,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAP,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAR,cAAc;4CACdC,OAAO;wCACT;qCACD;gCACH;gCACA;oCACEJ,MAAM;oCACND,QAAQ;wCACN;4CACEG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cAAc;4CACdC,OAAO;4CACPS,SAAS;gDAAC;oDAAET,OAAO;oDAAkBU,OAAO;gDAAM;6CAAE;wCACtD;wCACA;4CACEZ,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aAAa;gDACbG,OAAO;4CACT;4CACAC,QAAQ;4CACRW,SAAS;4CACTnB,OAAO;4CACPS,SAAS;gDACP;oDAAET,OAAO;oDAAQU,OAAO;gDAAO;gDAC/B;oDAAEV,OAAO;oDAASU,OAAO;gDAAQ;6CAClC;wCACH;wCACA;4CACEZ,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAR,cAAc;4CACdC,OAAO;wCACT;qCACD;gCACH;6BACD;4BACDA,OAAO;4BACPoB,QAAQ;gCACNC,QAAQ;gCACRC,UAAU;4BACZ;wBACF;qBACD;oBACDtB,OAAO;gBACT;aACD;QACH;KACD;IACDuB,UAAUlC;IACV+B,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FalIcon } from '../icons.js';
|
|
1
2
|
export const falBlock = {
|
|
2
3
|
slug: 'fal',
|
|
3
4
|
fields: [
|
|
@@ -301,7 +302,7 @@ export const falBlock = {
|
|
|
301
302
|
]
|
|
302
303
|
}
|
|
303
304
|
],
|
|
304
|
-
imageURL:
|
|
305
|
+
imageURL: FalIcon,
|
|
305
306
|
labels: {
|
|
306
307
|
plural: 'Fal Providers',
|
|
307
308
|
singular: 'Fal AI'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ai/providers/blocks/fal.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nexport const falBlock: Block = {\n slug: 'fal',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description: 'Your Fal API key. Will be encrypted in the database.',\n },\n label: 'API Key',\n required: true,\n },\n {\n name: 'webhookSecret',\n type: 'text',\n admin: {\n description: 'Secret for webhook verification (optional)',\n },\n label: 'Webhook Secret',\n },\n ],\n label: 'Setup',\n },\n\n // 2. Provider Options tab\n {\n fields: [\n {\n name: 'imageProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for image generation models.',\n },\n fields: [\n {\n name: 'num_inference_steps',\n type: 'number',\n defaultValue: 28,\n label: 'Inference Steps',\n max: 100,\n min: 1,\n },\n {\n name: 'guidance_scale',\n type: 'number',\n defaultValue: 3.5,\n label: 'Guidance Scale',\n max: 20,\n min: 0,\n },\n {\n name: 'seed',\n type: 'number',\n admin: {\n description: 'Random seed for reproducible results',\n },\n label: 'Seed',\n },\n {\n name: 'image_size',\n type: 'select',\n dbName: 'fal-image-size',\n defaultValue: 'landscape_16_9',\n label: 'Image Size',\n options: [\n { label: 'Square (1:1)', value: 'square' },\n { label: 'Square HD', value: 'square_hd' },\n { label: 'Portrait 4:3', value: 'portrait_4_3' },\n { label: 'Portrait 16:9', value: 'portrait_16_9' },\n { label: 'Landscape 4:3', value: 'landscape_4_3' },\n { label: 'Landscape 16:9', value: 'landscape_16_9' },\n ],\n },\n {\n name: 'enable_safety_checker',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enable Safety Checker',\n },\n ],\n label: 'Image Provider Options',\n },\n {\n name: 'videoProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for video generation models.',\n },\n fields: [\n {\n name: 'duration',\n type: 'number',\n defaultValue: 5,\n label: 'Duration (seconds)',\n max: 60,\n min: 1,\n },\n {\n name: 'aspect_ratio',\n type: 'select',\n dbName: 'fal-video-aspectRatio',\n defaultValue: '16:9',\n label: 'Aspect Ratio',\n options: [\n { label: '16:9', value: '16:9' },\n { label: '9:16', value: '9:16' },\n { label: '1:1', value: '1:1' },\n ],\n },\n ],\n label: 'Video Provider Options',\n },\n ],\n label: 'Provider Options',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n initCollapsed: true,\n },\n defaultValue: [\n { id: 'fal-ai/flux-pro', name: 'Flux Pro', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux/dev', name: 'Flux Dev', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux/schnell', name: 'Flux Schnell', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux-realism', name: 'Flux Realism', enabled: true, useCase: 'image' },\n { id: 'fal-ai/minimax-video', name: 'Minimax Video', enabled: true, useCase: 'video' },\n { id: 'fal-ai/hunyuan-video', name: 'Hunyuan Video', enabled: true, useCase: 'video' },\n {\n id: 'fal-ai/luma-dream-machine',\n name: 'Luma Dream Machine',\n enabled: true,\n useCase: 'video',\n },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'fal-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Image Generation', value: 'image' },\n { label: 'Video Generation', value: 'video' },\n ],\n required: true,\n },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'fal-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n { label: 'Video', value: 'VIDEO' },\n ],\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: '/provider-icons/fai-ai.webp',\n labels: {\n plural: 'Fal Providers',\n singular: 'Fal AI',\n },\n}\n\n"],"names":["falBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","max","min","dbName","options","value","RowLabel","initCollapsed","id","enabled","useCase","width","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,OAAO,MAAMA,WAAkB;IAC7BC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aAAa;4BACf;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;wBACA;4BACEP,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLG,aAAa;4BACf;4BACAJ,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;gBAEA,0BAA0B;gBAC1B;oBACEL,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLG,aAAa;4BACf;4BACAT,QAAQ;gCACN;oCACEG,MAAM;oCACNF,MAAM;oCACNG,cAAc;oCACdC,OAAO;oCACPM,KAAK;oCACLC,KAAK;gCACP;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNG,cAAc;oCACdC,OAAO;oCACPM,KAAK;oCACLC,KAAK;gCACP;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;oCACf;oCACAJ,OAAO;gCACT;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNY,QAAQ;oCACRT,cAAc;oCACdC,OAAO;oCACPS,SAAS;wCACP;4CAAET,OAAO;4CAAgBU,OAAO;wCAAS;wCACzC;4CAAEV,OAAO;4CAAaU,OAAO;wCAAY;wCACzC;4CAAEV,OAA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+
{"version":3,"sources":["../../../../src/ai/providers/blocks/fal.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { FalIcon } from '../icons.js'\n\nexport const falBlock: Block = {\n slug: 'fal',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description: 'Your Fal API key. Will be encrypted in the database.',\n },\n label: 'API Key',\n required: true,\n },\n {\n name: 'webhookSecret',\n type: 'text',\n admin: {\n description: 'Secret for webhook verification (optional)',\n },\n label: 'Webhook Secret',\n },\n ],\n label: 'Setup',\n },\n\n // 2. Provider Options tab\n {\n fields: [\n {\n name: 'imageProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for image generation models.',\n },\n fields: [\n {\n name: 'num_inference_steps',\n type: 'number',\n defaultValue: 28,\n label: 'Inference Steps',\n max: 100,\n min: 1,\n },\n {\n name: 'guidance_scale',\n type: 'number',\n defaultValue: 3.5,\n label: 'Guidance Scale',\n max: 20,\n min: 0,\n },\n {\n name: 'seed',\n type: 'number',\n admin: {\n description: 'Random seed for reproducible results',\n },\n label: 'Seed',\n },\n {\n name: 'image_size',\n type: 'select',\n dbName: 'fal-image-size',\n defaultValue: 'landscape_16_9',\n label: 'Image Size',\n options: [\n { label: 'Square (1:1)', value: 'square' },\n { label: 'Square HD', value: 'square_hd' },\n { label: 'Portrait 4:3', value: 'portrait_4_3' },\n { label: 'Portrait 16:9', value: 'portrait_16_9' },\n { label: 'Landscape 4:3', value: 'landscape_4_3' },\n { label: 'Landscape 16:9', value: 'landscape_16_9' },\n ],\n },\n {\n name: 'enable_safety_checker',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enable Safety Checker',\n },\n ],\n label: 'Image Provider Options',\n },\n {\n name: 'videoProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for video generation models.',\n },\n fields: [\n {\n name: 'duration',\n type: 'number',\n defaultValue: 5,\n label: 'Duration (seconds)',\n max: 60,\n min: 1,\n },\n {\n name: 'aspect_ratio',\n type: 'select',\n dbName: 'fal-video-aspectRatio',\n defaultValue: '16:9',\n label: 'Aspect Ratio',\n options: [\n { label: '16:9', value: '16:9' },\n { label: '9:16', value: '9:16' },\n { label: '1:1', value: '1:1' },\n ],\n },\n ],\n label: 'Video Provider Options',\n },\n ],\n label: 'Provider Options',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n initCollapsed: true,\n },\n defaultValue: [\n { id: 'fal-ai/flux-pro', name: 'Flux Pro', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux/dev', name: 'Flux Dev', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux/schnell', name: 'Flux Schnell', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux-realism', name: 'Flux Realism', enabled: true, useCase: 'image' },\n { id: 'fal-ai/minimax-video', name: 'Minimax Video', enabled: true, useCase: 'video' },\n { id: 'fal-ai/hunyuan-video', name: 'Hunyuan Video', enabled: true, useCase: 'video' },\n {\n id: 'fal-ai/luma-dream-machine',\n name: 'Luma Dream Machine',\n enabled: true,\n useCase: 'video',\n },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'fal-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Image Generation', value: 'image' },\n { label: 'Video Generation', value: 'video' },\n ],\n required: true,\n },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'fal-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n { label: 'Video', value: 'VIDEO' },\n ],\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: FalIcon,\n labels: {\n plural: 'Fal Providers',\n singular: 'Fal AI',\n },\n}\n\n"],"names":["FalIcon","falBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","max","min","dbName","options","value","RowLabel","initCollapsed","id","enabled","useCase","width","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,SAASA,OAAO,QAAQ,cAAa;AAErC,OAAO,MAAMC,WAAkB;IAC7BC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aAAa;4BACf;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;wBACA;4BACEP,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLG,aAAa;4BACf;4BACAJ,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;gBAEA,0BAA0B;gBAC1B;oBACEL,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLG,aAAa;4BACf;4BACAT,QAAQ;gCACN;oCACEG,MAAM;oCACNF,MAAM;oCACNG,cAAc;oCACdC,OAAO;oCACPM,KAAK;oCACLC,KAAK;gCACP;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNG,cAAc;oCACdC,OAAO;oCAC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