Classify files according to specific rules
БесплатноБез исполняемых скриптовНе проверенInvoke this skill BEFORE implementing any text/document classification task to learn the correct llama_cloud_services API usage. Required reading before…
Об этом скилле
Texts and Files Classification
Quick start
- Define classification rules:
from llama_cloud.types import ClassifierRule
# Define classification rules (natural language descriptions)
rules = [
ClassifierRule(
type="invoice",
description="Documents that are invoices for goods or services, containing line items, prices, and payment terms",
),
ClassifierRule(
type="contract",
description="Legal agreements between parties, containing terms, conditions, and signatures",
),
ClassifierRule(
type="receipt",
description="Proof of payment documents, typically shorter than invoices, showing items purchased and amount paid",
),
]
- Create the classification client and run the job:
from llama_cloud_services.beta.classifier.client import ClassifyClient
# Initialize client
# Note: the beta client differs in usage slightly compared to other clients in llama-cloud-services
classifier = ClassifyClient.from_api_key(api_key)
# Classify a PDF directly (parsing happens implicitly)
result = await classifier.aclassify_file_path(
rules=rules,
file_input_path="document.pdf",
)
# Access classification results
classification = result.items[0].result
print(f"Predicted Type: {classification.type}")
print(f"Confidence: {classification.confidence:.2%}")
print(f"Reasoning: {classification.reasoning}")
For more detailed code implementations, see REFERENCE.md.
Requirements
The llama_cloud_services package must be installed in your environment (with it come the pydantic and llama_cloud packages):
pip install llama_cloud_services
And the LLAMA_CLOUD_API_KEY must be available as an environment variable:
export LLAMA_CLOUD_API_KEY="..."
For more detailed code implementations, see REFERENCE.md.
Requirements
The llama_cloud_services package must be installed in your environment:
pip install llama_cloud_services
And the LLAMA_CLOUD_API_KEY must be available as an environment variable:
export LLAMA_CLOUD_API_KEY="..."
Установить Classify files according to specific rules в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл Classify files according to specific rules?
Invoke this skill BEFORE implementing any text/document classification task to learn the correct llama_cloud_services API usage. Required reading before writing classification code." Requires the llama_cloud_services package and LLAMA_CLOUD_API_KEY as an environment variable.
Как установить скилл Classify files according to specific rules?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Classify files according to specific rules запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic