anthropics/claude-cookbooks

GitHub: anthropics/claude-cookbooks

Claude烹饪书提供Claude API的实践指南和代码示例。

Stars: 49147 | Forks: 5823

# Claude 烹饪书 Claude 烹饪书提供代码和指南,旨在帮助开发者使用 Claude 进行开发,提供可复制的代码片段,您可以将它们轻松集成到自己的项目中。 ## 前置条件 为了充分利用本烹饪书中的示例,您需要一个 Claude API 密钥(免费注册[这里](https://www.anthropic.com))。 虽然代码示例主要用 Python 编写,但概念可以适应任何支持与 Claude API 交互的编程语言。 如果您是 Claude API 的新手,我们建议您从我们的 [Claude API 基础课程](https://github.com/anthropics/courses/tree/master/anthropic_api_fundamentals) 开始,以获得坚实的基础。 ## 深入探索 寻找更多资源以增强您与 Claude 和 AI 助手的体验?请查看以下有用的链接: - [Anthropic 开发者文档](https://docs.claude.com/claude/docs/guide-to-anthropics-prompt-engineering-resources) - [Anthropic 支持文档](https://support.anthropic.com) - [Anthropic Discord 社区](https://www.anthropic.com/discord) ## 贡献 Claude 烹饪书得益于开发者社区的贡献。我们重视您的意见,无论是提交一个想法、修复一个错误、添加一个新的指南还是改进现有的指南,通过贡献,您帮助使这个资源对每个人来说都更有价值。 为了避免重复劳动,请在贡献之前查看现有的问题和拉取请求。 如果您有关于新示例或指南的想法,请在 [问题页面](https://github.com/anthropics/anthropic-cookbook/issues) 上分享。 ## 菜谱表 ### 功能 - [分类](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/classification):探索使用 Claude 进行文本和数据分类的技术。 - [检索增强生成](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/retrieval_augmented_generation):了解如何通过外部知识增强 Claude 的响应。 - [摘要](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/summarization):发现使用 Claude 进行有效文本摘要的技术。 ### 工具使用和集成 - [工具使用](https://github.com/anthropics/anthropic-cookbook/tree/main/tool_use):学习如何将 Claude 与外部工具和功能集成以扩展其功能。 - [客户服务代理](https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/customer_service_agent.ipynb) - [计算器集成](https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/calculator_tool.ipynb) - [SQL 查询](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/how_to_make_sql_queries.ipynb) ### 第三方集成 - [检索增强生成](https://github.com/anthropics/anthropic-cookbook/tree/main/third_party):使用外部数据源补充 Claude 的知识。 - [向量数据库(Pinecone)](https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/Pinecone/rag_using_pinecone.ipynb) - [维基百科](https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/Wikipedia/wikipedia-search-cookbook.ipynb/) - [网页](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/read_web_pages_with_haiku.ipynb) - [与 Voyage AI 的嵌入](https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/VoyageAI/how_to_create_embeddings.md) ### 多模态功能 - [Claude 的视觉](https://github.com/anthropics/anthropic-cookbook/tree/main/multimodal): - [图像入门](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/getting_started_with_vision.ipynb) - [视觉最佳实践](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/best_practices_for_vision.ipynb) - [解释图表和图形](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/reading_charts_graphs_powerpoints.ipynb) - [从表格中提取内容](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/how_to_transcribe_text.ipynb) - [使用 Claude 生成图像](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/illustrated_responses.ipynb):使用 Claude 和 Stable Diffusion 进行图像生成。 ### 高级技术 - [子代理](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/using_sub_agents.ipynb):了解如何将 Haiku 作为子代理与 Opus 结合使用。 - [将 PDF 上传到 Claude](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/pdf_upload_summarization.ipynb):解析并将 PDF 作为文本传递给 Claude。 - [自动评估](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/building_evals.ipynb):使用 Claude 自动化提示评估过程。 - [启用 JSON 模式](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/how_to_enable_json_mode.ipynb):确保 Claude 输出一致的 JSON。 - [创建审查过滤器](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/building_moderation_filter.ipynb):使用 Claude 为您的应用程序创建内容审查过滤器。 - [提示缓存](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/prompt_caching.ipynb):学习使用 Claude 进行高效提示缓存的技术。 ## 其他资源 - [Anthropic 在 AWS 上](https://github.com/aws-samples/anthropic-on-aws):探索在 AWS 基础设施上使用 Claude 的示例和解决方案。 - [AWS 样例](https://github.com/aws-samples/):AWS 的代码样本集合,可适应用于 Claude。请注意,某些样本可能需要修改才能与 Claude 优化配合使用。
标签:AI助手, Anthropic, API 开发, API 教程, CIS基准, Claude API, Python 编程, 人工智能, 代码片段, 代码示例, 代码贡献, 开发指南, 开发社区, 开发者资源, 技术文档, 数据分析, 数据检索, 文本分类, 生成式AI, 用户模式Hook绕过, 索引, 贡献者指南, 逆向工具, 集成