chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import rootConfig from '../../eslint.config.mjs'
|
||||
|
||||
export default [
|
||||
...rootConfig,
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
@@ -0,0 +1,42 @@
|
||||
import * as common from '@botpress/common'
|
||||
import { z, InterfaceDefinition } from '@botpress/sdk'
|
||||
|
||||
export default new InterfaceDefinition({
|
||||
name: 'text-to-image',
|
||||
version: '2.1.2',
|
||||
entities: {
|
||||
imageModelRef: {
|
||||
schema: common.textToImage.schemas.ImageModelRefSchema,
|
||||
},
|
||||
imageGenerationParams: {
|
||||
schema: common.textToImage.schemas.ImageGenerationParamsSchema,
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
generateImage: {
|
||||
billable: true,
|
||||
cacheable: true,
|
||||
input: {
|
||||
schema: ({ imageModelRef, imageGenerationParams }) =>
|
||||
common.textToImage.schemas.GenerateImageInputSchema(imageModelRef, imageGenerationParams),
|
||||
},
|
||||
output: {
|
||||
schema: () => common.textToImage.schemas.GenerateImageOutputSchema,
|
||||
},
|
||||
},
|
||||
listImageModels: {
|
||||
input: {
|
||||
schema: () => z.object({}),
|
||||
},
|
||||
output: {
|
||||
schema: ({ imageModelRef }) =>
|
||||
z.object({
|
||||
models: z.array(z.intersection(common.textToImage.schemas.ImageModelSchema, imageModelRef)),
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
__advanced: {
|
||||
useLegacyZuiTransformer: true,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "@botpresshub/text-to-image",
|
||||
"description": "Text-to-image interface for Botpress integrations",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"check:type": "tsc --noEmit",
|
||||
"check:bplint": "bp lint"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@botpress/common": "workspace:*",
|
||||
"@botpress/sdk": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@botpress/cli": "workspace:*",
|
||||
"@botpress/sdk": "workspace:*"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"paths": { "*": ["./*"] },
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user