Skip to content

elizaos-plugins/plugin-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@elizaos/plugin-translate

LibreTranslate integration for ElizaOS agents. This plugin exposes a reusable service that calls a LibreTranslate instance, allowing agents to translate text between languages.

Setup

  1. Install dependencies and build:
bun install
bun run build
  1. Configure environment variables (optional overrides):
  • LIBRE_TRANSLATE_BASE_URL – Defaults to https://libretranslate.com. Set this if you run a different LibreTranslate host.
  • LIBRE_TRANSLATE_API_KEY – Optional API key if your instance requires authentication.
  • LIBRE_TRANSLATE_REQUEST_TIMEOUT_MS – Optional timeout in milliseconds (default 15000).

Usage

Register the plugin in your agent configuration and access the service at runtime:

import { LibreTranslateService } from '@elizaos/plugin-translate';

const translateService = runtime.getService(LibreTranslateService.serviceType) as LibreTranslateService | null;
if (!translateService) throw new Error('Translate service not available');

const result = await translateService.translate({
  text: 'Hello world',
  targetLanguage: 'es',
});

Development

  • bun run test – Run unit tests (uses mocked HTTP calls).
  • bun run format – Format source files.
  • bun run clean – Clean build artifacts.

About

translation services

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published