Skip to main content

LlamaIndex integration for Nativ — AI-powered localization tools

Project description

llamaindex-nativ

PyPI License: MIT

LlamaIndex integration for Nativ — AI-powered localization.

Give any LlamaIndex 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 llamaindex-nativ

Quick start

from llamaindex_nativ import NativToolSpec

spec = NativToolSpec()  # reads NATIV_API_KEY from env
tools = spec.to_tool_list()

# Use a single tool directly
result = spec.translate("Hello world", target_language="French")
print(result)
# Bonjour le monde
# Rationale: Standard greeting translated with neutral register.

Use with a LlamaIndex agent

from llamaindex_nativ import NativToolSpec
from llama_index.llms.openai import OpenAI
from llama_index.core.agent import ReActAgent

tools = NativToolSpec().to_tool_list()
llm = OpenAI(model="gpt-4o")
agent = ReActAgent.from_tools(tools, llm=llm, verbose=True)

response = agent.chat(
    "Translate 'Welcome back!' to French, German, and Japanese"
)

Available tools

Tool Description
translate Translate text with cultural adaptation
translate_batch Translate multiple texts to one language
search_translation_memory Fuzzy-search existing translations
add_translation_memory_entry Store an approved translation for reuse
get_languages List configured target languages
get_style_guides Get style guide content
get_brand_voice Get the brand voice prompt
get_translation_memory_stats Get TM statistics

Configuration

Pass api_key and base_url directly:

spec = NativToolSpec(api_key="nativ_...", base_url="https://api.usenativ.com")

Or set the environment variable:

export NATIV_API_KEY=nativ_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Use individual tools

from llamaindex_nativ import NativToolSpec

spec = NativToolSpec()

# Search translation memory
print(spec.search_translation_memory("Welcome"))
# Found 3 match(es):
# - [98% exact] "Welcome" -> "Bienvenue"
# - [85% fuzzy] "Welcome back" -> "Content de vous revoir"
# ...

# Get configured languages
print(spec.get_languages())
# Configured languages:
# - French (fr) -- formality: formal
# - German (de) -- formality: formal
# ...

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

llamaindex_nativ-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

llamaindex_nativ-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file llamaindex_nativ-0.1.0.tar.gz.

File metadata

  • Download URL: llamaindex_nativ-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llamaindex_nativ-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dcf5af98ed141acfa6c811806a18deac79d5a12e3630761b1b32d40c7af3b774
MD5 afce153d5f3d92712a4facf4d0870b62
BLAKE2b-256 017232771835b4922f0e6c353e26b7777dc53d44d4421934f7b1426a9f036071

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on Nativ-Technologies/llamaindex-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 llamaindex_nativ-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llamaindex_nativ-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a88f8e11c02c4c6cf6576be2b1e7d88e74a25ad184747407e6450420a5062c2
MD5 25f6746c2d77eb05f34628570e14b601
BLAKE2b-256 67cc0428b8aaa1dc05d13d4ba7a57af93cb43e47dafe521756ad6a74bbea5e4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for llamaindex_nativ-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Nativ-Technologies/llamaindex-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