cheshire-cat-ai / admin-vue

Admin panel of the Cheshire Cat AI
GNU General Public License v3.0
31 stars 25 forks source link

Improve form to allow any type used in JSON Schema #38

Open github-actions[bot] opened 1 year ago

github-actions[bot] commented 1 year ago

Describe the reason of this issue Can also totally replace the current library used for dynamic form

The issue is present here:


import { merge } from "lodash"
import { Form, Field } from "vee-validate"

// FEATURE: Improve form to allow any type of input based on json schema
// Can also totally replace the current library used for dynamic form

const props = withDefaults(
    defineProps<{
        fields: SchemaField[]
zAlweNy26 commented 8 months ago

A possible (but really bad) solution, can be this one: https://github.com/StefanTerdell/json-schema-to-zod?tab=readme-ov-file#use-at-runtime

Otherwise, we can manually create Zod Objects for each provider/embedder settings, but in this case, the plugin settings would remain as it is now, without validation.