嵌入工具

Configuration File: embedding_tools.json Tool Type: Local Tools Count: 5

此页面包含在``embedding_tools.json``配置文件中定义的所有工具。

可用工具

**embedding_database_add**(类型:EmbeddingDatabase)

Append documents to an existing per-collection datastore (<name>.db + <name>.faiss). Uses the sam…

embedding_database_add 工具规范

工具信息:

  • 名称embedding_database_add

  • 类型EmbeddingDatabase

  • Description: Append documents to an existing per-collection datastore (<name>.db + <name>.faiss). Uses the same L2-normalized cosine setup. Enforces model/dimension consistency with the collection.

参数:

  • action (string) (optional) No description

  • database_name (string) (required) Existing collection/database name

  • ``documents``(数组)(必需)要嵌入并添加的新文档文本列表

  • metadata (array) (optional) Optional metadata per document (must match length of documents if provided)

  • provider (string) (optional) Embedding backend override. If omitted, falls back to collection/env.

  • model (string) (optional) Embedding model/deployment id override. If omitted, uses collection model or env default.

示例用法:

query = {
    "name": "embedding_database_add",
    "arguments": {
        "database_name": "example_value",
        "documents": ["item1", "item2"]
    }
}
result = tu.run(query)

**embedding_database_create**(类型:EmbeddingDatabase)

Create a per-collection datastore: <name>.db (SQLite) + <name>.faiss (FAISS). Embeds documents us…

嵌入式数据库创建工具规范

工具信息:

  • 名称: embedding_database_create

  • 类型EmbeddingDatabase

  • Description: Create a per-collection datastore: <name>.db (SQLite) + <name>.faiss (FAISS). Embeds documents using the chosen provider (openai/azure/huggingface/local). Vectors are L2-normalized; FAISS index uses IndexFlatIP (cosine).

参数:

  • action (string) (optional) No description

  • database_name (string) (required) Collection/database name (produces <name>.db and <name>.faiss)

  • ``documents``(数组)(必填)要嵌入和存储的文档文本列表

  • metadata (array) (optional) Optional metadata for each document (must match length of documents if provided)

  • provider (string) (optional) Embedding backend. Defaults: EMBED_PROVIDER, else by available creds (azure>openai>huggingface>local).

  • model (string) (optional) Embedding model/deployment id. Defaults: EMBED_MODEL, else provider-specific sensible default.

  • description (string) (optional) Optional human-readable description for the collection

示例用法:

query = {
    "name": "embedding_database_create",
    "arguments": {
        "database_name": "example_value",
        "documents": ["item1", "item2"]
    }
}
result = tu.run(query)

**embedding_database_search**(类型:EmbeddingDatabase)

Semantic search over a per-collection datastore using FAISS (cosine via L2-normalized vectors). S…

embedding_database_search 工具规范

工具信息:

  • 名称embedding_database_search

  • 类型EmbeddingDatabase

  • Description: Semantic search over a per-collection datastore using FAISS (cosine via L2-normalized vectors). Supports optional metadata filtering.

参数:

  • action (string) (optional) No description

  • database_name (string) (required) Collection/database name to search

  • query (string) (required) Query text to embed and search with

  • top_k (integer) (optional) Number of most similar documents to return

  • filters (object) (optional) Optional metadata filters (‘$gte’, ‘$lte’, ‘$in’, ‘$contains’, exact match)

  • provider (string) (optional) Embedding backend for the query vector. Defaults to collection/env.

  • model (string) (optional) Embedding model/deployment id for the query vector. Defaults to collection/env.

示例用法:

query = {
    "name": "embedding_database_search",
    "arguments": {
        "database_name": "example_value",
        "query": "example_value"
    }
}
result = tu.run(query)

**embedding_sync_download**(类型:EmbeddingSync)

Download a per-collection datastore from Hugging Face Hub into ./data/embeddings as <name>.db and…

embedding_sync_download 工具规范

工具信息:

  • 名称embedding_sync_download

  • 类型EmbeddingSync

  • Description: Download a per-collection datastore from Hugging Face Hub into ./data/embeddings as <name>.db and <name>.faiss.

参数:

  • action (string) (optional) No description

  • repository (string) (required) HF dataset repo to download from (e.g., ‘user/repo’)

  • local_name (string) (optional) Local collection name to save as (defaults to repo basename)

  • overwrite (boolean) (optional) Whether to overwrite existing local files

示例用法:

query = {
    "name": "embedding_sync_download",
    "arguments": {
        "repository": "example_value"
    }
}
result = tu.run(query)

**embedding_sync_upload**(类型:EmbeddingSync)

Upload a per-collection datastore to Hugging Face Hub: <name>.db and <name>.faiss, plus metadata …

embedding_sync_upload 工具规范

工具信息:

  • 名称embedding_sync_upload

  • 类型EmbeddingSync

  • Description: Upload a per-collection datastore to Hugging Face Hub: <name>.db and <name>.faiss, plus metadata files.

参数:

  • action (string) (optional) No description

  • database_name (string) (required) Collection/database name to upload (expects <name>.db and <name>.faiss under data_dir)

  • repository (string) (required) HF dataset repo (e.g., ‘user/repo’)

  • description (string) (optional) Optional dataset description in the HF README

  • private (boolean) (optional) Create/use a private HF repo

  • commit_message (string) (optional) Commit message for the upload

示例用法:

query = {
    "name": "embedding_sync_upload",
    "arguments": {
        "database_name": "example_value",
        "repository": "example_value"
    }
}
result = tu.run(query)