The Agent Skills Directory
npx skills add https://smithery.ai/skills/amnadtaowsoam/llm-function-calling(选择至少一个画像以启用特定模块)
LLM 函数调用(也称为工具使用)使大型语言模型能够通过调用预定义的函数与外部系统交互。LLM 不仅可以生成文本,还可以请求执行具有结构化参数的特定函数,接收结果,并基于这些结果继续推理。本技能涵盖 OpenAI 和 Anthropic 的函数调用 API、函数定义模式、结构化输出提取、多函数调用、带函数调用的流式处理、错误处理、验证、安全注意事项、速率限制、缓存、并行执行、函数路由、动态函数加载以及生产环境监控。
函数调用对于生产级 AI 应用至关重要,原因如下:
# 遵循最佳实践的示例实现
def example_function():
# 你的实现代码写在这里
pass
| 类型 | 关注领域 | 必需场景 / 模拟 |
|---|---|---|
| 单元测试 | 核心逻辑 | 必须覆盖主要逻辑和至少 3 个边界/错误情况。目标最低覆盖率 80% |
| 集成测试 | 数据库 / API | 所有外部 API 调用或数据库连接在单元测试中必须被模拟 |
| 端到端测试 | 用户旅程 | 测试关键用户流程 |
| 性能测试 | 延迟 / 负载 | 基准要求 |
| 安全测试 | 漏洞 / 认证 | SAST/DAST 或依赖项审计 |
| 前端测试 | 用户体验 / 可访问性 | 可访问性检查清单(WCAG),性能预算(Lighthouse 分数) |
request_iderror_rate、latency、queue_depth(AI 代理在发生错误时思考和解决问题的规范)
每周安装次数
–
来源
首次出现
–
(Select at least one profile to enable specific modules)
LLM function calling (also known as tool use) enables Large Language Models to interact with external systems by calling predefined functions. Instead of just generating text, LLM can request to execute specific functions with structured parameters, receive results, and continue reasoning based on those results. This skill covers OpenAI and Anthropic function calling APIs, function definition schemas, structured output extraction, multi-function calls, streaming with function calls, error handling, validation, security considerations, rate limiting, caching, parallel execution, function routing, dynamic function loading, and production monitoring.
Function calling is critical for production AI applications because:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# Example implementation following best practices
def example_function():
# Your implementation here
pass
| Type | Focus Area | Required Scenarios / Mocks |
|---|---|---|
| Unit | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
| Integration | DB / API | All external API calls or database connections must be mocked during unit tests |
| E2E | User Journey | Critical user flows to test |
| Performance | Latency / Load | Benchmark requirements |
| Security | Vuln / Auth | SAST/DAST or dependency audit |
| Frontend | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
Top Threats : Injection attacks, authentication bypass, data exposure
Data Handling : Sanitize all user inputs to prevent Injection attacks. Never log raw PII
Secrets Management : No hardcoded API keys. Use Env Vars/Secrets Manager
Authorization : Validate user permissions before state changes
request_iderror_rate, latency, queue_depth(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)
Weekly Installs
–
Source
First Seen
–
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
147,400 周安装