Chuyển đến nội dung
Skillpedia
Agent7.6k · #13153

decisions

Skill này làm gì

Skill này giải thích cách dùng một trợ giúp quyết định trong ứng dụng Agent-Native để gắn nhãn hoặc chấm điểm một tin nhắn hay đầu vào. Trợ giúp trả về một câu trả lời và không bao giờ thực hiện hành động đi kèm. Skill dành cho lập trình viên thêm định tuyến thông minh hoặc phân loại vào ứng dụng.

Khi nào nên dùng

  • ✓Khi bạn cần quyết định một tin nhắn có phải là yêu cầu thuộc loại nhất định không.
  • ✓Khi bạn muốn chấm điểm một đầu vào theo các mức được sắp thứ tự.
  • ✓Khi bạn cần chọn một giá trị từ một tập lựa chọn có tên.

Liên kết skill

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/decisions/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/decisions/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể kiểm tra các tin nhắn khách hàng đến và cho tôi biết tin nào là yêu cầu hủy không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Lập trình viên truyền đầu vào và các câu hỏi có tên cho trợ giúp. Trợ giúp trả về một kết quả có nhãn, và ứng dụng quyết định sẽ làm gì với nó.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Decisions

Rule

Use decide() to classify or score supplied inputs. It returns a result and never performs, authorizes, or replaces the action selected from that result.

How

Pass an explicit ownerEmail, an input string or array of parts, and named questions to decide() from @agent-native/core/decisions:

import { decide } from "@agent-native/core/decisions";

const result = await decide({
  ownerEmail: "owner@example.com",
  input: [{ type: "text", text: "Please cancel Friday's lunch reservation." }],
  questions: [
    {
      type: "predicate",
      name: "isCancellationRequest",
      instructions: "Does the message ask to cancel a reservation?",
    },
  ],
});

input can be a plain string or contain text, structured JSON, or an image URL. Questions are named and use one of these shapes:

Type Fields Use
predicate name, instructions Evaluate one stated predicate
choice name, instructions, choices: { value: string, description: string }[] Choose among the supplied string values
score name, instructions, levels: { label: string, description: string }[] Score against 2–10 ordered levels

Provider and model capabilities can differ. Treat question support as capability-aware. Only claim a provider/model supports a question type after that combination has been verified. An ok result includes provider, model, and answers keyed by question name; cached and usage are optional. A not_configured result includes the missing_credentials reason and configured provider list. A failed result has a typed reason and may include provider and questionNames. Handle these statuses as distinct outcomes; never turn a failure into an answer.

Provider routing and caches

Provider order is configurable per workspace. New customer workspaces try Builder Jev first, then a personal Jev key, then OpenAI. Within Jev, the Builder gateway is tried before falling back to a direct key. If no provider is configured, decide() returns not_configured.

getDecisionsStatus() reports credential readiness separately from provider capabilities. The Builder Jev proxy is verified for predicate and choice. Jev score remains unverified and disabled by its capability flag, so decide() skips Jev for score questions and continues to the next configured provider. A Jev-only score request returns failed with unverified_capability. The OpenAI Decisions API supports scores with 2–10 ordered levels; its request and response mapping is covered by documented fixtures.

Key any per-provider threshold or cache by both provider and model. cacheKey enables caching only when supplied. Cache identity includes the owner, organization, provider, model, cache key, input, and questions. The in-memory cache has a 60-second TTL and a 256-entry cap.

Related skills

  • actions — keep action behavior focused and deterministic.
Câu hỏi thường gặp

Trợ giúp có hủy hoặc thay đổi gì không?

Không. Nó chỉ trả về kết quả và không thực hiện hay cho phép hành động nào.

Nó có thể hỏi những loại câu hỏi nào?

Nó hỗ trợ các vị ngữ có/không, lựa chọn giữa các giá trị có tên và điểm trên hai đến mười mức.

Mọi mô hình có hỗ trợ mọi loại câu hỏi không?

Skill nói khả năng hỗ trợ khác nhau theo nhà cung cấp và mô hình, nên mỗi tổ hợp phải được kiểm tra trước khi dùng.

Chi tiết

Mô tả gốc của tác giả

How to use `@agent-native/core/decisions` for capability-aware classification and scoring. Use when implementing or reviewing decision evaluation, provider ordering, per-provider thresholds, or decision-result caches.

repo: BuilderIO/agent-native

Độ phổ biến

Sao GitHub
7.6k
Vị trí xếp hạng
#13153
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự