@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GoogleIcon } from '../icons.js';
|
|
1
2
|
export const googleBlock = {
|
|
2
3
|
slug: 'google',
|
|
3
4
|
custom: {
|
|
@@ -417,7 +418,7 @@ export const googleBlock = {
|
|
|
417
418
|
RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
|
|
418
419
|
},
|
|
419
420
|
description: 'Keep this list short. Enable only the models you actually use.',
|
|
420
|
-
initCollapsed:
|
|
421
|
+
initCollapsed: true
|
|
421
422
|
},
|
|
422
423
|
defaultValue: [
|
|
423
424
|
// Text models
|
|
@@ -468,15 +469,19 @@ export const googleBlock = {
|
|
|
468
469
|
},
|
|
469
470
|
// Image models
|
|
470
471
|
{
|
|
471
|
-
id: '
|
|
472
|
-
name: '
|
|
472
|
+
id: 'gemini-2.5-flash-image',
|
|
473
|
+
name: 'Gemini 2.5 Flash Image',
|
|
473
474
|
enabled: true,
|
|
475
|
+
responseModalities: [
|
|
476
|
+
'IMAGE'
|
|
477
|
+
],
|
|
474
478
|
useCase: 'image'
|
|
475
479
|
},
|
|
476
480
|
{
|
|
477
|
-
id: '
|
|
478
|
-
name: '
|
|
481
|
+
id: 'imagen-4.0-generate-001',
|
|
482
|
+
name: 'Imagen 4',
|
|
479
483
|
enabled: true,
|
|
484
|
+
// TODO: fix this with proper definition for multimodel or image model only
|
|
480
485
|
responseModalities: [
|
|
481
486
|
'IMAGE'
|
|
482
487
|
],
|
|
@@ -612,7 +617,7 @@ export const googleBlock = {
|
|
|
612
617
|
]
|
|
613
618
|
}
|
|
614
619
|
],
|
|
615
|
-
imageURL:
|
|
620
|
+
imageURL: GoogleIcon,
|
|
616
621
|
labels: {
|
|
617
622
|
plural: 'Google Providers',
|
|
618
623
|
singular: 'Google Gemini'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ai/providers/blocks/google.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nexport const googleBlock: Block = {\n slug: 'google',\n custom: {\n providerOptionsSchemas: {\n image: {\n fields: ['aspectRatio', 'personGeneration', 'seed', 'addWatermark'],\n },\n text: {\n fields: ['temperature', 'maxOutputTokens', 'topP', 'topK', 'safetySettings'],\n },\n tts: {\n fields: ['speed', 'volumeGainDb', 'speakingRate'],\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 'Optional. If empty, @ai-sdk/google will use the GOOGLE_GENERATIVE_AI_API_KEY environment variable.',\n },\n label: 'API Key',\n required: false,\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 type: 'row',\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://generativelanguage.googleapis.com/v1beta).',\n },\n label: 'Base URL',\n },\n ],\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description:\n 'Optional. Extra headers to send with every request, for example routing through a proxy.',\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 (NEW)\n {\n fields: [\n {\n name: 'voices',\n type: 'array',\n admin: {\n description: 'Available voices for Gemini TTS models.',\n initCollapsed: false,\n },\n defaultValue: [\n { id: 'Puck', name: 'Puck (Upbeat)', enabled: true },\n { id: 'Charon', name: 'Charon (Informative)', enabled: true },\n { id: 'Kore', name: 'Kore (Firm)', enabled: true },\n { id: 'Fenrir', name: 'Fenrir (Excitable)', enabled: true },\n { id: 'Aoede', name: 'Aoede (Breezy)', enabled: true },\n { id: 'Zephyr', name: 'Zephyr (Bright)', enabled: true },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID used by Google API',\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 label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n // 4. Provider Options (NEW - One group per use case)\n {\n fields: [\n // TTS Settings\n {\n name: 'ttsProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for TTS models.',\n },\n fields: [\n {\n name: 'speed',\n type: 'number',\n defaultValue: 1.0,\n label: 'Speaking Rate',\n max: 4.0,\n min: 0.25,\n },\n {\n name: 'volumeGainDb',\n type: 'number',\n defaultValue: 0,\n label: 'Volume Gain (dB)',\n },\n ],\n label: 'TTS Provider Options',\n },\n\n // Image Settings\n {\n name: 'imageProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for image generation models.',\n },\n fields: [\n {\n name: 'aspectRatio',\n type: 'select',\n dbName: 'google-image-aspectRatio',\n defaultValue: '1:1',\n label: 'Default Aspect Ratio',\n options: [\n { label: '1:1 (Square)', value: '1:1' },\n { label: '16:9 (Landscape)', value: '16:9' },\n { label: '9:16 (Portrait)', value: '9:16' },\n { label: '4:3', value: '4:3' },\n { label: '3:4', value: '3:4' },\n ],\n },\n {\n name: 'personGeneration',\n type: 'select',\n dbName: 'google-image-personGeneration',\n defaultValue: 'allow_adult',\n label: 'Person Generation (Imagen)',\n options: [\n { label: 'Allow Adults Only', value: 'allow_adult' },\n { label: 'Allow All', value: 'allow_all' },\n { label: 'Do Not Allow', value: 'dont_allow' },\n ],\n },\n {\n name: 'addWatermark',\n type: 'checkbox',\n defaultValue: true,\n label: 'Add SynthID Watermark',\n },\n ],\n label: 'Image Provider Options',\n },\n\n // Text Settings\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: 2.0,\n min: 0.0,\n },\n {\n name: 'maxOutputTokens',\n type: 'number',\n label: 'Max Output Tokens',\n },\n {\n name: 'topP',\n type: 'number',\n defaultValue: 0.95,\n label: 'Top P',\n max: 1.0,\n min: 0.0,\n },\n {\n name: 'topK',\n type: 'number',\n defaultValue: 40,\n label: 'Top K',\n },\n {\n name: 'safetySettings',\n type: 'array',\n admin: {\n description: 'Safety filter settings',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'category',\n type: 'select',\n admin: {\n width: '50%',\n },\n dbName: 'google-safety-category',\n label: 'Category',\n options: [\n { label: 'Harassment', value: 'HARM_CATEGORY_HARASSMENT' },\n { label: 'Hate Speech', value: 'HARM_CATEGORY_HATE_SPEECH' },\n { label: 'Sexually Explicit', value: 'HARM_CATEGORY_SEXUALLY_EXPLICIT' },\n { label: 'Dangerous Content', value: 'HARM_CATEGORY_DANGEROUS_CONTENT' },\n ],\n required: true,\n },\n {\n name: 'threshold',\n type: 'select',\n admin: {\n width: '50%',\n },\n dbName: 'google-safety-threshold',\n label: 'Threshold',\n options: [\n { label: 'Block None', value: 'BLOCK_NONE' },\n { label: 'Block Low+', value: 'BLOCK_LOW_AND_ABOVE' },\n { label: 'Block Medium+', value: 'BLOCK_MEDIUM_AND_ABOVE' },\n { label: 'Block High', value: 'BLOCK_ONLY_HIGH' },\n ],\n required: true,\n },\n ],\n },\n ],\n label: 'Default Safety Settings',\n },\n ],\n label: 'Text Provider Options',\n },\n ],\n label: 'Provider Options',\n },\n\n // 5. Models tab (Simplified)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n description: 'Keep this list short. Enable only the models you actually use.',\n initCollapsed: false,\n },\n defaultValue: [\n // Text models\n {\n id: 'gemini-3-pro-preview',\n name: 'Gemini 3.0 Pro (Preview)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-2.5-pro',\n name: 'Gemini 2.5 Pro',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-2.5-flash',\n name: 'Gemini 2.5 Flash',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-1.5-pro-latest',\n name: 'Gemini 1.5 Pro (Latest)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-1.5-flash-latest',\n name: 'Gemini 1.5 Flash (Latest)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n\n // Image models\n {\n id: 'imagen-3.0-generate-002',\n name: 'Imagen 3 (Fast)',\n enabled: true,\n useCase: 'image',\n },\n {\n id: 'gemini-2.5-flash-image',\n name: 'Gemini 2.5 Flash Image',\n enabled: true,\n responseModalities: ['IMAGE'],\n useCase: 'image',\n },\n {\n id: 'gemini-3-pro-image-preview',\n name: 'Gemini 3.0 Pro Image (Preview)',\n enabled: true,\n responseModalities: ['IMAGE'],\n useCase: 'image',\n },\n\n // TTS Models\n {\n id: 'gemini-2.5-pro-preview-tts',\n name: 'Gemini 2.5 Pro TTS (Preview)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'gemini-2.5-flash-preview-tts',\n name: 'Gemini 2.5 Flash TTS (Preview)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic model info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description:\n 'Exact model id as used with @ai-sdk/google.',\n width: '33%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '33%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'google-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Text-to-Speech', value: 'tts' },\n { label: 'Embeddings', value: 'embedding' },\n ],\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: 'google-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 labels: {\n plural: 'Models',\n singular: 'Model',\n },\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: '/provider-icons/google-gemini.webp',\n labels: {\n plural: 'Google Providers',\n singular: 'Google Gemini',\n },\n}\n"],"names":["googleBlock","slug","custom","providerOptionsSchemas","image","fields","text","tts","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","id","enabled","max","min","dbName","options","value","RowLabel","responseModalities","useCase","hasMany","labels","plural","singular","imageURL"],"mappings":"AAEA,OAAO,MAAMA,cAAqB;IAChCC,MAAM;IACNC,QAAQ;QACNC,wBAAwB;YACtBC,OAAO;gB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QAAQ;oCACRM,SAAS;oCACTlB,OAAO;oCACPa,SAAS;wCACP;4CAAEb,OAAO;4CAAQc,OAAO;wCAAO;wCAC/B;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;wCACjC;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEhB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLM,OAAO;oCACT;oCACAR,cAAc;oCACdC,OAAO;gCACT;6BACD;4BACDA,OAAO;4BACPmB,QAAQ;gCACNC,QAAQ;gCACRC,UAAU;4BACZ;wBACF;qBACD;oBACDrB,OAAO;gBACT;aACD;QACH;KACD;IACDsB,UAAU;IACVH,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/ai/providers/blocks/google.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { GoogleIcon } from '../icons.js'\n\nexport const googleBlock: Block = {\n slug: 'google',\n custom: {\n providerOptionsSchemas: {\n image: {\n fields: ['aspectRatio', 'personGeneration', 'seed', 'addWatermark'],\n },\n text: {\n fields: ['temperature', 'maxOutputTokens', 'topP', 'topK', 'safetySettings'],\n },\n tts: {\n fields: ['speed', 'volumeGainDb', 'speakingRate'],\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 'Optional. If empty, @ai-sdk/google will use the GOOGLE_GENERATIVE_AI_API_KEY environment variable.',\n },\n label: 'API Key',\n required: false,\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 type: 'row',\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://generativelanguage.googleapis.com/v1beta).',\n },\n label: 'Base URL',\n },\n ],\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description:\n 'Optional. Extra headers to send with every request, for example routing through a proxy.',\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 (NEW)\n {\n fields: [\n {\n name: 'voices',\n type: 'array',\n admin: {\n description: 'Available voices for Gemini TTS models.',\n initCollapsed: false,\n },\n defaultValue: [\n { id: 'Puck', name: 'Puck (Upbeat)', enabled: true },\n { id: 'Charon', name: 'Charon (Informative)', enabled: true },\n { id: 'Kore', name: 'Kore (Firm)', enabled: true },\n { id: 'Fenrir', name: 'Fenrir (Excitable)', enabled: true },\n { id: 'Aoede', name: 'Aoede (Breezy)', enabled: true },\n { id: 'Zephyr', name: 'Zephyr (Bright)', enabled: true },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID used by Google API',\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 label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n // 4. Provider Options (NEW - One group per use case)\n {\n fields: [\n // TTS Settings\n {\n name: 'ttsProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for TTS models.',\n },\n fields: [\n {\n name: 'speed',\n type: 'number',\n defaultValue: 1.0,\n label: 'Speaking Rate',\n max: 4.0,\n min: 0.25,\n },\n {\n name: 'volumeGainDb',\n type: 'number',\n defaultValue: 0,\n label: 'Volume Gain (dB)',\n },\n ],\n label: 'TTS Provider Options',\n },\n\n // Image Settings\n {\n name: 'imageProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for image generation models.',\n },\n fields: [\n {\n name: 'aspectRatio',\n type: 'select',\n dbName: 'google-image-aspectRatio',\n defaultValue: '1:1',\n label: 'Default Aspect Ratio',\n options: [\n { label: '1:1 (Square)', value: '1:1' },\n { label: '16:9 (Landscape)', value: '16:9' },\n { label: '9:16 (Portrait)', value: '9:16' },\n { label: '4:3', value: '4:3' },\n { label: '3:4', value: '3:4' },\n ],\n },\n {\n name: 'personGeneration',\n type: 'select',\n dbName: 'google-image-personGeneration',\n defaultValue: 'allow_adult',\n label: 'Person Generation (Imagen)',\n options: [\n { label: 'Allow Adults Only', value: 'allow_adult' },\n { label: 'Allow All', value: 'allow_all' },\n { label: 'Do Not Allow', value: 'dont_allow' },\n ],\n },\n {\n name: 'addWatermark',\n type: 'checkbox',\n defaultValue: true,\n label: 'Add SynthID Watermark',\n },\n ],\n label: 'Image Provider Options',\n },\n\n // Text Settings\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: 2.0,\n min: 0.0,\n },\n {\n name: 'maxOutputTokens',\n type: 'number',\n label: 'Max Output Tokens',\n },\n {\n name: 'topP',\n type: 'number',\n defaultValue: 0.95,\n label: 'Top P',\n max: 1.0,\n min: 0.0,\n },\n {\n name: 'topK',\n type: 'number',\n defaultValue: 40,\n label: 'Top K',\n },\n {\n name: 'safetySettings',\n type: 'array',\n admin: {\n description: 'Safety filter settings',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'category',\n type: 'select',\n admin: {\n width: '50%',\n },\n dbName: 'google-safety-category',\n label: 'Category',\n options: [\n { label: 'Harassment', value: 'HARM_CATEGORY_HARASSMENT' },\n { label: 'Hate Speech', value: 'HARM_CATEGORY_HATE_SPEECH' },\n {\n label: 'Sexually Explicit',\n value: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',\n },\n {\n label: 'Dangerous Content',\n value: 'HARM_CATEGORY_DANGEROUS_CONTENT',\n },\n ],\n required: true,\n },\n {\n name: 'threshold',\n type: 'select',\n admin: {\n width: '50%',\n },\n dbName: 'google-safety-threshold',\n label: 'Threshold',\n options: [\n { label: 'Block None', value: 'BLOCK_NONE' },\n { label: 'Block Low+', value: 'BLOCK_LOW_AND_ABOVE' },\n { label: 'Block Medium+', value: 'BLOCK_MEDIUM_AND_ABOVE' },\n { label: 'Block High', value: 'BLOCK_ONLY_HIGH' },\n ],\n required: true,\n },\n ],\n },\n ],\n label: 'Default Safety Settings',\n },\n ],\n label: 'Text Provider Options',\n },\n ],\n label: 'Provider Options',\n },\n\n // 5. Models tab (Simplified)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n description: 'Keep this list short. Enable only the models you actually use.',\n initCollapsed: true,\n },\n defaultValue: [\n // Text models\n {\n id: 'gemini-3-pro-preview',\n name: 'Gemini 3.0 Pro (Preview)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-2.5-pro',\n name: 'Gemini 2.5 Pro',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-2.5-flash',\n name: 'Gemini 2.5 Flash',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-1.5-pro-latest',\n name: 'Gemini 1.5 Pro (Latest)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-1.5-flash-latest',\n name: 'Gemini 1.5 Flash (Latest)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n\n // Image models\n {\n id: 'gemini-2.5-flash-image',\n name: 'Gemini 2.5 Flash Image',\n enabled: true,\n responseModalities: ['IMAGE'],\n useCase: 'image',\n },\n {\n id: 'imagen-4.0-generate-001',\n name: 'Imagen 4',\n enabled: true,\n // TODO: fix this with proper definition for multimodel or image model only\n responseModalities: ['IMAGE'],\n useCase: 'image',\n },\n {\n id: 'gemini-3-pro-image-preview',\n name: 'Gemini 3.0 Pro Image (Preview)',\n enabled: true,\n responseModalities: ['IMAGE'],\n useCase: 'image',\n },\n\n // TTS Models\n {\n id: 'gemini-2.5-pro-preview-tts',\n name: 'Gemini 2.5 Pro TTS (Preview)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'gemini-2.5-flash-preview-tts',\n name: 'Gemini 2.5 Flash TTS (Preview)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic model info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Exact model id as used with @ai-sdk/google.',\n width: '33%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '33%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'google-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Text-to-Speech', value: 'tts' },\n { label: 'Embeddings', value: 'embedding' },\n ],\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: 'google-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 labels: {\n plural: 'Models',\n singular: 'Model',\n },\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: GoogleIcon,\n labels: {\n plural: 'Google Providers',\n singular: 'Google Gemini',\n },\n}\n"],"names":["GoogleIcon","googleBlock","slug","custom","providerOptionsSchemas","image","fields","text","tts","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","id","enabled","max","min","dbName","options","value","RowLabel","responseModalities","useCase","hasMany","labels","plural","singular","imageURL"],"mappings":"AAEA,SAASA,UAAU,QAAQ,cAAa;AAExC,OAAO,MAAMC,cAAqB;IAChCC,MAAM;IACNC,QAAQ;QACNC,wBAAwB;YACtBC,OAAO;gBACLC,QAAQ;oBAAC;oBAAe;oBAAoB;oBAAQ;iBAAe;YACrE;YACAC,MAAM;gBACJD,QAAQ;oBAAC;oBAAe;oBAAmB;oBAAQ;oBAAQ;iBAAiB;YAC9E;YACAE,KAAK;gBACHF,QAAQ;oBAAC;oBAAS;oBAAgB;iBAAe;YACnD;QACF;IACF;IACAA,QAAQ;QACN;YACEG,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEJ,QAAQ;wBACN;4BACEK,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;oBACEP,QAAQ;wBACN;4BACEG,MAAM;4BACNK,OAAO;gCACLK,eAAe;4BACjB;4BACAb,QAAQ;gCACN;oCACEG,MAAM;oCACNH,QAAQ;wCACN;4CACEK,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aACE;4CACJ;4CACAJ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CACT;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;4CACAK,QAAQ;4CACRb,cAAc;4CACdC,OAAO;4CACPa,SAAS;gDACP;oDAAEb,OAAO;oDAAQc,OAAO;gDAAO;gDAC/B;oDAAEd,OAAO;oDAAoBc,OAAO;gDAAQ;gDAC5C;oDAAEd,OAAO;oDAAkBc,OAAO;gDAAM;gDACxC;oDAAEd,OAAO;oDAAcc,OAAO;gDAAY;6CAC3C;wCACH;qCACD;gCACH;gCACA;oCACEhB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbG,OAAO;oCACT;oCACAK,QAAQ;oCACRM,SAAS;oCACTlB,OAAO;oCACPa,SAAS;wCACP;4CAAEb,OAAO;4CAAQc,OAAO;wCAAO;wCAC/B;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;wCACjC;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEhB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLM,OAAO;oCACT;oCACAR,cAAc;oCACdC,OAAO;gCACT;6BACD;4BACDA,OAAO;4BACPmB,QAAQ;gCACNC,QAAQ;gCACRC,UAAU;4BACZ;wBACF;qBACD;oBACDrB,OAAO;gBACT;aACD;QACH;KACD;IACDsB,UAAUnC;IACVgC,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CustomProviderIcon } from '../icons.js';
|
|
1
2
|
export const openaiCompatibleBlock = {
|
|
2
3
|
slug: 'openai-compatible',
|
|
3
4
|
fields: [
|
|
@@ -297,7 +298,7 @@ export const openaiCompatibleBlock = {
|
|
|
297
298
|
]
|
|
298
299
|
}
|
|
299
300
|
],
|
|
300
|
-
imageURL:
|
|
301
|
+
imageURL: CustomProviderIcon,
|
|
301
302
|
labels: {
|
|
302
303
|
plural: 'Custom Providers',
|
|
303
304
|
singular: 'Custom Provider'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ai/providers/blocks/openai-compatible.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nexport const openaiCompatibleBlock: Block = {\n slug: 'openai-compatible',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'providerName',\n type: 'text',\n admin: {\n description: 'Display name for this custom provider (e.g., \"Ollama\", \"Together AI\")',\n },\n label: 'Provider Name',\n required: true,\n },\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: 'API key for this provider (if required)',\n },\n label: 'API Key',\n required: true,\n },\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description: 'OpenAI-compatible API endpoint (e.g., http://localhost:11434/v1)',\n },\n label: 'API Base URL',\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: 2,\n min: 0,\n },\n {\n name: 'max_tokens',\n type: 'number',\n label: 'Max Tokens',\n },\n {\n name: 'top_p',\n type: 'number',\n defaultValue: 1.0,\n label: 'Top P',\n max: 1,\n min: 0,\n },\n {\n name: 'frequency_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Frequency Penalty',\n max: 2,\n min: -2,\n },\n {\n name: 'presence_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Presence Penalty',\n max: 2,\n min: -2,\n },\n ],\n label: 'Text Provider Options',\n },\n {\n name: 'imageProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for image generation models.',\n },\n fields: [\n {\n name: 'quality',\n type: 'select',\n dbName: 'compat-image-quality',\n defaultValue: 'standard',\n label: 'Quality',\n options: [\n { label: 'Standard', value: 'standard' },\n { label: 'HD', value: 'hd' },\n ],\n },\n {\n name: 'style',\n type: 'select',\n dbName: 'compat-image-style',\n defaultValue: 'vivid',\n label: 'Style',\n options: [\n { label: 'Vivid', value: 'vivid' },\n { label: 'Natural', value: 'natural' },\n ],\n },\n ],\n label: 'Image Provider Options',\n },\n {\n name: 'ttsProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for TTS models.',\n },\n fields: [\n {\n name: 'speed',\n type: 'number',\n defaultValue: 1.0,\n label: 'Speed',\n max: 4,\n min: 0.25,\n },\n {\n name: 'response_format',\n type: 'select',\n dbName: 'compat-tts-format',\n defaultValue: 'mp3',\n label: 'Response Format',\n options: [\n { label: 'MP3', value: 'mp3' },\n { label: 'Opus', value: 'opus' },\n { label: 'AAC', value: 'aac' },\n { label: 'FLAC', value: 'flac' },\n { label: 'WAV', value: 'wav' },\n ],\n },\n ],\n label: 'TTS 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 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: 'compat-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Text Generation', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Video Generation', value: 'video' },\n { label: 'Text-to-Speech', value: 'tts' },\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: 'compat-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 label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: '/provider-icons/custom-provider.png',\n labels: {\n plural: 'Custom Providers',\n singular: 'Custom Provider',\n },\n}\n\n"],"names":["openaiCompatibleBlock","slug","fields","type","tabs","name","admin","description","label","required","defaultValue","components","Field","max","min","dbName","options","value","RowLabel","initCollapsed","width","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,OAAO,MAAMA,wBAA+B;IAC1CC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;wBACA;4BACEJ,MAAM;4BACNF,MAAM;4BACNO,cAAc;4BACdF,OAAO;wBACT;wBACA;4BACEH,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLK,YAAY;oCACVC,OAAO;gCACT;gCACAL,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;wBACA;4BACEJ,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;qBACD;oBACDD,OAAO;gBACT;gBAEA,0BAA0B;gBAC1B;oBACEN,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAL,QAAQ;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B;4CAAET,OAAO;4CAASS,OAAO;wCAAQ;wCACjC;4CAAET,OAAO;4CAASS,OAAO;wCAAQ;qCAClC;gCACH;6BACD;4BACDT,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDc,UAAU;IACVC,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/ai/providers/blocks/openai-compatible.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { CustomProviderIcon } from '../icons.js'\n\nexport const openaiCompatibleBlock: Block = {\n slug: 'openai-compatible',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'providerName',\n type: 'text',\n admin: {\n description: 'Display name for this custom provider (e.g., \"Ollama\", \"Together AI\")',\n },\n label: 'Provider Name',\n required: true,\n },\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: 'API key for this provider (if required)',\n },\n label: 'API Key',\n required: true,\n },\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description: 'OpenAI-compatible API endpoint (e.g., http://localhost:11434/v1)',\n },\n label: 'API Base URL',\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: 2,\n min: 0,\n },\n {\n name: 'max_tokens',\n type: 'number',\n label: 'Max Tokens',\n },\n {\n name: 'top_p',\n type: 'number',\n defaultValue: 1.0,\n label: 'Top P',\n max: 1,\n min: 0,\n },\n {\n name: 'frequency_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Frequency Penalty',\n max: 2,\n min: -2,\n },\n {\n name: 'presence_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Presence Penalty',\n max: 2,\n min: -2,\n },\n ],\n label: 'Text Provider Options',\n },\n {\n name: 'imageProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for image generation models.',\n },\n fields: [\n {\n name: 'quality',\n type: 'select',\n dbName: 'compat-image-quality',\n defaultValue: 'standard',\n label: 'Quality',\n options: [\n { label: 'Standard', value: 'standard' },\n { label: 'HD', value: 'hd' },\n ],\n },\n {\n name: 'style',\n type: 'select',\n dbName: 'compat-image-style',\n defaultValue: 'vivid',\n label: 'Style',\n options: [\n { label: 'Vivid', value: 'vivid' },\n { label: 'Natural', value: 'natural' },\n ],\n },\n ],\n label: 'Image Provider Options',\n },\n {\n name: 'ttsProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for TTS models.',\n },\n fields: [\n {\n name: 'speed',\n type: 'number',\n defaultValue: 1.0,\n label: 'Speed',\n max: 4,\n min: 0.25,\n },\n {\n name: 'response_format',\n type: 'select',\n dbName: 'compat-tts-format',\n defaultValue: 'mp3',\n label: 'Response Format',\n options: [\n { label: 'MP3', value: 'mp3' },\n { label: 'Opus', value: 'opus' },\n { label: 'AAC', value: 'aac' },\n { label: 'FLAC', value: 'flac' },\n { label: 'WAV', value: 'wav' },\n ],\n },\n ],\n label: 'TTS 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 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: 'compat-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Text Generation', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Video Generation', value: 'video' },\n { label: 'Text-to-Speech', value: 'tts' },\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: 'compat-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 label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: CustomProviderIcon,\n labels: {\n plural: 'Custom Providers',\n singular: 'Custom Provider',\n },\n}\n\n"],"names":["CustomProviderIcon","openaiCompatibleBlock","slug","fields","type","tabs","name","admin","description","label","required","defaultValue","components","Field","max","min","dbName","options","value","RowLabel","initCollapsed","width","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,SAASA,kBAAkB,QAAQ,cAAa;AAEhD,OAAO,MAAMC,wBAA+B;IAC1CC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;wBACA;4BACEJ,MAAM;4BACNF,MAAM;4BACNO,cAAc;4BACdF,OAAO;wBACT;wBACA;4BACEH,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLK,YAAY;oCACVC,OAAO;gCACT;gCACAL,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;wBACA;4BACEJ,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;qBACD;oBACDD,OAAO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AAa;wCACba,OAAO;oCACT;oCACAL,QAAQ;oCACRM,SAAS;oCACTb,OAAO;oCACPQ,SAAS;wCACP;4CAAER,OAAO;4CAAQS,OAAO;wCAAO;wCAC/B;4CAAET,OAAO;4CAASS,OAAO;wCAAQ;wCACjC;4CAAET,OAAO;4CAASS,OAAO;wCAAQ;qCAClC;gCACH;6BACD;4BACDT,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDc,UAAUvB;IACVwB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OpenAIIcon } from '../icons.js';
|
|
1
2
|
export const openaiBlock = {
|
|
2
3
|
slug: 'openai',
|
|
3
4
|
custom: {
|
|
@@ -404,7 +405,7 @@ export const openaiBlock = {
|
|
|
404
405
|
RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
|
|
405
406
|
},
|
|
406
407
|
description: 'Keep this list short. Enable only the models you actually use.',
|
|
407
|
-
initCollapsed:
|
|
408
|
+
initCollapsed: true
|
|
408
409
|
},
|
|
409
410
|
label: 'Available Models',
|
|
410
411
|
labels: {
|
|
@@ -589,7 +590,7 @@ export const openaiBlock = {
|
|
|
589
590
|
]
|
|
590
591
|
}
|
|
591
592
|
],
|
|
592
|
-
imageURL:
|
|
593
|
+
imageURL: OpenAIIcon,
|
|
593
594
|
labels: {
|
|
594
595
|
plural: 'OpenAI Providers',
|
|
595
596
|
singular: 'OpenAI'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ai/providers/blocks/openai.ts"],"sourcesContent":["import type { Block } from 'payload'\n\n\nexport const openaiBlock: Block = {\n slug: 'openai',\n custom: {\n providerOptionsSchemas: {\n image: {\n fields: ['quality', 'style'],\n },\n text: {\n fields: [\n 'temperature',\n 'max_tokens',\n 'top_p',\n 'frequency_penalty',\n 'presence_penalty',\n 'seed',\n 'logitBias',\n ],\n },\n tts: {\n fields: ['speed', 'response_format', 'instructions'],\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 'Optional. If empty, @ai-sdk/openai will use the OPENAI_API_KEY environment variable.',\n },\n label: 'API Key',\n required: false,\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 type: 'row',\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://api.openai.com/v1).',\n },\n defaultValue: 'https://api.openai.com/v1',\n label: 'Base URL',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'organization',\n type: 'text',\n admin: {\n description:\n 'Optional. OpenAI organization ID for billing and access control.',\n },\n label: 'Organization ID',\n },\n {\n name: 'project',\n type: 'text',\n admin: {\n description: 'Optional. OpenAI project ID for organization-level access.',\n },\n label: 'Project ID',\n },\n ],\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description:\n 'Optional. Extra headers to send with every request, for example routing through a proxy.',\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 (NEW)\n {\n fields: [\n {\n name: 'voices',\n type: 'array',\n admin: {\n description: 'Available voices for Text-to-Speech models. You can add custom voices here.',\n initCollapsed: false,\n },\n defaultValue: [\n { id: 'alloy', name: 'Alloy', enabled: true },\n { id: 'echo', name: 'Echo', enabled: true },\n { id: 'fable', name: 'Fable', enabled: true },\n { id: 'onyx', name: 'Onyx', enabled: true },\n { id: 'nova', name: 'Nova', enabled: true },\n { id: 'shimmer', name: 'Shimmer', enabled: true },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID as used by OpenAI API',\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 label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n // 4. Provider Options (NEW - One group per use case)\n {\n fields: [\n // TTS Provider Options\n {\n name: 'ttsProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for TTS models. Users can override these per field.',\n },\n fields: [\n {\n name: 'speed',\n type: 'number',\n defaultValue: 1.0,\n label: 'Default Speed',\n max: 4,\n min: 0.25,\n },\n {\n name: 'response_format',\n type: 'select',\n dbName: \"openai-tts-response_format\",\n defaultValue: 'mp3',\n label: 'Default Response Format',\n options: [\n { label: 'MP3', value: 'mp3' },\n { label: 'Opus', value: 'opus' },\n { label: 'AAC', value: 'aac' },\n { label: 'FLAC', value: 'flac' },\n { label: 'WAV', value: 'wav' },\n { label: 'PCM', value: 'pcm' },\n ],\n },\n {\n name: 'instructions',\n type: 'textarea',\n admin: {\n placeholder: 'Optional default voice instructions',\n },\n label: 'Default Instructions',\n },\n ],\n label: 'TTS Provider Options',\n },\n\n // Image Provider Options\n {\n name: 'imageProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for image generation models.',\n },\n fields: [\n {\n name: 'quality',\n type: 'select',\n dbName: 'openai-image-quality',\n defaultValue: 'standard',\n label: 'Default Quality',\n options: [\n { label: 'Standard', value: 'standard' },\n { label: 'HD', value: 'hd' },\n ],\n },\n {\n name: 'style',\n type: 'select',\n dbName: 'openai-image-style',\n defaultValue: 'vivid',\n label: 'Default Style',\n options: [\n { label: 'Vivid', value: 'vivid' },\n { label: 'Natural', value: 'natural' },\n ],\n },\n ],\n label: 'Image Provider Options',\n },\n\n // Text Provider Options\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: 2,\n min: 0,\n },\n {\n name: 'max_tokens',\n type: 'number',\n label: 'Default Max Tokens',\n },\n {\n name: 'top_p',\n type: 'number',\n defaultValue: 1.0,\n label: 'Default Top P',\n max: 1,\n min: 0,\n },\n {\n name: 'frequency_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Default Frequency Penalty',\n max: 2,\n min: -2,\n },\n {\n name: 'presence_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Default Presence Penalty',\n max: 2,\n min: -2,\n },\n {\n name: 'seed',\n type: 'number',\n label: 'Default Seed',\n },\n {\n name: 'logitBias',\n type: 'json',\n admin: {\n description: 'Modify likelihood of tokens (JSON object mapping token IDs to bias).',\n },\n label: 'Default Logit Bias',\n },\n ],\n label: 'Text 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: 'Keep this list short. Enable only the models you actually use.',\n initCollapsed: false,\n },\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n // Curated models for content creation platforms\n defaultValue: [\n // ===== Text Generation =====\n {\n id: 'gpt-5',\n name: 'GPT-5 (Latest Flagship)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-5-mini',\n name: 'GPT-5 Mini (Fast & Efficient)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'chatgpt-4o-latest',\n name: 'ChatGPT-4o (Always Updated)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4o',\n name: 'GPT-4o (Multimodal)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4o-mini',\n name: 'GPT-4o Mini (Best Value)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4-turbo',\n name: 'GPT-4 Turbo',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n\n // ===== Image Generation =====\n {\n id: 'gpt-image-1',\n name: 'GPT Image 1 (Latest)',\n enabled: true,\n useCase: 'image',\n },\n {\n id: 'dall-e-3',\n name: 'DALL-E 3',\n enabled: true,\n useCase: 'image',\n },\n\n // ===== Audio =====\n {\n id: 'tts-1-hd',\n name: 'TTS HD (Text-to-Speech)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic model info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description:\n 'Exact model id as used with @ai-sdk/openai, for example gpt-4o.',\n width: '33%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '33%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'openai-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Text-to-Speech', value: 'tts' },\n { label: 'Embeddings', value: 'embedding' },\n ],\n },\n ],\n },\n // Response modalities and enabled checkbox\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'openai-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 },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: '/provider-icons/openai.webp',\n labels: {\n plural: 'OpenAI Providers',\n singular: 'OpenAI',\n },\n}\n"],"names":["openaiBlock","slug","custom","providerOptionsSchemas","image","fields","text","tts","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","id","enabled","max","min","dbName","options","value","placeholder","RowLabel","labels","plural","singular","responseModalities","useCase","hasMany","imageURL"],"mappings":"AAGA,OAAO,MAAMA,cAAqB;IAChCC,MAAM;IACNC,QAAQ;QACNC,wBAAwB;YACtBC,OAAO;gBACLC,QAAQ;oBAAC;oBAAW;iBAAQ;YAC9B;YACAC,MAAM;gBACJD,QAAQ;oBACN;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;iBACD;YACH;YACAE,KAAK;gBACHF,QAAQ;oBAAC;oBAAS;oBAAmB;iBAAe;YACtD;QACF;IACF;IACAA,QAAQ;QACN;YACEG,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEJ,QAAQ;wBACN;4BACEK,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;oBACEP,QAAQ;wBACN;4BACEG,MAAM;4BACNK,OAAO;gCACLK,eAAe;4BACjB;4BACAb,QAAQ;gCACN;oCACEG,MAAM;oCACNH,QAAQ;wCACN;4CACEK,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,a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O;4CACT;4CACAK,QAAQ;4CACRb,cAAc;4CACdC,OAAO;4CACPa,SAAS;gDACP;oDAAEb,OAAO;oDAAQc,OAAO;gDAAO;gDAC/B;oDAAEd,OAAO;oDAAoBc,OAAO;gDAAQ;gDAC5C;oDAAEd,OAAO;oDAAkBc,OAAO;gDAAM;gDACxC;oDAAEd,OAAO;oDAAcc,OAAO;gDAAY;6CAC3C;wCACH;qCACD;gCACH;gCACA,2CAA2C;gCAC3C;oCACEhB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbG,OAAO;oCACT;oCACAK,QAAQ;oCACRU,SAAS;oCACTtB,OAAO;oCACPa,SAAS;wCACP;4CAAEb,OAAO;4CAAQc,OAAO;wCAAO;wCAC/B;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;wCACjC;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEhB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLM,OAAO;oCACT;oCACAR,cAAc;oCACdC,OAAO;gCACT;6BACD;wBACH;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDuB,UAAU;IACVN,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/ai/providers/blocks/openai.ts"],"sourcesContent":["import type { Block } from 'payload'\n\n\nimport { OpenAIIcon } from '../icons.js'\n\nexport const openaiBlock: Block = {\n slug: 'openai',\n custom: {\n providerOptionsSchemas: {\n image: {\n fields: ['quality', 'style'],\n },\n text: {\n fields: [\n 'temperature',\n 'max_tokens',\n 'top_p',\n 'frequency_penalty',\n 'presence_penalty',\n 'seed',\n 'logitBias',\n ],\n },\n tts: {\n fields: ['speed', 'response_format', 'instructions'],\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 'Optional. If empty, @ai-sdk/openai will use the OPENAI_API_KEY environment variable.',\n },\n label: 'API Key',\n required: false,\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 type: 'row',\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://api.openai.com/v1).',\n },\n defaultValue: 'https://api.openai.com/v1',\n label: 'Base URL',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'organization',\n type: 'text',\n admin: {\n description:\n 'Optional. OpenAI organization ID for billing and access control.',\n },\n label: 'Organization ID',\n },\n {\n name: 'project',\n type: 'text',\n admin: {\n description: 'Optional. OpenAI project ID for organization-level access.',\n },\n label: 'Project ID',\n },\n ],\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description:\n 'Optional. Extra headers to send with every request, for example routing through a proxy.',\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 (NEW)\n {\n fields: [\n {\n name: 'voices',\n type: 'array',\n admin: {\n description: 'Available voices for Text-to-Speech models. You can add custom voices here.',\n initCollapsed: false,\n },\n defaultValue: [\n { id: 'alloy', name: 'Alloy', enabled: true },\n { id: 'echo', name: 'Echo', enabled: true },\n { id: 'fable', name: 'Fable', enabled: true },\n { id: 'onyx', name: 'Onyx', enabled: true },\n { id: 'nova', name: 'Nova', enabled: true },\n { id: 'shimmer', name: 'Shimmer', enabled: true },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID as used by OpenAI API',\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 label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n // 4. Provider Options (NEW - One group per use case)\n {\n fields: [\n // TTS Provider Options\n {\n name: 'ttsProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for TTS models. Users can override these per field.',\n },\n fields: [\n {\n name: 'speed',\n type: 'number',\n defaultValue: 1.0,\n label: 'Default Speed',\n max: 4,\n min: 0.25,\n },\n {\n name: 'response_format',\n type: 'select',\n dbName: \"openai-tts-response_format\",\n defaultValue: 'mp3',\n label: 'Default Response Format',\n options: [\n { label: 'MP3', value: 'mp3' },\n { label: 'Opus', value: 'opus' },\n { label: 'AAC', value: 'aac' },\n { label: 'FLAC', value: 'flac' },\n { label: 'WAV', value: 'wav' },\n { label: 'PCM', value: 'pcm' },\n ],\n },\n {\n name: 'instructions',\n type: 'textarea',\n admin: {\n placeholder: 'Optional default voice instructions',\n },\n label: 'Default Instructions',\n },\n ],\n label: 'TTS Provider Options',\n },\n\n // Image Provider Options\n {\n name: 'imageProviderOptions',\n type: 'group',\n admin: {\n description: 'Default provider options for image generation models.',\n },\n fields: [\n {\n name: 'quality',\n type: 'select',\n dbName: 'openai-image-quality',\n defaultValue: 'standard',\n label: 'Default Quality',\n options: [\n { label: 'Standard', value: 'standard' },\n { label: 'HD', value: 'hd' },\n ],\n },\n {\n name: 'style',\n type: 'select',\n dbName: 'openai-image-style',\n defaultValue: 'vivid',\n label: 'Default Style',\n options: [\n { label: 'Vivid', value: 'vivid' },\n { label: 'Natural', value: 'natural' },\n ],\n },\n ],\n label: 'Image Provider Options',\n },\n\n // Text Provider Options\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: 2,\n min: 0,\n },\n {\n name: 'max_tokens',\n type: 'number',\n label: 'Default Max Tokens',\n },\n {\n name: 'top_p',\n type: 'number',\n defaultValue: 1.0,\n label: 'Default Top P',\n max: 1,\n min: 0,\n },\n {\n name: 'frequency_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Default Frequency Penalty',\n max: 2,\n min: -2,\n },\n {\n name: 'presence_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Default Presence Penalty',\n max: 2,\n min: -2,\n },\n {\n name: 'seed',\n type: 'number',\n label: 'Default Seed',\n },\n {\n name: 'logitBias',\n type: 'json',\n admin: {\n description: 'Modify likelihood of tokens (JSON object mapping token IDs to bias).',\n },\n label: 'Default Logit Bias',\n },\n ],\n label: 'Text 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: 'Keep this list short. Enable only the models you actually use.',\n initCollapsed: true,\n },\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n // Curated models for content creation platforms\n defaultValue: [\n // ===== Text Generation =====\n {\n id: 'gpt-5',\n name: 'GPT-5 (Latest Flagship)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-5-mini',\n name: 'GPT-5 Mini (Fast & Efficient)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'chatgpt-4o-latest',\n name: 'ChatGPT-4o (Always Updated)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4o',\n name: 'GPT-4o (Multimodal)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4o-mini',\n name: 'GPT-4o Mini (Best Value)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4-turbo',\n name: 'GPT-4 Turbo',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n\n // ===== Image Generation =====\n {\n id: 'gpt-image-1',\n name: 'GPT Image 1 (Latest)',\n enabled: true,\n useCase: 'image',\n },\n {\n id: 'dall-e-3',\n name: 'DALL-E 3',\n enabled: true,\n useCase: 'image',\n },\n\n // ===== Audio =====\n {\n id: 'tts-1-hd',\n name: 'TTS HD (Text-to-Speech)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic model info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description:\n 'Exact model id as used with @ai-sdk/openai, for example gpt-4o.',\n width: '33%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '33%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'openai-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Text-to-Speech', value: 'tts' },\n { label: 'Embeddings', value: 'embedding' },\n ],\n },\n ],\n },\n // Response modalities and enabled checkbox\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'openai-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 },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: OpenAIIcon,\n labels: {\n plural: 'OpenAI Providers',\n singular: 'OpenAI',\n },\n}\n"],"names":["OpenAIIcon","openaiBlock","slug","custom","providerOptionsSchemas","image","fields","text","tts","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","id","enabled","max","min","dbName","options","value","placeholder","RowLabel","labels","plural","singular","responseModalities","useCase","hasMany","imageURL"],"mappings":"AAGA,SAASA,UAAU,QAAQ,cAAa;AAExC,OAAO,MAAMC,cAAqB;IAChCC,MAAM;IACNC,QAAQ;QACNC,wBAAwB;YACtBC,OAAO;gBACLC,QAAQ;oBAAC;oBAAW;iBAAQ;YAC9B;YACAC,MAAM;gBACJD,QAAQ;oBACN;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;iBACD;YACH;YACAE,KAAK;gBACHF,QAAQ;oBAAC;oBAAS;oBAAmB;iBAAe;YACtD;QACF;IACF;IACAA,QAAQ;QACN;YACEG,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEJ,QAAQ;wBACN;4BACEK,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;oBACEP,QAAQ;wBACN;4BACEG,MAAM;4BACNK,OAAO;gCACLK,eAAe;4BACjB;4BACAb,QAAQ;gCACN;oCACEG,MAAM;oCACNH,QAAQ;wCACN;4CACEK,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aACE;4CACJ;4CACAL,cAAc;4CACdC,OAAO;wCACT;qCACD;gCACH;gCACA;oCACEJ,MAAM;oCACNH,QAAQ;wCACN;4CACEK,MAAM;4C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;oDAAEd,OAAO;oDAAoBc,OAAO;gDAAQ;gDAC5C;oDAAEd,OAAO;oDAAkBc,OAAO;gDAAM;gDACxC;oDAAEd,OAAO;oDAAcc,OAAO;gDAAY;6CAC3C;wCACH;qCACD;gCACH;gCACA,2CAA2C;gCAC3C;oCACEhB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbG,OAAO;oCACT;oCACAK,QAAQ;oCACRU,SAAS;oCACTtB,OAAO;oCACPa,SAAS;wCACP;4CAAEb,OAAO;4CAAQc,OAAO;wCAAO;wCAC/B;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;wCACjC;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEhB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLM,OAAO;oCACT;oCACAR,cAAc;oCACdC,OAAO;gCACT;6BACD;wBACH;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDuB,UAAUpC;IACV8B,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { XAIIcon } from '../icons.js';
|
|
1
2
|
export const xaiBlock = {
|
|
2
3
|
slug: 'xai',
|
|
3
4
|
fields: [
|
|
@@ -236,7 +237,7 @@ export const xaiBlock = {
|
|
|
236
237
|
]
|
|
237
238
|
}
|
|
238
239
|
],
|
|
239
|
-
imageURL:
|
|
240
|
+
imageURL: XAIIcon,
|
|
240
241
|
labels: {
|
|
241
242
|
plural: 'xAI Providers',
|
|
242
243
|
singular: 'xAI Grok'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ai/providers/blocks/xai.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nexport const xaiBlock: Block = {\n slug: 'xai',\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 xAI 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: 2.0,\n min: 0.0,\n },\n {\n name: 'max_tokens',\n type: 'number',\n label: 'Max Tokens',\n },\n {\n name: 'top_p',\n type: 'number',\n defaultValue: 1.0,\n label: 'Top P',\n max: 1.0,\n min: 0.0,\n },\n {\n name: 'frequency_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Frequency Penalty',\n max: 2,\n min: -2,\n },\n {\n name: 'presence_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Presence Penalty',\n max: 2,\n min: -2,\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: 'grok-4', name: 'Grok 4', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'grok-3', name: 'Grok 3', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'grok-3-fast', name: 'Grok 3 Fast', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'grok-2-1212', name: 'Grok 2', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'grok-2-vision-1212', name: 'Grok 2 Vision', enabled: true, responseModalities: ['TEXT'], useCase: 'image' },\n { id: 'grok-vision-beta', name: 'Grok Vision Beta', enabled: true, responseModalities: ['TEXT'], useCase: 'image' },\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: 'xai-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Text Generation', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n ],\n required: true,\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: 'xai-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/xai.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { XAIIcon } from '../icons.js'\n\nexport const xaiBlock: Block = {\n slug: 'xai',\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 xAI 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: 2.0,\n min: 0.0,\n },\n {\n name: 'max_tokens',\n type: 'number',\n label: 'Max Tokens',\n },\n {\n name: 'top_p',\n type: 'number',\n defaultValue: 1.0,\n label: 'Top P',\n max: 1.0,\n min: 0.0,\n },\n {\n name: 'frequency_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Frequency Penalty',\n max: 2,\n min: -2,\n },\n {\n name: 'presence_penalty',\n type: 'number',\n defaultValue: 0,\n label: 'Presence Penalty',\n max: 2,\n min: -2,\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: 'grok-4', name: 'Grok 4', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'grok-3', name: 'Grok 3', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'grok-3-fast', name: 'Grok 3 Fast', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'grok-2-1212', name: 'Grok 2', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'grok-2-vision-1212', name: 'Grok 2 Vision', enabled: true, responseModalities: ['TEXT'], useCase: 'image' },\n { id: 'grok-vision-beta', name: 'Grok Vision Beta', enabled: true, responseModalities: ['TEXT'], useCase: 'image' },\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: 'xai-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Text Generation', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n ],\n required: true,\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: 'xai-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: XAIIcon,\n labels: {\n plural: 'xAI Providers',\n singular: 'xAI Grok',\n },\n}\n\n"],"names":["XAIIcon","xaiBlock","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,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;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;oCACNI,OAAO;gCACT;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNG,cAAc;oCACdC,OAAO;oCACPM,KAAK;oCACLC,KAAK;gCACP;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