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

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay