Flowise 프로바이더

Flowise 프로바이더

Flowise 프로바이더 를 사용하면 AI SDK로 Flowise 채팅플로우(chatflows)를 여러분의 애플리케이션에 쉽게 통합할 수 있어요.

출처: 문서

본문

설정 (Setup)

Flowise 프로바이더는 @ahmedrowaihi/flowise-vercel-ai-sdk-provider 모듈에서 사용할 수 있어요. 다음과 같이 설치할 수 있어요:

프로바이더 인스턴스 (Provider Instance)

@ahmedrowaihi/flowise-vercel-ai-sdk-provider에서 프로바이더 팩토리를 임포트할 수 있어요:

import { createFlowiseProvider } from '@ahmedrowaihi/flowise-vercel-ai-sdk-provider';

퀵 스타트 (Quick Start)

재사용 가능한 프로바이더 사용 (Using a Reusable Provider)

.env.local 파일을 만들고 Flowise 설정을 추가하세요:

FLOWISE_BASE_URL=https://your-flowise-instance.com
FLOWISE_API_KEY=your_api_key_optional
import { createFlowiseProvider } from '@ahmedrowaihi/flowise-vercel-ai-sdk-provider';
import { generateText } from 'ai';

const flowise = createFlowiseProvider({
  baseUrl: process.env.FLOWISE_BASE_URL!,
  apiKey: proces...KEY,
});

const { text } = await generateText({
  model: flowise('your-chatflow-id'),
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
});

1회성 모델 사용 (Using a One-shot Model)

import { createFlowiseModel } from '@ahmedrowaihi/flowise-vercel-ai-sdk-provider';
import { generateText } from 'ai';

const { text } = await generateText({
  model: createFlowiseModel({
    baseUrl: process.env.FLOWISE_BASE_URL!,
    apiKey: proces...KEY,
    chatflowId: 'your-chatflow-id',
  }),
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
});

스트리밍 예시 (Streaming Example)

import { streamText } from 'ai';
import { createFlowiseProvider } from '@ahmedrowaihi/flowise-vercel-ai-sdk-provider';

const flowise = createFlowiseProvider({
  baseUrl: process.env.FLOWISE_BASE_URL!,
  apiKey: proces...KEY,
});

const result = streamText({
  model: flowise('your-chatflow-id'),
  prompt: 'Write a story about a robot learning to cook.',
});

return result.toDataStreamResponse();

더 알아보기 (Learn more)

자세한 내용과 고급 사용법은 Flowise 프로바이더 문서를 참고하세요.

전체 사이트맵