Skip to main content

embed

Receives a text question and returns its embedding vector using gemini-embedding-001 via Vertex AI. Use this when you need a semantic embedding for a question — for downstream vector search, similarity comparison, or passing to another tool.

소스 정보

저장소
mozilla/rag-skills
최근 소스 활동
2026년 6월 25일 13:30
감지된 SKILL.md 언어
영어
스타
2
포크
2

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
embed
description
Receives a text question and returns its embedding vector using gemini-embedding-001 via Vertex AI. Use this when you need a semantic embedding for a question — for downstream vector search, similarity comparison, or passing to another tool.
# Embed Skill Embeds a text question using `gemini-embedding-001` (Vertex AI, project `mozdata`) and returns the resulting vector as a JSON array. ## Usage ```bash python "${CLAUDE_PLUGIN_ROOT:?set by the plugin system; if empty, invoke this via the Skill tool}"/skills/embed/scripts/embed.py --question "<your question>" ``` `` Output is a JSON array of 3072 floats printed to stdout: ```json [0.012, -0.034, 0.091, ...] ``` ## Steps 1. Run the script with the user's question as `--question`. 2. Capture stdout — that is the embedding vector. 3. Return or pass the vector as needed (e.g. to the `vector-search` skill). ## Authentication This skill connects to Vertex AI using a service account — the `cloud-platform` scope is enforced on the impersonated token in code. Just log in: ```bash gcloud auth application-default login ``` Your authenticated Google Cloud credentials are only used to create a new and temporary access token on behalf of the service account defined in `SERVICE_ACCOUNT`, which requires the `roles/iam.serviceAccountTokenCreator` role on that service account. Your login no longer needs `--scopes`. ## Troubleshooting | Symptom | Fix | |---------|-----| | `GCP authentication required` / `API error 401` | Re-run `gcloud auth application-default login`; confirm you have `roles/iam.serviceAccountTokenCreator` on the service account in `SERVICE_ACCOUNT` | | `Missing dependency` | `pip install google-auth requests` | | `Unexpected response from Vertex AI` | Confirm Vertex AI is enabled in project `mozdata` and the embedding model is available |
GitHub에서 보기