LangChain integration for Nativ — AI-powered localization tools
Project description
langchain-nativ
LangChain integration for Nativ — AI-powered localization.
Give any LangChain agent the ability to translate text, search translation memory, manage terminology, and more — all backed by your team's brand voice and style guides.
Installation
pip install langchain-nativ
Quick start
from langchain_nativ import NativTranslateTool
tool = NativTranslateTool() # reads NATIV_API_KEY from env
result = tool.invoke({
"text": "Hello world",
"target_language": "French",
})
print(result)
# Bonjour le monde
# Rationale: Standard greeting translated with neutral register.
Use with a LangChain agent
from langchain_nativ import NativToolkit
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent
tools = NativToolkit().get_tools()
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, tools)
result = agent.invoke({
"messages": [{
"role": "user",
"content": "Translate 'Welcome back!' to French, German, and Japanese",
}]
})
Available tools
| Tool | Description |
|---|---|
NativTranslateTool |
Translate text with cultural adaptation |
NativTranslateBatchTool |
Translate multiple texts to one language |
NativSearchTranslationMemoryTool |
Fuzzy-search existing translations |
NativAddTranslationMemoryEntryTool |
Store an approved translation for reuse |
NativGetLanguagesTool |
List configured target languages |
NativGetStyleGuidesTool |
Get style guide content |
NativGetBrandVoiceTool |
Get the brand voice prompt |
NativGetTranslationMemoryStatsTool |
Get TM statistics |
Configuration
All tools accept api_key and base_url parameters:
tool = NativTranslateTool(api_key="nativ_...", base_url="https://api.usenativ.com")
Or set the environment variable:
export NATIV_API_KEY=nativ_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Use individual tools
from langchain_nativ import NativSearchTranslationMemoryTool
search = NativSearchTranslationMemoryTool()
print(search.invoke({"query": "Welcome"}))
# Found 3 match(es):
# - [98% exact] "Welcome" → "Bienvenue"
# - [85% fuzzy] "Welcome back" → "Content de vous revoir"
# ...
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_nativ-0.1.0.tar.gz.
File metadata
- Download URL: langchain_nativ-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc227b1dc4d868a656fd5fc565b3b507046829b88b0ce711437eddccb87b64df
|
|
| MD5 |
d39a03f885bd0e9f0633ee7b600845ad
|
|
| BLAKE2b-256 |
057211e56795f58bace21c34dcf05d679d92994dcbd6788d04e7e38e69460bfd
|
Provenance
The following attestation bundles were made for langchain_nativ-0.1.0.tar.gz:
Publisher:
publish.yml on Nativ-Technologies/langchain-nativ
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_nativ-0.1.0.tar.gz -
Subject digest:
bc227b1dc4d868a656fd5fc565b3b507046829b88b0ce711437eddccb87b64df - Sigstore transparency entry: 973923757
- Sigstore integration time:
-
Permalink:
Nativ-Technologies/langchain-nativ@250dbfc49b46226f47e9ce0620ab26e23d100e03 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Nativ-Technologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@250dbfc49b46226f47e9ce0620ab26e23d100e03 -
Trigger Event:
release
-
Statement type:
File details
Details for the file langchain_nativ-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_nativ-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75d89875da227a67ae79e63d2a5074138cbd8af4c22defea803e938c5d6688bc
|
|
| MD5 |
5e2260e9de6237d0e40718490b32adf2
|
|
| BLAKE2b-256 |
8b697ff1b218f5287ace2fe36078d019903a3aa60371be28928ac40027cb1bc3
|
Provenance
The following attestation bundles were made for langchain_nativ-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Nativ-Technologies/langchain-nativ
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_nativ-0.1.0-py3-none-any.whl -
Subject digest:
75d89875da227a67ae79e63d2a5074138cbd8af4c22defea803e938c5d6688bc - Sigstore transparency entry: 973923947
- Sigstore integration time:
-
Permalink:
Nativ-Technologies/langchain-nativ@250dbfc49b46226f47e9ce0620ab26e23d100e03 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Nativ-Technologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@250dbfc49b46226f47e9ce0620ab26e23d100e03 -
Trigger Event:
release
-
Statement type: