Skip to content

receptron/GUIChatPluginTextResponse

Repository files navigation

@gui-chat-plugin/text-response

npm version

Text Response plugin for GUI Chat applications. Provides markdown rendering with role-based styling for displaying text content from assistants, users, and systems.

Features

  • Markdown rendering with GitHub Flavored Markdown support
  • Role-based styling (assistant, user, system)
  • JSON auto-detection and syntax highlighting
  • <think> block processing for AI reasoning display
  • Inline text editing capability
  • Transport kind indicator

Installation

yarn add @gui-chat-plugin/text-response

Usage

Vue Integration

// In src/tools/index.ts
import TextResponsePlugin from "@gui-chat-plugin/text-response/vue";

const pluginList = [
  // ... other plugins
  TextResponsePlugin,
];

// In src/main.ts
import "@gui-chat-plugin/text-response/style.css";

Core-only Usage

import { executeTextResponse, TOOL_DEFINITION } from "@gui-chat-plugin/text-response";

// Execute the tool
const result = await executeTextResponse(context, {
  text: "Hello, **world**!",
  role: "assistant",
});

API

TextResponseData

interface TextResponseData {
  text: string;
  role?: "assistant" | "system" | "user";
  transportKind?: string;
}

Tool Arguments

Argument Type Required Description
text string Yes Plain text or markdown content to display
role "assistant" | "system" | "user" No Speaker role for styling
transportKind string No Identifier for the transport provider

Development

# Install dependencies
yarn install

# Run demo
yarn dev

# Build
yarn build

# Lint
yarn lint

Test Prompts

Try these prompts to test the plugin:

  1. "Explain the difference between let and const in JavaScript"
  2. "Write a short poem about programming"
  3. "List the top 5 programming languages for web development"

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors