Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,554 changes: 5,277 additions & 5,277 deletions content/.metadata.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions content/github/claude-cookbooks/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ style: lint/format
- Opus: `claude-opus-4-8`
- **Never use dated model IDs** (e.g., `claude-sonnet-4-6-20250514`). Always use the non-dated alias.
- **Bedrock model IDs** follow a different format. Use the base Bedrock model ID from the docs:
- Opus 4.6: `anthropic.claude-opus-4-6-v1`
- Sonnet 4.5: `anthropic.claude-sonnet-4-5-20250929-v1:0`
- Opus 4.8: `anthropic.claude-opus-4-8`
- Sonnet 5: `anthropic.claude-sonnet-5`
- Haiku 4.5: `anthropic.claude-haiku-4-5-20251001-v1:0`
- Prepend `global.` for global endpoints (recommended): `global.anthropic.claude-opus-4-6-v1`
- Note: Bedrock models before Opus 4.6 require dated IDs in their Bedrock model ID.
- Prepend `global.` for global endpoints (recommended): `global.anthropic.claude-opus-4-8`
- Note: older Bedrock models use a dated `-YYYYMMDD-v1:0` suffix (e.g., Haiku 4.5 above); newer ones use the suffix-less `anthropic.claude-<model>` format.

4. **Notebooks:**
- Keep outputs in notebooks (intentional for demonstration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"outputs": [],
"source": [
"%%capture\n",
"!pip install -U anthropic voyageai pandas numpy matplotlib scikit-learn"
"%pip install -U anthropic voyageai pandas numpy matplotlib scikit-learn"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"outputs": [],
"source": [
"%%capture\n",
"!pip install --upgrade anthropic voyageai cohere elasticsearch pandas numpy"
"%pip install --upgrade anthropic voyageai cohere elasticsearch pandas numpy"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@
],
"source": [
"## setup\n",
"!pip install anthropic\n",
"!pip install voyageai\n",
"!pip install pandas\n",
"!pip install numpy\n",
"!pip install matplotlib\n",
"!pip install seaborn\n",
"!pip install -U scikit-learn"
"%pip install anthropic\n",
"%pip install voyageai\n",
"%pip install pandas\n",
"%pip install numpy\n",
"%pip install matplotlib\n",
"%pip install seaborn\n",
"%pip install -U scikit-learn"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"outputs": [],
"source": [
"# install packages\n",
"!pip install anthropic pypdf pandas matplotlib numpy rouge-score nltk seaborn --quiet"
"%pip install anthropic pypdf pandas matplotlib numpy rouge-score nltk seaborn --quiet"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install boto3"
"%pip install boto3"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion content/github/claude-cookbooks/misc/building_evals.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"from anthropic import Anthropic\n",
"\n",
"client = Anthropic()\n",
"MODEL_NAME = \"claude-opus-4-1\""
"MODEL_NAME = \"claude-opus-4-8\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"outputs": [],
"source": [
"client = Anthropic()\n",
"MODEL_NAME = \"claude-opus-4-1\""
"MODEL_NAME = \"claude-opus-4-8\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"\n",
"# Set up the Claude API client\n",
"client = Anthropic()\n",
"MODEL_NAME = \"claude-opus-4-1\""
"MODEL_NAME = \"claude-opus-4-8\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"outputs": [],
"source": [
"%%capture\n",
"!pip install anthropic"
"%pip install anthropic"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"from IPython.display import Image\n",
"\n",
"client = Anthropic()\n",
"MODEL_NAME = \"claude-opus-4-1\"\n",
"MODEL_NAME = \"claude-opus-4-8\"\n",
"\n",
"\n",
"def get_base64_encoded_image(image_path):\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"from anthropic import Anthropic\n",
"\n",
"client = Anthropic()\n",
"MODEL_NAME = \"claude-opus-4-1\"\n",
"MODEL_NAME = \"claude-opus-4-8\"\n",
"\n",
"with open(\"../images/sunset.jpeg\", \"rb\") as image_file:\n",
" binary_data = image_file.read()\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"from anthropic import Anthropic\n",
"\n",
"client = Anthropic()\n",
"MODEL_NAME = \"claude-opus-4-1\"\n",
"MODEL_NAME = \"claude-opus-4-8\"\n",
"\n",
"\n",
"def get_base64_encoded_image(image_path):\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
" }\n",
" ]\n",
"\n",
" response = client.messages.create(model=\"claude-opus-4-1\", max_tokens=2048, messages=messages)\n",
" response = client.messages.create(model=\"claude-opus-4-8\", max_tokens=2048, messages=messages)\n",
"\n",
" return response.content[0].text\n",
"\n",
Expand Down Expand Up @@ -334,7 +334,7 @@
"]\n",
"\n",
"# Generate the matplotlib code using the powerful model\n",
"response = client.messages.create(model=\"claude-opus-4-1\", max_tokens=4096, messages=messages)\n",
"response = client.messages.create(model=\"claude-opus-4-8\", max_tokens=4096, messages=messages)\n",
"\n",
"generated_response = response.content[0].text\n",
"print(\"Generated Response:\")\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"metadata": {},
"outputs": [],
"source": [
"! pip install requests ffmpeg-python\n",
"! pip install deepgram-sdk --upgrade\n",
"! pip install requests\n",
"! pip install anthropic"
"%pip install requests ffmpeg-python\n",
"%pip install deepgram-sdk --upgrade\n",
"%pip install requests\n",
"%pip install anthropic"
]
},
{
Expand Down Expand Up @@ -192,7 +192,7 @@
"\n",
"# Generate thoughtful, open-ended interview questions\n",
"response = client.messages.create(\n",
" model=\"claude-opus-4-1\",\n",
" model=\"claude-opus-4-8\",\n",
" max_tokens=1000,\n",
" temperature=0.5,\n",
" system=\"Your task is to generate a series of thoughtful, open-ended questions for an interview based on the given context. The questions should be designed to elicit insightful and detailed responses from the interviewee, allowing them to showcase their knowledge, experience, and critical thinking skills. Avoid yes/no questions or those with obvious answers. Instead, focus on questions that encourage reflection, self-assessment, and the sharing of specific examples or anecdotes.\",\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-llms-anthropic\n",
"!pip install llama-index-embeddings-huggingface"
"%pip install llama-index\n",
"%pip install llama-index-llms-anthropic\n",
"%pip install llama-index-embeddings-huggingface"
]
},
{
Expand Down Expand Up @@ -178,7 +178,7 @@
}
],
"source": [
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-1\")\n",
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-8\")\n",
"embed_model = HuggingFaceEmbedding(model_name=\"BAAI/bge-base-en-v1.5\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-llms-anthropic\n",
"!pip install llama-index-embeddings-huggingface"
"%pip install llama-index\n",
"%pip install llama-index-llms-anthropic\n",
"%pip install llama-index-embeddings-huggingface"
]
},
{
Expand Down Expand Up @@ -204,7 +204,7 @@
},
"outputs": [],
"source": [
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-1\")\n",
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-8\")\n",
"embed_model = HuggingFaceEmbedding(model_name=\"BAAI/bge-base-en-v1.5\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-multi-modal-llms-anthropic\n",
"!pip install llama-index-embeddings-huggingface\n",
"!pip install llama-index-vector-stores-qdrant\n",
"!pip install matplotlib"
"%pip install llama-index\n",
"%pip install llama-index-multi-modal-llms-anthropic\n",
"%pip install llama-index-embeddings-huggingface\n",
"%pip install llama-index-vector-stores-qdrant\n",
"%pip install matplotlib"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-llms-anthropic\n",
"!pip install llama-index-embeddings-huggingface"
"%pip install llama-index\n",
"%pip install llama-index-llms-anthropic\n",
"%pip install llama-index-embeddings-huggingface"
]
},
{
Expand Down Expand Up @@ -172,7 +172,7 @@
},
"outputs": [],
"source": [
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-1\")\n",
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-8\")\n",
"embed_model = HuggingFaceEmbedding(model_name=\"BAAI/bge-base-en-v1.5\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-llms-anthropic\n",
"!pip install llama-index-embeddings-huggingface"
"%pip install llama-index\n",
"%pip install llama-index-llms-anthropic\n",
"%pip install llama-index-embeddings-huggingface"
]
},
{
Expand Down Expand Up @@ -204,7 +204,7 @@
},
"outputs": [],
"source": [
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-1\")\n",
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-8\")\n",
"embed_model = HuggingFaceEmbedding(model_name=\"BAAI/bge-base-en-v1.5\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
},
"outputs": [],
"source": [
"!pip install llama-index\n",
"!pip install llama-index-llms-anthropic\n",
"!pip install llama-index-embeddings-huggingface"
"%pip install llama-index\n",
"%pip install llama-index-llms-anthropic\n",
"%pip install llama-index-embeddings-huggingface"
]
},
{
Expand Down Expand Up @@ -161,7 +161,7 @@
},
"outputs": [],
"source": [
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-1\")\n",
"llm = Anthropic(temperature=0.0, model=\"claude-opus-4-8\")\n",
"embed_model = HuggingFaceEmbedding(model_name=\"BAAI/bge-base-en-v1.5\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"outputs": [],
"source": [
"!pip install pymongo datasets pandas anthropic voyageai"
"%pip install pymongo datasets pandas anthropic voyageai"
]
},
{
Expand Down Expand Up @@ -423,7 +423,7 @@
"\n",
"- Accept a user query in the form of a string.\n",
"- Utilize the VoyageAI embedding model to generate embeddings for the user query.\n",
"- Load the Anthropic Claude 3, specifically the claude-opus-4-1’ model, to serve as the base model for the RAG system.\n",
"- Load Anthropic's Claude, specifically the `claude-opus-4-8` model, to serve as the base model for the RAG system.\n",
"- Execute a vector search using the embeddings of the user query to fetch relevant information from the knowledge base, which provides additional context for the base model.\n",
"- Submit both the user query and the gathered additional information to the base model to generate a response.\n",
"\n",
Expand Down Expand Up @@ -460,7 +460,7 @@
"1. Vector Search Execution: The function begins by calling `vector_search` with the user's query and a specified collection as arguments. This performs a search within the collection, leveraging vector embeddings to find relevant information related to the query.\n",
"2. Compile Search Results: `search_result` is initialized as an empty string to aggregate information from the search. The search results are compiled by iterating over the results returned by the `vector_search` function, formates each item's details (title, company name, URL, publication date, article URL, and description) into a human-readable string, appending this information to search_result with a newline character \\n at the end of each entry.\n",
"3. Generate Response Using Anthropic Client: The function then constructs a request to the Claude API (through a client object, presumably an instance of the anthropic. Client class created earlier). It specifies:\n",
"- The model to use (\"claude-opus-4-1\") indicates a specific version of the Claude 3 model.\n",
"- The model to use (`claude-opus-4-8`) indicates the Claude Opus model version.\n",
"- The maximum token limit for the generated response (max_tokens=1024).\n",
"- A system description guides the model to behave as a \"Venture Capital Tech Analyst\" with access to tech company articles and information, using this context to advise.\n",
"- The actual message for the model to process combines the user query with the aggregated search results as context.\n",
Expand Down Expand Up @@ -490,7 +490,7 @@
" )\n",
"\n",
" response = client.messages.create(\n",
" model=\"claude-opus-4-1\",\n",
" model=\"claude-opus-4-8\",\n",
" max_tokens=1024,\n",
" system=\"You are Venture Captital Tech Analyst with access to some tech company articles and information. You use the information you are given to provide advice.\",\n",
" messages=[\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}
],
"source": [
"!pip install -qU \\\n",
"%pip install -qU \\\n",
" langchain==0.1.11 \\\n",
" langchain-core==0.1.30 \\\n",
" langchain-community==0.0.27 \\\n",
Expand Down Expand Up @@ -693,7 +693,7 @@
"# chat completion llm\n",
"llm = ChatAnthropic(\n",
" ANTHROPIC_API_KEY=ANTHROPIC_API_KEY,\n",
" model_name=\"claude-opus-4-1\", # change \"opus\" -> \"sonnet\" for speed\n",
" model_name=\"claude-opus-4-8\", # change \"opus\" -> \"sonnet\" for speed\n",
" temperature=0.0,\n",
")"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"from anthropic import Anthropic\n",
"\n",
"client = Anthropic()\n",
"MODEL_NAME = \"claude-opus-4-1\""
"MODEL_NAME = \"claude-opus-4-8\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"import anthropic\n",
"\n",
"client = anthropic.Client()\n",
"MODEL_NAME = \"claude-opus-4-1\""
"MODEL_NAME = \"claude-opus-4-8\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"from pydantic import BaseModel, EmailStr, Field\n",
"\n",
"client = Anthropic()\n",
"MODEL_NAME = \"claude-opus-4-1\""
"MODEL_NAME = \"claude-opus-4-8\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"from IPython.display import Image\n",
"\n",
"client = Anthropic()\n",
"MODEL_NAME = \"claude-opus-4-1\""
"MODEL_NAME = \"claude-opus-4-8\""
]
},
{
Expand Down
Loading
Loading