{
  "name": "embed-text",
  "title": "Embed text (OpenAI-compatible)",
  "category": "AI",
  "tags": [
    "ai",
    "curl-jq"
  ],
  "version": "1.0.2",
  "date": "2026-09-12",
  "notes": "Move to badouralix/curl-jq:ubuntu. The Alpine build this pinned carries two jq advisories on the path this item takes, and its publisher has not rebuilt it since 1 July. The ubuntu tag has neither, and fixable CRITICAL/HIGH drops from 4 to 2. It is Ubuntu 24.04 rather than Alpine, so sh is dash rather than busybox ash, curl goes back from 8.21.0 to 8.5.0 and jq from 1.8.1 to 1.7.1. Still runs as root.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/embed-text/1.0.2.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/embed-text/1.0.2/template.yaml",
  "entrypoint": "embed",
  "parameters": [
    {
      "name": "input-text",
      "title": "Input text",
      "description": "The text to embed.",
      "type": "string",
      "required": true
    },
    {
      "name": "model",
      "title": "Model",
      "description": "Embedding model identifier understood by the target endpoint.",
      "type": "string",
      "required": true,
      "example": "text-embedding-3-small"
    },
    {
      "name": "api-key-secret-key",
      "title": "API key secret key",
      "description": "Key within the Secret that holds the API key.",
      "type": "string",
      "required": false,
      "default": "api-key"
    },
    {
      "name": "api-key-secret-name",
      "title": "API key secret name",
      "description": "Name of the Kubernetes Secret holding the API key (sent as a bearer token).",
      "type": "string",
      "required": false,
      "default": "embeddings-api-key"
    },
    {
      "name": "base-url",
      "title": "Base URL",
      "description": "Base URL of an OpenAI-compatible API. The request goes to \u003cbase-url\u003e/v1/embeddings.",
      "type": "string",
      "required": false,
      "default": "https://api.openai.com",
      "example": "https://api.openai.com"
    }
  ],
  "images": [
    {
      "ref": "badouralix/curl-jq@sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2",
      "repository": "badouralix/curl-jq",
      "digest": "sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/embed-text/1.0.2/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/embed-text/1.0.2/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: embed-text\n  labels:\n    dagweave.io/catalog-item: embed-text\n  annotations:\n    # The catalog semver this manifest was authored at. The dagweave app records\n    # (catalog-item-id, semver) -\u003e content-hash -\u003e base-vN when it mints the tenant\n    # cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.\n    dagweave.io/catalog-version: \"1.0.2\"\n    dagweave.io/catalog-category: \"AI\"\nspec:\n  entrypoint: embed\n  templates:\n    - name: embed\n      inputs:\n        parameters:\n          # Base URL of an OpenAI-compatible API. The item POSTs to\n          # \u003cbase-url\u003e/v1/embeddings.\n          - name: base-url\n            default: https://api.openai.com\n          # Embedding model identifier understood by the target endpoint.\n          - name: model\n          # The text to embed.\n          - name: input-text\n          # Name/key of a Kubernetes Secret holding the API key (sent as a bearer).\n          - name: api-key-secret-name\n            default: embeddings-api-key\n          - name: api-key-secret-key\n            default: api-key\n      container:\n        # Pinned by digest per the catalog convention: an image rebuild can never\n        # silently change the behaviour of an already-released item version.\n        # badouralix/curl-jq:ubuntu — provides sh, curl and jq.\n        image: badouralix/curl-jq@sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2\n        command: [sh, -c]\n        # Values are passed as env vars (below), never interpolated into the shell.\n        # jq assembles the {model, input} body with --arg so text containing quotes\n        # or newlines is escaped correctly, then the raw JSON response (with the\n        # embedding vector) is echoed for a downstream step to consume.\n        args:\n          - |\n            set -eu\n            BODY=$(jq -cn --arg m \"${MODEL}\" --arg i \"${INPUT_TEXT}\" \\\n              '{model: $m, input: $i}')\n            curl -sSf -X POST \"${BASE_URL}/v1/embeddings\" \\\n              -H \"Content-Type: application/json\" \\\n              -H \"Authorization: Bearer ${API_KEY}\" \\\n              --data-raw \"${BODY}\"\n        env:\n          - name: BASE_URL\n            value: \"{{inputs.parameters.base-url}}\"\n          - name: MODEL\n            value: \"{{inputs.parameters.model}}\"\n          - name: INPUT_TEXT\n            value: \"{{inputs.parameters.input-text}}\"\n          - name: API_KEY\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.api-key-secret-name}}\"\n                key: \"{{inputs.parameters.api-key-secret-key}}\"\n",
  "templateSha256": "03cefa74ed11686ea0844b50c2bca7352011b33cdeb5381ca37c5eed592e7c26",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/embed-text",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
