OpenSource-Hub

claude-cookbooks

チュートリアル

anthropics/claude-cookbooks

Claude API の使用テクニックを紹介する Jupyter ノートブックのコレクション。

概要

Claude Cookbookは、RAG、ツール使用、マルチモーダルなどの機能や、プロンプトキャッシュなどの高度なテクニックをカバーする、コピー可能なコードスニペットとガイドを提供し、開発者がClaudeを統合するのを支援します。

README プレビュー

# Claude Cookbooks\n\nThe Claude Cookbooks provide code and guides designed to help developers build with Claude, offering copy-able code snippets that you can easily integrate into your own projects.\n\n## Prerequisites\n\nTo make the most of the examples in this cookbook, you'll need a Claude API key (sign up for free [here](https://www.anthropic.com)).\n\nWhile the code examples are primarily written in Python, the concepts can be adapted to any programming language that supports interaction with the Claude API.\n\nIf you're new to working with the Claude API, we recommend starting with our [Claude API Fundamentals course](https://github.com/anthropics/courses/tree/master/anthropic_api_fundamentals) to get a solid foundation.\n\n## Explore Further\n\nLooking for more resources to enhance your experience with Claude and AI assistants? Check out these helpful links:\n\n- [Anthropic developer documentation](https://docs.claude.com/claude/docs/guide-to-anthropics-prompt-engineering-resources)\n- [Anthropic support docs](https://support.anthropic.com)\n- [Anthropic Discord community](https://www.anthropic.com/discord)\n\n## Contributing\n\nThe 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.\n\nTo avoid duplication of efforts, please review the existing issues and pull requests before contributing.\n\nIf you have ideas for new examples or guides, share them on the [issues page](https://github.com/anthropics/anthropic-cookbook/issues).\n\n## Table of recipes\n\n### Capabilities\n- [Classification](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/classification): Explore techniques for text and data classification using Claude.\n- [Retrieval Augmented Generation](https://github.com/anthropics/anthropic-cookbook/tree/main/capabili

FAQ (2)

ハウツー
APIからプリビルドまたはカスタムのClaude Skillsを呼び出すにはどうすればよいですか?

API経由でスキルを呼び出すには、まずカスタムスキルの場合はclient.beta.skills.create(name, instructions, ...)で作成します。canvas-designのようなプリビルトスキルは、Skills UIで名前を確認し、そのまま使用します。次に、メッセージ内でskills配列にスキル名を指定してスキルを呼び出します。例: client.beta.messages.create(model='claude-sonnet-4-20250514', max_tokens=1024, skills=['canvas-design'], messages=[...])。500エラーが発生した場合は、APIキーにSkills betaアクセスがあることを確認し、数分後にリトライしてください。それでも解決しない場合は、リクエストIDを添えてサポートに連絡してください。

参照 Issue #233
トラブル対応
GitHub のノートブックレンダリングエラー "Using nbformat v5.10.4 and nbconvert v7.17.1" を修正するにはどうすればよいですか?

これはGitHub側のノートブックのレンダリングの問題であり、お使いの.ipynbファイルやリポジトリの問題ではありません。GitHubがレンダラーを修正するのを待って、後で再試行してください。回避策として、JupyterLab/VS Codeでノートブックをローカルに開くか、その公開URLを[nbviewer](https://nbviewer.org/)に貼り付けるか、jupyter nbconvert --to html calculator_tool.ipynbでローカルに変換してください。GitHubのレンダリングが利用できない間は、rawファイルのURLやGoogle Colabを使って表示することもできます。

参照 Issue #681