@ai-stack/payloadcms 3.68.0-beta.1 → 3.68.0-beta.2

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.
Files changed (97) hide show
  1. package/dist/ai/core/media/image/handlers/multimodal.js +5 -0
  2. package/dist/ai/core/media/image/handlers/multimodal.js.map +1 -1
  3. package/dist/ai/core/streamObject.js +0 -3
  4. package/dist/ai/core/streamObject.js.map +1 -1
  5. package/dist/ai/providers/blocks/anthropic.js +2 -1
  6. package/dist/ai/providers/blocks/anthropic.js.map +1 -1
  7. package/dist/ai/providers/blocks/elevenlabs.js +2 -1
  8. package/dist/ai/providers/blocks/elevenlabs.js.map +1 -1
  9. package/dist/ai/providers/blocks/fal.js +2 -1
  10. package/dist/ai/providers/blocks/fal.js.map +1 -1
  11. package/dist/ai/providers/blocks/google.js +2 -1
  12. package/dist/ai/providers/blocks/google.js.map +1 -1
  13. package/dist/ai/providers/blocks/openai-compatible.js +2 -1
  14. package/dist/ai/providers/blocks/openai-compatible.js.map +1 -1
  15. package/dist/ai/providers/blocks/openai.js +2 -1
  16. package/dist/ai/providers/blocks/openai.js.map +1 -1
  17. package/dist/ai/providers/blocks/xai.js +2 -1
  18. package/dist/ai/providers/blocks/xai.js.map +1 -1
  19. package/dist/ai/providers/icons.d.ts +7 -0
  20. package/dist/ai/providers/icons.js +9 -0
  21. package/dist/ai/providers/icons.js.map +1 -0
  22. package/dist/ai/providers/registry.js +34 -23
  23. package/dist/ai/providers/registry.js.map +1 -1
  24. package/dist/collections/Instructions.js +37 -0
  25. package/dist/collections/Instructions.js.map +1 -1
  26. package/dist/endpoints/chat.d.ts +4 -0
  27. package/dist/endpoints/index.js +86 -10
  28. package/dist/endpoints/index.js.map +1 -1
  29. package/dist/exports/fields.d.ts +1 -0
  30. package/dist/exports/fields.js +1 -0
  31. package/dist/exports/fields.js.map +1 -1
  32. package/dist/fields/ArrayComposeField/ArrayComposeField.d.ts +15 -0
  33. package/dist/fields/ArrayComposeField/ArrayComposeField.js +87 -0
  34. package/dist/fields/ArrayComposeField/ArrayComposeField.js.map +1 -0
  35. package/dist/fields/ArrayComposeField/ArrayComposeField.jsx +73 -0
  36. package/dist/fields/PromptEditorField/PromptEditorField.js +7 -2
  37. package/dist/fields/PromptEditorField/PromptEditorField.js.map +1 -1
  38. package/dist/fields/PromptEditorField/PromptEditorField.jsx +5 -2
  39. package/dist/index.d.ts +2 -0
  40. package/dist/index.js +1 -0
  41. package/dist/index.js.map +1 -1
  42. package/dist/init.js +23 -6
  43. package/dist/init.js.map +1 -1
  44. package/dist/payload-ai.d.ts +149 -0
  45. package/dist/providers/InstructionsProvider/InstructionsProvider.js +3 -0
  46. package/dist/providers/InstructionsProvider/InstructionsProvider.js.map +1 -1
  47. package/dist/providers/InstructionsProvider/InstructionsProvider.jsx +3 -0
  48. package/dist/providers/InstructionsProvider/useInstructions.js +18 -1
  49. package/dist/providers/InstructionsProvider/useInstructions.js.map +1 -1
  50. package/dist/styles.d.ts +11 -0
  51. package/dist/types/handlebars-async-helpers.d.ts +1 -0
  52. package/dist/types/handlebars-dist-handlebars.d.ts +1 -0
  53. package/dist/types/react-mentions.d.ts +1 -0
  54. package/dist/ui/Compose/Compose.d.ts +1 -0
  55. package/dist/ui/Compose/Compose.js +2 -2
  56. package/dist/ui/Compose/Compose.js.map +1 -1
  57. package/dist/ui/Compose/Compose.jsx +2 -2
  58. package/dist/ui/Compose/UndoRedoActions.d.ts +2 -2
  59. package/dist/ui/Compose/UndoRedoActions.js +8 -5
  60. package/dist/ui/Compose/UndoRedoActions.js.map +1 -1
  61. package/dist/ui/Compose/UndoRedoActions.jsx +6 -5
  62. package/dist/ui/Compose/compose.module.css +56 -16
  63. package/dist/ui/Compose/hooks/menu/itemsMap.js +12 -6
  64. package/dist/ui/Compose/hooks/menu/itemsMap.js.map +1 -1
  65. package/dist/ui/Compose/hooks/menu/useMenu.js +26 -15
  66. package/dist/ui/Compose/hooks/menu/useMenu.js.map +1 -1
  67. package/dist/ui/Compose/hooks/menu/useMenu.jsx +25 -12
  68. package/dist/ui/Compose/hooks/useHistory.d.ts +0 -1
  69. package/dist/ui/Compose/hooks/useHistory.js +65 -25
  70. package/dist/ui/Compose/hooks/useHistory.js.map +1 -1
  71. package/dist/ui/DynamicVoiceSelect/index.js +63 -11
  72. package/dist/ui/DynamicVoiceSelect/index.js.map +1 -1
  73. package/dist/ui/DynamicVoiceSelect/index.jsx +47 -14
  74. package/dist/ui/VoicesFetcher/index.js +54 -8
  75. package/dist/ui/VoicesFetcher/index.js.map +1 -1
  76. package/dist/ui/VoicesFetcher/index.jsx +32 -9
  77. package/dist/utilities/buildSmartPrompt.d.ts +22 -0
  78. package/dist/utilities/buildSmartPrompt.js +143 -0
  79. package/dist/utilities/buildSmartPrompt.js.map +1 -0
  80. package/dist/utilities/resolveImageReferences.d.ts +3 -1
  81. package/dist/utilities/resolveImageReferences.js +21 -2
  82. package/dist/utilities/resolveImageReferences.js.map +1 -1
  83. package/dist/utilities/updateFieldsConfig.js +7 -1
  84. package/dist/utilities/updateFieldsConfig.js.map +1 -1
  85. package/package.json +3 -3
  86. package/dist/endpoints/chat.d.js +0 -3
  87. package/dist/endpoints/chat.d.js.map +0 -1
  88. package/dist/payload-ai.d.js +0 -3
  89. package/dist/payload-ai.d.js.map +0 -1
  90. package/dist/styles.d.js +0 -2
  91. package/dist/styles.d.js.map +0 -1
  92. package/dist/types/handlebars-async-helpers.d.js +0 -2
  93. package/dist/types/handlebars-async-helpers.d.js.map +0 -1
  94. package/dist/types/handlebars-dist-handlebars.d.js +0 -2
  95. package/dist/types/handlebars-dist-handlebars.d.js.map +0 -1
  96. package/dist/types/react-mentions.d.js +0 -2
  97. package/dist/types/react-mentions.d.js.map +0 -1
@@ -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","type","text","role","google","resultImages","files","filter","f","mediaType","startsWith","length","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,Q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D,WAAWX,SAAS,IAAI;IACzC,MAAMa,YAAYF,WAAWG,UAAU,IAAIH,WAAWI,UAAU;IAEhE,IAAI,CAACF,WAAW;QACd,MAAM,IAAIJ,MAAM;IAClB;IAEA,MAAMO,SAAS3C,gBAAgBwC;IAC/B,MAAMI,YAAY3C,yBAAyBsC;IAE3C,OAAO;QACLM,MAAM;YACJC,MAAM,CAAC,UAAU,EAAEF,UAAU,CAAC;YAC9BG,MAAMJ;YACNK,UAAUT;YACVU,MAAMN,OAAOO,UAAU;QACzB;IACF;AACF"}
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,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,EAAEhB,SAAS,EAAEiB,WAAW,cACrB,EAAE;IAEP,IAAIJ,aAAanB,MAAM,KAAK,GAAG;QAC7B,oDAAoD;QACpD,MAAMwB,eAAeV,OAAOW,QAAQ,EAAEC;QACtC,MAAMC,YAAYH,cAAcI,YAAY,CAAC,EAAE;QAE/C,IAAID,WAAWE,eAAe;YAC5B,MAAM,IAAIC,MAAM,CAAC,yBAAyB,EAAEH,UAAUE,aAAa,CAAC,CAAC;QACvE;QACA,IAAIF,WAAWI,gBAAgBJ,UAAUI,YAAY,KAAK,QAAQ;YAChE,MAAM,IAAID,MAAM,CAAC,qCAAqC,EAAEH,UAAUI,YAAY,CAAC,CAAC;QAClF;QAEA,MAAM,IAAID,MAAM;IAClB;IAEA,MAAME,aAAab,YAAY,CAAC,EAAE;IAClC,MAAMc,WAAWD,WAAW1B,SAAS,IAAI;IACzC,MAAM4B,YAAYF,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,9 +45,6 @@ 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
  }
@@ -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 console.log(\"options.messages : \",options.messages)\n console.log('prompt : ', prompt)\n console.log('args.images : ', args.images)\n\n if (providerOptions) {\n options.providerOptions = providerOptions\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","console","log"],"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;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+ {"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 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"],"mappings":"AAAA,SAAyBA,UAAU,EAAEC,gBAAgBC,eAAe,QAAuB,KAAI;AAI/F,SAASC,gBAAg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../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: '/provider-icons/anthropic.webp',
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: '/provider-icons/anthropic.webp',\n labels: {\n plural: 'Anthropic Providers',\n singular: 'Anthropic',\n },\n}\n\n"],"names":["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,OAAO,MAAMA,iBAAwB;IACnCC,MAAM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;oCACEH,IAAI;oCACJZ,MAAM;oCACNa,SAAS;oCACTC,oBAAoB;wCAAC;qCAAO;oCAC5BC,SAAS;gCACX;gCACA;oCACEH,IAAI;oCACJZ,MAAM;oCACNa,SAAS;oCACTC,oBAAoB;wCAAC;qCAAO;oCAC5BC,SAAS;gCACX;6BACD;4BACDlB,QAAQ;gCACN;oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEa,OAAO;4CAAM;4CACtBd,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEa,OAAO;4CAAM;4CACtBd,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEa,OAAO;4CAAM;4CACtBC,QAAQ;4CACRhB,cAAc;4CACdC,OAAO;4CACPgB,SAAS;gDAAC;oDAAEhB,OAAO;oDAAmBiB,OAAO;gDAAO;6CAAE;wCACxD;qCACD;gCACH;gCACA;oCACEnB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbU,OAAO;oCACT;oCACAC,QAAQ;oCACRG,SAAS;oCACTlB,OAAO;oCACPgB,SAAS;wCACP;4CAAEhB,OAAO;4CAAQiB,OAAO;wCAAO;wCAC/B;4CAAEjB,OAAO;4CAASiB,OAAO;wCAAQ;wCACjC;4CAAEjB,OAAO;4CAASiB,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEnB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLa,OAAO;oCACT;oCACAf,cAAc;oCACdC,OAAO;gCACT;6BACD;4BACDA,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDmB,UAAU;IACVC,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
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;4B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AQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEa,OAAO;4CAAM;4CACtBd,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEa,OAAO;4CAAM;4CACtBd,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEa,OAAO;4CAAM;4CACtBC,QAAQ;4CACRhB,cAAc;4CACdC,OAAO;4CACPgB,SAAS;gDAAC;oDAAEhB,OAAO;oDAAmBiB,OAAO;gDAAO;6CAAE;wCACxD;qCACD;gCACH;gCACA;oCACEnB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbU,OAAO;oCACT;oCACAC,QAAQ;oCACRG,SAAS;oCACTlB,OAAO;oCACPgB,SAAS;wCACP;4CAAEhB,OAAO;4CAAQiB,OAAO;wCAAO;wCAC/B;4CAAEjB,OAAO;4CAASiB,OAAO;wCAAQ;wCACjC;4CAAEjB,OAAO;4CAASiB,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEnB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLa,OAAO;oCACT;oCACAf,cAAc;oCACdC,OAAO;gCACT;6BACD;4BACDA,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDmB,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: {
@@ -438,7 +439,7 @@ export const elevenlabsBlock = {
438
439
  ]
439
440
  }
440
441
  ],
441
- imageURL: '/provider-icons/elevenlabs.webp',
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;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,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAC,QAAQ;4CACRR,OAAO;4CACPS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tD;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,UAAU;IACVH,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;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: 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: 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,O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gCACX;gCACA;oCACEH,IAAI;oCACJjB,MAAM;oCACNkB,SAAS;oCACTC,oBAAoB;wCAAC;qCAAQ;oCAC7BC,SAAS;gCACX;6BACD;4BACDvB,QAAQ;gCACN,aAAa;gCACb;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;qCACD;gCACH;gCACA;oCACET,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAC,QAAQ;4CACRT,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: '/provider-icons/fai-ai.webp',
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,M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ACNK,OAAO;wCACLG,aAAa;wCACbY,OAAO;oCACT;oCACAR,QAAQ;oCACRS,SAAS;oCACTjB,OAAO;oCACPS,SAAS;wCACP;4CAAET,OAAO;4CAAQU,OAAO;wCAAO;wCAC/B;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;wCACjC;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;wCACjC;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;qCAClC;gCACH;6BACD;4BACDV,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDkB,UAAU;IACVC,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
1
+ {"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;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AAQ;4CACRR,OAAO;4CACPS,SAAS;gDACP;oDAAET,OAAO;oDAAoBU,OAAO;gDAAQ;gDAC5C;oDAAEV,OAAO;oDAAoBU,OAAO;gDAAQ;6CAC7C;4CACDL,UAAU;wCACZ;qCACD;gCACH;gCACA;oCACEP,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLe,OAAO;oCACT;oCACAjB,cAAc;oCACdC,OAAO;gCACT;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbY,OAAO;oCACT;oCACAR,QAAQ;oCACRS,SAAS;oCACTjB,OAAO;oCACPS,SAAS;wCACP;4CAAET,OAAO;4CAAQU,OAAO;wCAAO;wCAC/B;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;wCACjC;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;wCACjC;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;qCAClC;gCACH;6BACD;4BACDV,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDkB,UAAU1B;IACV2B,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
@@ -1,3 +1,4 @@
1
+ import { GoogleIcon } from '../icons.js';
1
2
  export const googleBlock = {
2
3
  slug: 'google',
3
4
  custom: {
@@ -612,7 +613,7 @@ export const googleBlock = {
612
613
  ]
613
614
  }
614
615
  ],
615
- imageURL: '/provider-icons/google-gemini.webp',
616
+ imageURL: GoogleIcon,
616
617
  labels: {
617
618
  plural: 'Google Providers',
618
619
  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;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;4BACN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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 { 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: 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","imageUR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AAO;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: '/provider-icons/custom-provider.png',
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;gCACN;oCACEG,MAAM;oCACNF,MAAM;oCACNO,cAAc;oCACdF,OAAO;oCACPK,KAAK;oCACLC,KAAK;gCACP;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNK,OAAO;gCACT;gCACA;oCACEH,MAAM;oCACNF,MAAM;oCACNO,cAAc;oCACdF,OAAO;oCACPK,KAAK;oCACLC,KAAK;gCACP;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNO,cAAc;oCACdF,OAAO;oCACPK,KAAK;oCACLC,KAAK,CAAC;gCACR;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNO,cAAc;oCACdF,OAAO;oCACPK,KAAK;oCACLC,KAAK,CAAC;gCACR;6BACD;4BACDN,OAAO;wBACT;wBACA;4BACEH,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAA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AAU;wCACZ;wCACA;4CACEJ,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAEc,OAAO;4CAAM;4CACtBZ,OAAO;4CACPC,UAAU;wCACZ;wCACA;4CACEJ,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAEc,OAAO;4CAAM;4CACtBL,QAAQ;4CACRP,OAAO;4CACPQ,SAAS;gDACP;oDAAER,OAAO;oDAAmBS,OAAO;gDAAO;gDAC1C;oDAAET,OAAO;oDAAoBS,OAAO;gDAAQ;gDAC5C;oDAAET,OAAO;oDAAoBS,OAAO;gDAAQ;gDAC5C;oDAAET,OAAO;oDAAkBS,OAAO;gDAAM;6CACzC;4CACDR,UAAU;wCACZ;qCACD;gCACH;gCACA;oCACEJ,MAAM;oCACNF,MAAM;oCACNG,OAAO;wCACLc,OAAO;oCACT;oCACAV,cAAc;oCACdF,OAAO;gCACT;gCACA;oCACEH,MAAM;oCACNF,MAAM;oCACNG,OAAO;wCACLC,aAAa;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,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;gBACT;gBAEA,0BAA0B;gBAC1B;oBACEN,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAL,QAAQ;gCACN;oCACEG,MAAM;oCACNF,MAAM;oCACNO,cAAc;oCACdF,OAAO;oCACPK,KAAK;oCACLC,KAAK;gCACP;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNK,OAAO;gCACT;gCACA;oCACEH,MAAM;oCACNF,MAAM;oCACNO,cAAc;oCACdF,OAAO;oCACPK,KAAK;oCACLC,KAAK;gCACP;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNO,cAAc;oCACdF,OAAO;oCACPK,KAAK;oCACLC,KAAK,CAAC;gCACR;gCACA;oCACET,MAAM;oCACNF,MAAM;oCACNO,cAAc;oCACdF,OAAO;oC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oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAEc,OAAO;4CAAM;4CACtBZ,OAAO;4CACPC,UAAU;wCACZ;wCACA;4CACEJ,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAEc,OAAO;4CAAM;4CACtBZ,OAAO;4CACPC,UAAU;wCACZ;wCACA;4CACEJ,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAEc,OAAO;4CAAM;4CACtBL,QAAQ;4CACRP,OAAO;4CACPQ,SAAS;gDACP;oDAAER,OAAO;oDAAmBS,OAAO;gDAAO;gDAC1C;oDAAET,OAAO;oDAAoBS,OAAO;gDAAQ;gDAC5C;oDAAET,OAAO;oDAAoBS,OAAO;gDAAQ;gDAC5C;oDAAET,OAAO;oDAAkBS,OAAO;gDAAM;6CACzC;4CACDR,UAAU;wCACZ;qCACD;gCACH;gCACA;oCACEJ,MAAM;oCACNF,MAAM;oCACNG,OAAO;wCACLc,OAAO;oCACT;oCACAV,cAAc;oCACdF,OAAO;gCACT;gCACA;oCACEH,MAAM;oCACNF,MAAM;oCACNG,OAAO;wCACLC,aAAa;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: {
@@ -589,7 +590,7 @@ export const openaiBlock = {
589
590
  ]
590
591
  }
591
592
  ],
592
- imageURL: '/provider-icons/openai.webp',
593
+ imageURL: OpenAIIcon,
593
594
  labels: {
594
595
  plural: 'OpenAI Providers',
595
596
  singular: 'OpenAI'