Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Jan 29, 2026

Summary

Modernizes learn/generation/openai/fine-tuning/gpt-3.5-agent-training/00-fine-tuning.ipynb and chains.py to use Pinecone SDK v8 (Linear SDK-174).

Changes

  • Notebook: Replace pinecone-client==2.2.2 with pinecone>=7.0.0; add intro markdown, prerequisites, Colab/nbviewer badges; use getpass fallback for Pinecone API key per review template; clear outputs for valid nbformat.
  • chains.py: Use Pinecone(api_key=...), ServerlessSpec(cloud="aws", region="us-east-1"), create_index with dimension=1536 and spec; align build_index metadata key with query (text).

Audience / use case

Developers fine-tuning GPT-3.5 with a Pinecone-backed retrieval tool.

Prerequisites

OpenAI API key, Pinecone API key; datasets, langchain, pinecone, openai (see notebook).

Related


Note

Medium Risk
Moderate risk because it changes the Pinecone client initialization and index-creation parameters (serverless spec/region and embedding dimension), which could break the example if misconfigured or if users’ environments differ.

Overview
Modernizes the 00-fine-tuning.ipynb example by adding an intro/prereqs section and Colab/nbviewer badges, updating installs to pinecone==8.0.0 (plus requests), and switching Pinecone API key handling to an env-var-or-getpass flow; it also clears cell outputs/exec counts for a cleaner notebook.

Migrates chains.py to Pinecone SDK v8 by replacing legacy pinecone.init/Index usage with Pinecone(api_key=...) + ServerlessSpec index creation (explicit dimension=1536), and aligns stored metadata to use the text key so query() returns the expected field.

Written by Cursor Bugbot for commit 26fbf7a. This will update automatically on new commits. Configure here.

…DK v8

- Replace pinecone-client with pinecone>=7.0.0 in notebook
- Update chains.py: Pinecone(api_key=...), ServerlessSpec, create_index with dimension/spec
- Add intro markdown, prerequisites, Colab/nbviewer badges
- Use getpass fallback for Pinecone API key per review template
- Align metadata key in build_index with query (text)
- Clear notebook outputs for valid nbformat

Linear: SDK-174
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

- Split first notebook cell: download chains.py then imports (fix E402)
- Sort imports in notebook and chains.py (fix I001)
- Use 'is not None' instead of '!= None' (fix E711)
- Move imports into first code cell per notebook guidelines
- Add noqa: E402 for imports after chains.py download (required order)
@jhamon jhamon force-pushed the cursor/sdk-174-00-fine-tuning-sdk-v8 branch from bf186d8 to d5f9614 Compare January 29, 2026 16:26
- chains.py: use environment param for ServerlessSpec region instead of hardcoding
- 00-fine-tuning.ipynb: run pip install before imports so Colab runs correctly
@jhamon
Copy link
Collaborator Author

jhamon commented Jan 29, 2026

Addressed both Bugbot findings:

  1. chains.pyenvironment is now passed to ServerlessSpec(region=environment) so the region is no longer hardcoded.
  2. 00-fine-tuning.ipynb – Pip install runs in the first code cell; download + imports are in the second cell so Colab runs correctly.

Pushed in fa45214.

jhamon and others added 5 commits January 29, 2026 11:36
Merge pip install, chains.py download, and all imports into the first
code cell to satisfy check-structure (imports in first code cell).
Pin requests==2.32.3 for reproducibility.
Addresses Bugbot: pip install must run first so packages are available
before importing on a fresh Colab environment.

Co-authored-by: Cursor <[email protected]>
@jhamon
Copy link
Collaborator Author

jhamon commented Jan 29, 2026

Addressed Bugbot feedback:

  1. Pip install before imports (High): Moved !pip install ... to the top of the first code cell so it runs before any imports. This fixes ModuleNotFoundError on a fresh Colab run.

  2. Unused environment parameter (Medium): This was already fixed in a previous commit — chains.py now passes environment to ServerlessSpec(cloud="aws", region=environment), so the notebook’s PINECONE_ENV (or default us-east-1) is respected.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

],
"execution_count": null,
"outputs": []
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate placeholder cells accidentally committed

Low Severity

The notebook contains two identical code cells that only contain the comment # Setup complete (imports and chains.py in previous cell). These duplicate placeholder cells appear to be leftover from editing and serve no purpose. According to the review rules, notebooks should flow logically with clear structure, and these redundant cells clutter the notebook without adding value.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants