Files
copilot-toolbox-template-121/node_modules/@shangzy/ag-ui-dify/README.md
2026-01-16 02:20:32 +00:00

1.1 KiB

AG-UI Dify Integration

This package provides integration between AG-UI and Dify, allowing you to use Dify's AI agents with AG-UI's frontend components.

Installation

pnpm add @ag-ui-private/dify

Usage

import { DifyAgent } from "@ag-ui-private/dify";

// Create a Dify agent
const agent = new DifyAgent({
  apiKey: "your-dify-api-key",
  baseUrl: "https://api.dify.ai/v1", // optional
});

// Use the agent with AG-UI components

Features

  • Seamless integration with AG-UI's frontend components
  • Support for streaming responses
  • Tool calling support
  • Message format conversion between AG-UI and Dify

API Reference

DifyAgent

The main class for integrating Dify with AG-UI.

Constructor

constructor(config: DifyClientConfig)

Parameters:

  • config: Configuration object

Methods

  • stream(input: RunAgentInput): Streams the agent's response
    • Returns: AsyncGenerator of AG-UI events

License

MIT