FluentC for LangChain.
The official Python package for using FluentC from LangChain. Real-time and batch translation, language detection and job polling, all as LangChain tools.
pip install fluentc-langchain-toolfrom fluentc_langchain_tool import FluentCTranslationTool
tool = FluentCTranslationTool(api_key="your-api-key")
response = tool.run({
"text": "Hello, world!",
"target_language": "fr",
"source_language": "en",
"mode": "realtime",
})
print(response) # "Bonjour, le monde !"from fluentc_langchain_tool import FluentCBatchTranslationTool
tool = FluentCBatchTranslationTool(api_key="your-api-key")
result = tool.run({
"text": "<html>Hello, batch world!</html>",
"target_language": "de",
"source_language": "en",
})
print(result) # final translated output, after pollingfrom fluentc_langchain_tool import FluentCLanguageDetectorTool
tool = FluentCLanguageDetectorTool(api_key="your-api-key")
response = tool.run({"text": "Hola, ¿cómo estás?"})
print(response) # Detected language: es (confidence: 0.99)from langchain.agents import initialize_agent
from langchain.llms import OpenAI
from fluentc_langchain_tool import (
FluentCTranslationTool,
FluentCLanguageDetectorTool,
)
api_key = "your-api-key"
agent = initialize_agent(
tools=[
FluentCTranslationTool(api_key),
FluentCLanguageDetectorTool(api_key),
],
llm=OpenAI(temperature=0),
agent="zero-shot-react-description",
)
agent.run("Translate 'Hello world' from English to German using FluentC.")Translation as a tool your agent can call.
Real-time and batch
Choose a mode per call. Batch jobs poll for you and respect the API's estimated_wait_seconds, so you don't hammer it.
Language detection
A dedicated tool returns the detected language with a confidence score, so an agent can branch before it translates.
Text and HTML
Translate plain text or markup. Structure survives the round trip.
Errors an agent can read
Tools return a readable error string instead of raising, so the agent can recover or tell the user.
Job polling
Check a batch job's status, or fetch its result, with their own tools when you want control over the loop.
Drops into agents and chains
Each class is a LangChain tool. Add it to an agent's tool list and describe the job in plain English.
Six tools, one import.
| Tool class | Purpose |
|---|---|
FluentCTranslationTool | Real-time or batch translation submit |
FluentCLanguageDetectorTool | Detect the source language from input |
FluentCTranslationStatusTool | Check the status of a batch translation job |
FluentCResultsTool | Legacy. Use the status tool instead |
FluentCBatchTranslationTool | One-shot batch submit and polling |
FluentCSupportedLanguagesTool | List the languages enabled for your key |
Make LangChain agents multilingual, automatically.
Flat monthly pricing
No per-token surprises when an agent loops.
Memory built in
Identical segments aren't retranslated or billed again.
Async and real-time
Use real-time inside a tool call, batch for big payloads.
Built for scale, not for strings
The same engine behind the REST API, with 128+ languages.
Add translation to your agent.
Create a key, pip install, call the tool.