DEV Community

Ivan Borshchov
Ivan Borshchov

Posted on

1

Chat-GPT Copilot-like plugin for AdminForth framework

A plugin allows you to complete text and string fields in AdminForth using copilot-like hints.

Image description

Full GIF:

How to use plugin: https://adminforth.dev/docs/tutorial/Plugins/chat-gpt/

Plugin installation:

npm i @adminforth/chat-gpt --save
Enter fullscreen mode Exit fullscreen mode

Usage:

  plugins: [
    ...
    new ChatGptPlugin({
      openAiApiKey: process.env.OPENAI_API_KEY as string,
      fieldName: 'title',
    }),
    new ChatGptPlugin({
      openAiApiKey: process.env.OPENAI_API_KEY as string,
      fieldName: 'description',
      model: 'gpt-4o',
      // expert: {
        // maxTokens: 50, // token limit to generate for each completion. 50 is default
        // temperature: 0.7, // Model temperature, 0.7
        // promptLimit: 500, // Limit in characters of each field length to be passed to Model. 500 is default value
        // debounceTime: 300, // Debounce time in milliseconds. 300 is default value
      // }
    }),
  ]
Enter fullscreen mode Exit fullscreen mode

To achieve Copilot-like completes, it uses vue-suggestion-input

Neon image

Serverless Postgres in 300ms (!)

10 free databases with autoscaling, scale-to-zero, and read replicas. Start building without infrastructure headaches. No credit card needed.

Try for Free →

Top comments (0)

AWS Industries LIVE! Stream

Watch AWS Industries LIVE!

New tech. Real solutions. See what’s possible on Industries LIVE! with AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay