Skip to content

Commit 8b3659a

Browse files
authored
Merge pull request #18 from jwm4/jwm4-nb1b
feat: Update sample notebook
2 parents 2636f4a + 3f50c8f commit 8b3659a

File tree

4 files changed

+682
-215
lines changed

4 files changed

+682
-215
lines changed

notebooks/01-responses/nps_mcp_server.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
from typing import Optional
2424
import httpx
2525
from fastmcp import FastMCP
26+
from fastmcp.server.dependencies import get_http_request
27+
from starlette.requests import Request
2628
import os
2729
import argparse
2830
import json
@@ -110,7 +112,7 @@ async def search_parks(
110112
state_code: Optional[str] = None,
111113
park_code: Optional[str] = None,
112114
query: Optional[str] = None,
113-
limit: int = 10
115+
limit: int = 10,
114116
) -> str:
115117
"""
116118
Search for national parks by state, park code, or query string.
@@ -126,6 +128,11 @@ async def search_parks(
126128
"""
127129
# Log input parameters
128130
get_logger().debug(f"search_parks called with inputs: state_code={state_code}, park_code={park_code}, query={query}, limit={limit}")
131+
132+
request: Request = get_http_request()
133+
headers = dict(request.headers)
134+
if headers:
135+
get_logger().debug(f"tool call headers: {mask_sensitive_headers(headers)}")
129136

130137
try:
131138
api_key = get_api_key()

notebooks/01-responses/requirements.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ attrs==25.3.0
1212
Authlib==1.6.1
1313
autoevals==0.0.129
1414
braintrust_core==0.0.59
15+
cachetools==6.2.0
1516
certifi==2025.7.14
1617
cffi==1.17.1
1718
chardet==5.2.0
@@ -53,6 +54,7 @@ ibm-cos-sdk==2.14.2
5354
ibm-cos-sdk-core==2.14.2
5455
ibm-cos-sdk-s3transfer==2.14.2
5556
ibm_watson_machine_learning==1.0.368
57+
ibm_watsonx_ai==1.3.38
5658
idna==3.10
5759
importlib_metadata==8.7.0
5860
ipykernel==6.30.0
@@ -77,8 +79,8 @@ langchain-text-splitters==0.3.9
7779
langsmith==0.4.13
7880
litellm==1.74.9.post1
7981
llama_api_client==0.1.2
80-
llama_stack==0.2.17
81-
llama_stack_client==0.2.17
82+
llama_stack==0.2.22
83+
llama_stack_client==0.2.22
8284
lomond==0.3.3
8385
markdown-it-py==3.0.0
8486
MarkupSafe==3.0.2
@@ -92,7 +94,7 @@ multiprocess==0.70.16
9294
nest-asyncio==1.6.0
9395
networkx==3.5
9496
numpy==1.26.4
95-
openai==1.97.0
97+
openai==1.108.0
9698
openapi-pydantic==0.5.1
9799
opentelemetry-api==1.36.0
98100
opentelemetry-exporter-otlp==1.36.0
@@ -121,7 +123,7 @@ pyaml==25.7.0
121123
pyarrow==21.0.0
122124
pyasn1==0.6.1
123125
pycparser==2.22
124-
pydantic==2.11.7
126+
pydantic==2.11.9
125127
pydantic-settings==2.10.1
126128
pydantic_core==2.33.2
127129
Pygments==2.19.2

notebooks/01-responses/responses-api.ipynb

Lines changed: 660 additions & 200 deletions
Large diffs are not rendered by default.

notebooks/01-responses/run.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,10 @@ providers:
106106
config:
107107
openai_api_key: ${env.OPENAI_API_KEY:}
108108
post_training:
109-
- provider_id: huggingface
110-
provider_type: inline::huggingface
109+
- provider_id: torchtune-cpu
110+
provider_type: inline::torchtune-cpu
111111
config:
112-
checkpoint_format: huggingface
113-
distributed_backend: null
114-
device: cpu
112+
checkpoint_format: meta
115113
tool_runtime:
116114
- provider_id: brave-search
117115
provider_type: remote::brave-search
@@ -140,11 +138,6 @@ inference_store:
140138
type: sqlite
141139
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/sample-notebook}/inference_store.db
142140
models:
143-
- metadata: {}
144-
model_id: watsonx-Llama-3.3-70B-Instruct
145-
provider_id: watsonx
146-
provider_model_id: meta-llama/llama-3-3-70b-instruct
147-
model_type: llm
148141
- metadata: {}
149142
model_id: Llama-3.3-70B-Instruct
150143
provider_model_id: Llama-3.3-70B-Instruct
@@ -160,6 +153,11 @@ models:
160153
provider_model_id: gpt-4o
161154
provider_id: openai
162155
model_type: llm
156+
- metadata: {}
157+
model_id: watsonx-Llama-3.3-70B-Instruct
158+
provider_id: watsonx
159+
provider_model_id: meta-llama/llama-3-3-70b-instruct
160+
model_type: llm
163161
- metadata:
164162
embedding_dimension: 768
165163
model_id: granite-embedding-125m

0 commit comments

Comments
 (0)