Chuyển đến nội dung
Skillpedia
Lập trình chung5.8k · #14558

technology-selection

Skill này làm gì

Skill này giúp chọn và triển khai công nghệ AI hoặc machine learning phù hợp cho ứng dụng .NET 8 trở lên, như ML.NET, Microsoft.Extensions.AI hoặc ONNX Runtime. Skill dành cho lập trình viên .NET thêm tính năng AI và muốn đúng công cụ cho tác vụ.

Khi nào nên dùng

  • ✓Khi bạn muốn thêm phân loại, hồi quy hoặc gợi ý vào một ứng dụng .NET.
  • ✓Khi bạn muốn thêm tính năng mô hình ngôn ngữ hoặc một AI agent vào ứng dụng .NET.
  • ✓Khi bạn muốn so sánh các lựa chọn AI trước khi viết bất kỳ code nào.

Liên kết skill

https://github.com/dotnet/skills/blob/main/plugins/dotnet-ai/skills/technology-selection/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/dotnet/skills/blob/main/plugins/dotnet-ai/skills/technology-selection/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

“Tôi muốn thêm gợi ý sản phẩm vào ứng dụng .NET của mình. Tôi nên dùng công nghệ nào và vì sao?”

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

Cách hoạt động

Agent xếp tác vụ vào một nhóm, như dữ liệu có cấu trúc, mô hình ngôn ngữ hoặc công việc kiểu agent, rồi đề xuất một công nghệ và chỉ xây dựng những gì tác vụ yêu cầu.

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.

.NET AI and Machine Learning

Pick the right technology first, then deliver only what the task asks for. If the task asks for a plan, comparison, or architecture (or says "do not write code"), produce that — do not scaffold, build, or run code unprompted.

Step 1: Classify the task (decision tree)

State which branch applies and why, then choose that technology.

Task type Technology Why
Structured/tabular: classification, regression, clustering, anomaly detection, recommendation ML.NET (Microsoft.ML) Deterministic (fixed seed), no cloud dependency, purpose-built
NL understanding, generation, summarization, reasoning (single prompt → response, no tools) LLM via Microsoft.Extensions.AI (IChatClient) Language capability, no orchestration needed
Agentic: multi-step tool/function calling, agent loops, multi-agent Microsoft Agent Framework (Microsoft.Agents.AI) on Microsoft.Extensions.AI Needs orchestration, tool dispatch, iteration control IChatClient lacks
GitHub Copilot extensions / custom dev-workflow agents GitHub Copilot SDK (GitHub.Copilot.SDK) Integrates with the Copilot agent runtime
Run a pre-trained/custom model in production ONNX Runtime (Microsoft.ML.OnnxRuntime) Hardware-accelerated, format-agnostic inference
Local/offline LLM inference OllamaSharp (Ollama models) Privacy-sensitive, air-gapped, cost-constrained
Semantic search, RAG, embedding storage Microsoft.Extensions.VectorData.Abstractions (MEVD) + a provider (Azure AI Search, Milvus, MongoDB, pgvector, Pinecone, Qdrant, Redis, SQL) Provider-agnostic vector search
Ingest, chunk, load documents into a vector store Microsoft.Extensions.AI.DataIngestion (preview) + MEVD Parses, chunks, embeds, upserts
Both structured predictions AND NL reasoning Hybrid: ML.NET scoring + LLM reasoning layer ML.NET is reproducible; LLM adds explanation

Critical rule: Do NOT use an LLM for tasks ML.NET handles well (tabular classification, regression, clustering) — LLMs are slower, costlier, and non-deterministic for these.

Step 1b: Pick the library layer

Layer Library Use when
Abstraction Microsoft.Extensions.AI (MEAI) Always the foundation. Use IChatClient directly for prompt-response and simple, bounded function invocation.
Provider SDK Azure.AI.OpenAI / OpenAI / Azure.AI.Inference / OllamaSharp Concrete provider behind MEAI via AddChatClient.
Orchestration Microsoft.Agents.AI (prerelease) Multi-step tool use, durable agent loops, and multi-agent workflows.
Copilot GitHub.Copilot.SDK Building Copilot-platform extensions only.

Rules: start with MEAI; put the provider behind it via AddChatClient (don't call the provider in business logic); use Microsoft.Agents.AI for multi-step or durable agent workflows rather than hand-rolling an agent loop; never mix a raw HttpClient-to-OpenAI call with MEAI in the same workflow. Do not use Accord.NET (archived). For new projects, prefer MEAI and Agent Framework unless existing Semantic Kernel features or investments are a requirement. Register AI/ML services via DI; load secrets from user-secrets / env / Key Vault — never hardcode keys.

Step 2: Cover the branch essentials, then decide depth

Every answer — plan or implementation — must address the guardrails for the selected branch:

  • ML.NET — new MLContext(seed: …) (reproducible); TrainTestSplit + evaluate on the held-out set; report real metrics (MicroAccuracy/MacroAccuracy/LogLoss, AUC/F1, or RMSE/R²); serve with PredictionEnginePool<TIn,TOut> (never a singleton PredictionEngine).
  • LLM (MEAI) — depend on IChatClient registered via AddChatClient (provider behind it); set Temperature and MaxOutputTokens in ChatOptions; add retry/timeout (RetryingChatClient/Polly); pin a dated model; load keys from user-secrets / env / Key Vault — never hardcode an sk-… key; validate non-deterministic output against a schema with a fallback.
  • Agentic (Agent Framework) — orchestrate with Microsoft.Agents.AI on IChatClient (never a hand-rolled loop); set MaximumIterations and a token/cost ceiling; define each tool with a clear schema (AIFunctionFactory.Create); log each step (never raw sensitive content).
  • **RAG / e
Câu hỏi thường gặp

Skill có viết code khi bạn không yêu cầu không?

Không. Nếu bạn yêu cầu kế hoạch hoặc so sánh, skill chỉ đưa ra những thứ đó và không xây dựng code.

Skill bao quát những công cụ nào?

ML.NET, Microsoft.Extensions.AI, Microsoft Agent Framework, ONNX Runtime, Ollama và GitHub Copilot SDK.

Skill có hoạt động với mô hình cục bộ không?

Có. Suy luận mô hình cục bộ hoặc ngoại tuyến là một trong các lựa chọn được bao quát.

Chi tiết

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

Guides technology selection and implementation of AI and ML features in .NET 8+ applications using ML.NET, Microsoft.Extensions.AI (MEAI), Microsoft Agent Framework (MAF), GitHub Copilot SDK, ONNX Runtime, and OllamaSharp. Covers the full spectrum from classic ML through modern LLM orchestration to local inference. Use when adding classification, regression, clustering, anomaly detection, recommendation, LLM integration (text generation, summarization, reasoning), RAG pipelines with vector search, agentic workflows with tool calling, Copilot extensions, or custom model inference via ONNX Runti

repo: dotnet/skills

Độ phổ biến

Sao GitHub
5.8k
Vị trí xếp hạng
#14558
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ự