AgentPM™

@zack/translate-text

Translate text into a target language using LLM.

Install
agentpm install @zack/translate-text@0.1.4
Load
Weekly downloads
3
0%
Last publish
3w ago
v0.1.4
agent.json
{
  "name": "translate-text",
  "version": "0.1.4",
  "description": "Translate text into a target language using LLM.",
  "files": [
    "dist/"
  ],
  "entrypoint": {
    "args": [
      "dist/index.js"
    ],
    "command": "node",
    "timeout_ms": 120000
  },
  "environment": {
    "vars": {
      "OPENAI_API_KEY": {
        "required": true,
        "description": "API key for OpenAI"
      }
    }
  },
  "inputs": {
    "type": "object",
    "required": [
      "text",
      "target_language"
    ],
    "properties": {
      "text": {
        "type": "string",
        "description": "The text to be translated"
      },
      "target_language": {
        "type": "string",
        "description": "The language to translate the text into"
      }
    },
    "additionalProperties": false
  },
  "outputs": {
    "oneOf": [
      {
        "type": "object",
        "required": [
          "ok",
          "translated"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "translated": {
            "type": "string",
            "description": "The translated text"
          }
        },
        "additionalProperties": false
      },
      {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "object",
            "required": [
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code (e.g. INPUT_INVALID, FETCH_FAILED)"
              },
              "details": {
                "type": "object",
                "description": "Optional structured context"
              },
              "message": {
                "type": "string",
                "description": "Human-readable error message"
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      }
    ]
  },
  "license": {
    "file": "LICENSE",
    "spdx": "MIT"
  },
  "runtime": {
    "type": "node",
    "version": "20"
  }
}
Environment variables
Required
OPENAI_API_KEY
API key for OpenAI
Compatibility
NodePython