@shangzy/ag-ui-dify
v0.1.0
Published
This package provides integration between AG-UI and Dify, allowing you to use Dify's AI agents with AG-UI's frontend components.
Readme
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/difyUsage
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 componentsFeatures
- 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 objectapiKey: Your Dify API keybaseUrl: (optional) Dify API base URL, defaults to "https://api.dify.ai/v1"
Methods
stream(input: RunAgentInput): Streams the agent's response- Returns: AsyncGenerator of AG-UI events
License
MIT
