anthropics / claude-cookbooks
Claude Cookbooks
Claude Cookbooks Claude Cookbooks 提供了一系列代码和指南,旨在帮助开发者基于 Claude 进行构建,并提供可直接复制的代码片段,方便你轻松集成到自己的项目中。
Prerequisites To make the most of the examples in this cookbook, you’ll need a Claude API key (sign up for free here). While the code examples are primarily written in Python, the concepts can be adapted to any programming language that supports interaction with the Claude API. If you’re new to working with the Claude API, we recommend starting with our Claude API Fundamentals course to get a solid foundation.
先决条件 为了充分利用本手册中的示例,你需要一个 Claude API 密钥(点击此处免费注册)。虽然代码示例主要使用 Python 编写,但其中的概念可以适配到任何支持与 Claude API 交互的编程语言中。如果你是 Claude API 的新手,我们建议从我们的“Claude API 基础课程”开始,以打下坚实的基础。
Explore Further Looking for more resources to enhance your experience with Claude and AI assistants? Check out these helpful links:
- Anthropic developer documentation
- Anthropic support docs
- Anthropic Discord community
进一步探索 正在寻找更多资源来提升你使用 Claude 和 AI 助手的体验吗?请查看以下实用链接:
- Anthropic 开发者文档
- Anthropic 支持文档
- Anthropic Discord 社区
Contributing The Claude Cookbooks thrives on the contributions of the developer community. We value your input, whether it’s submitting an idea, fixing a typo, adding a new guide, or improving an existing one. By contributing, you help make this resource even more valuable for everyone. To avoid duplication of efforts, please review the existing issues and pull requests before contributing. If you have ideas for new examples or guides, share them on the issues page.
贡献指南 Claude Cookbooks 的发展离不开开发者社区的贡献。我们重视你的每一份投入,无论是提交想法、修正错别字、添加新指南,还是改进现有内容。通过你的贡献,你可以帮助我们将此资源变得对每个人都更有价值。为了避免重复劳动,请在贡献前查看现有的 Issues 和 Pull Requests。如果你有关于新示例或指南的想法,请在 Issues 页面分享。
Table of recipes / 配方目录
Capabilities / 能力
- Classification: Explore techniques for text and data classification using Claude.
- 分类: 探索使用 Claude 进行文本和数据分类的技术。
- Retrieval Augmented Generation: Learn how to enhance Claude’s responses with external knowledge.
- 检索增强生成 (RAG): 学习如何利用外部知识增强 Claude 的回答。
- Summarization: Discover techniques for effective text summarization with Claude.
- 摘要生成: 探索使用 Claude 进行高效文本摘要的技术。
Tool Use and Integration / 工具使用与集成
- Tool use: Learn how to integrate Claude with external tools and functions to extend its capabilities.
- Customer service agent
- Calculator integration
- SQL queries
- 工具使用: 学习如何将 Claude 与外部工具和函数集成,以扩展其能力。
- 客户服务代理
- 计算器集成
- SQL 查询
Third-Party Integrations / 第三方集成
- Retrieval augmented generation: Supplement Claude’s knowledge with external data sources.
- Vector databases (Pinecone)
- Wikipedia
- Web pages
- Embeddings with Voyage AI
- 检索增强生成: 使用外部数据源补充 Claude 的知识。
- 向量数据库 (Pinecone)
- 维基百科
- 网页
- 使用 Voyage AI 进行嵌入 (Embeddings)
Multimodal Capabilities / 多模态能力
- Vision with Claude: Getting started with images, best practices for vision, interpreting charts and graphs, extracting content from forms.
- Claude 视觉能力: 图像入门、视觉最佳实践、解读图表、从表单中提取内容。
- Generate images with Claude: Use Claude with Stable Diffusion for image generation.
- 使用 Claude 生成图像: 结合 Stable Diffusion 进行图像生成。
Advanced Techniques / 高级技术
- Sub-agents: Learn how to use Haiku as a sub-agent in combination with Opus.
- 子代理: 学习如何将 Haiku 作为子代理与 Opus 结合使用。
- Upload PDFs to Claude: Parse and pass PDFs as text to Claude.
- 上传 PDF 到 Claude: 解析 PDF 并将其作为文本传递给 Claude。
- Automated evaluations: Use Claude to automate the prompt evaluation process.
- 自动化评估: 使用 Claude 自动化提示词评估流程。
- Enable JSON mode: Ensure consistent JSON output from Claude.
- 启用 JSON 模式: 确保 Claude 输出一致的 JSON 格式。
- Create a moderation filter: Use Claude to create a content moderation filter for your application.
- 创建审核过滤器: 使用 Claude 为你的应用程序创建内容审核过滤器。
- Prompt caching: Learn techniques for efficient prompt caching with Claude.
- 提示词缓存: 学习使用 Claude 进行高效提示词缓存的技术。
Additional Resources / 额外资源
- Anthropic on AWS: Explore examples and solutions for using Claude on AWS infrastructure.
- AWS 上的 Anthropic: 探索在 AWS 基础设施上使用 Claude 的示例和解决方案。
- AWS Samples: A collection of code samples from AWS which can be adapted for use with Claude. Note that some samples may require modification to work optimally with Claude.
- AWS 示例: 来自 AWS 的代码示例集合,可适配用于 Claude。请注意,某些示例可能需要修改才能在 Claude 上达到最佳效果。