공식 LangChain 통합

FluentC LangChain 도구

FluentC AI 번역 API와 LangChain을 통합하기 위한 공식 Python 플러그인 LangChain 호환 도구를 통해 실시간 및 배치 번역, 언어 감지, 작업 폴링을 활성화하세요.

LangChain 통합 기능

실시간 및 배치 번역

대용량 콘텐츠에 대해 즉시 번역 또는 일괄 처리를 선택하세요.

언어 감지

입력 콘텐츠의 언어를 자신감 점수와 함께 자동으로 감지합니다.

동적 언어 선택

API 키가 활성화된 언어로 채워진 드롭다운 메뉴.

포맷 지원

일반 텍스트와 HTML 콘텐츠를 모두 원활하게 처리하세요.

오류 처리

계속 실패 시 계속 진행하는 포괄적인 오류 처리 지원.

워크플로우 통합

어떤 N8N 자동화 워크플로우에도 원활하게 통합됩니다.

FluentC API 키 필요

FluentC LangChain 도구를 사용하려면 유효한 FluentC API 키와 활성 구독이 필요합니다. API 키는 140개 이상의 언어와 실시간 번역 기능에 대한 액세스를 제공합니다.

지금 가입하세요

설치 & 설정

패키지 설치

FluentC LangChain 패키지를 설치하세요.
# Install via pip
pip install fluentc-langchain-tool

# Or with requirements.txt
echo "fluentc-langchain-tool" >> requirements.txt
pip install -r requirements.txt
Python 3.7 이상과 LangChain 프레임워크가 필요합니다.

인증 설정

FluentC API 키를 구성하세요:

from fluentc_langchain_tool import
FluentCTranslationTool

# Initialize with API key
tool = FluentCTranslationTool( api_key="your-fluentc-api-key")

이용 가능 LangChain 도구

FluentC LangChain 도구 클래스

도구 클래스

목적

FluentCTranslationTool

실시간 또는 배치 번역 제출

FluentCLanguageDetectorTool

입력에서 원본 언어를 감지하십시오

FluentCTranslationStatusTool

배치 번역 작업의 상태를 확인하세요

FluentCResultsTool

배치 작업 번역 결과 투표

FluentCBatchTranslationTool

일회성 배치 제출 + 폴링

사용법 예시

  • 실시간 번역
  • 일괄 번역
  • 상태 점검
  • LangChain 에이전트
FluentC LangChain 도구를 사용하여 실시간 번역 수행하기
				
					from fluentc_langchain_tool import FluentCTranslationTool

# Initialize the translation tool
tool = FluentCTranslationTool(api_key="your-api-key")

# Perform real-time translation
response = tool.run({
    "text": "Hello, world!",
    "target_language": "fr",
    "source_language": "en",
    "mode": "realtime"
})

print(response)  # Output: "Bonjour, le monde !"

# Translation with auto-detection
response = tool.run({
    "text": "¿Cómo estás?",
    "target_language": "en",
    "mode": "realtime"
})

print(response)  # Output: "How are you?"
print("Detected source language:", response.get('detected_language', 'Unknown'))
				
			
대용량 콘텐츠를 배치 번역과 자동 폴링으로 처리하기
				
					from fluentc_langchain_tool import FluentCBatchTranslationTool

# Initialize batch translation tool
tool = FluentCBatchTranslationTool(api_key="your-api-key")

# Translate large HTML content
large_html = """
<html>
<head><title>Welcome</title></head>
<body data-rsssl=1>
    <h1>Hello, batch world!</h1>
    <p>This is a large document that needs translation.</p>
    <p>It contains multiple paragraphs and HTML structure.</p>
</body>
</html>
"""

# Submit and automatically poll for results
result = tool.run({
    "text": large_html,
    "target_language": "de",
    "source_language": "en"
})

print("Translated HTML:")
print(result)  # Final translated output after polling

# The tool automatically:
# 1. Submits the batch job
# 2. Polls for completion using estimated_wait_seconds
# 3. Returns the final translation result
				
			
배치 번역 작업의 상태를 확인하세요.
				
					from fluentc_langchain_tool import (
    FluentCTranslationTool, 
    FluentCTranslationStatusTool
)

# Initialize tools
translation_tool = FluentCTranslationTool(api_key="your-api-key")
status_tool = FluentCTranslationStatusTool(api_key="your-api-key")

# Submit a batch translation job
job_response = translation_tool.run({
    "text": "Large document for batch processing...",
    "target_language": "es",
    "mode": "batch"
})

job_id = job_response.get('job_id')
print(f"Batch job submitted: {job_id}")

# Check job status
status_response = status_tool.run({
    "job_id": job_id
})

print(f"Job status: {status_response}")

# Status responses include:
# - "processing": Job is still running
# - "complete": Translation finished
# - "failed": Job encountered an error
# - estimated_wait_seconds: Recommended polling interval
				
			
복잡한 워크플로우를 위해 FluentC 도구를 LangChain 에이전트와 통합하기:
				
					from langchain.agents import initialize_agent, Tool
from langchain.llms import OpenAI
from fluentc_langchain_tool import (
    FluentCTranslationTool,
    FluentCBatchTranslationTool,
    FluentCLanguageDetectorTool,
    FluentCTranslationStatusTool
)

# Initialize FluentC tools
api_key = "your-fluentc-api-key"
translation_tool = FluentCTranslationTool(api_key)
batch_tool = FluentCBatchTranslationTool(api_key)
detector_tool = FluentCLanguageDetectorTool(api_key)
status_tool = FluentCTranslationStatusTool(api_key)

# Create LangChain agent with FluentC tools
agent = initialize_agent(
    tools=[
        Tool.from_function(
            func=translation_tool.run,
            name="FluentC_Translation",
            description="Translate text in real-time or batch mode"
        ),
        Tool.from_function(
            func=batch_tool.run,
            name="FluentC_Batch_Translation",
            description="Translate large content with auto-polling"
        ),
        Tool.from_function(
            func=detector_tool.run,
            name="FluentC_Language_Detection",
            description="Detect language of input text"
        ),
        Tool.from_function(
            func=status_tool.run,
            name="FluentC_Status_Check",
            description="Check batch translation job status"
        )
    ],
    llm=OpenAI(temperature=0),
    agent="zero-shot-react-description",
    verbose=True
)

# Example agent interactions
responses = [
    "Translate 'Hello world' from English to German using FluentC.",
    "Detect the language of 'Bonjour tout le monde' and translate it to Spanish.",
    "Translate this large HTML document to French using batch processing."
]

for query in responses:
    print(f"\nQuery: {query}")
    result = agent.run(query)
    print(f"Result: {result}")
				
			

N8N 워크플로우에 번역 추가할 준비가 되셨나요?

오늘 FluentC의 N8N 통합을 시작하세요. API 키를 생성하고 플러그인을 설치한 후 다국어 자동화 워크플로우를 시작하세요.