Skip to main content

LangChain integration for Nativ — AI-powered localization tools

Project description

langchain-nativ

PyPI License: MIT

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_nativ-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_nativ-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

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

Hashes for langchain_nativ-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bc227b1dc4d868a656fd5fc565b3b507046829b88b0ce711437eddccb87b64df
MD5 d39a03f885bd0e9f0633ee7b600845ad
BLAKE2b-256 057211e56795f58bace21c34dcf05d679d92994dcbd6788d04e7e38e69460bfd

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_nativ-0.1.0.tar.gz:

Publisher: publish.yml on Nativ-Technologies/langchain-nativ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_nativ-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_nativ-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75d89875da227a67ae79e63d2a5074138cbd8af4c22defea803e938c5d6688bc
MD5 5e2260e9de6237d0e40718490b32adf2
BLAKE2b-256 8b697ff1b218f5287ace2fe36078d019903a3aa60371be28928ac40027cb1bc3

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page