docs: migrate cookbook notebooks to current phoenix-evals API - #76
docs: migrate cookbook notebooks to current phoenix-evals API#76jimbobbennett wants to merge 5 commits into
Conversation
Migrate the eval engine in four cookbook notebooks off the deprecated phoenix-evals interface (OpenAIModel / llm_classify / prebuilt rails templates) onto the current LLM + create_classifier / evaluate_dataframe / metrics API. text2sql additionally moves its experiment flow to the v8 arize SDK (client.datasets.create / client.experiments.run), matching the paired AX docs page. - agents-cookbook.ipynb: LLM.generate_text + create_classifier/evaluate_dataframe - openai-agents-cookbook.ipynb: async create_classifier evaluator; drop nest_asyncio - couchbase_langgraph_agentic_rag.ipynb: prebuilt DocumentRelevance/Correctness evaluators - text2sql-experiment.ipynb: v8 datasets/experiments + async is_sql classifier Keeps notebooks in sync with the migrated AX cookbook docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
🤖 Model version check
|
| Location | Found | Suggested | Why |
|---|---|---|---|
python/llm/agents/agents-cookbook.ipynb:333 |
gpt-4o-mini |
gpt-5.4-mini |
mini tier → latest mini |
python/llm/experiments/text2sql-experiment.ipynb:180 |
gpt-4o |
gpt-5.5 |
full tier → latest full |
⚠ 5 item(s) to review (not blocking)
Prose mentions, specialised variants (*-codex, *-chat-latest), or GPT-5/o-series code changes (max_tokens → max_completion_tokens, drop temperature).
| Location | Found | Suggested | Why |
|---|---|---|---|
python/llm/agents/couchbase_langgraph_agentic_rag.ipynb:375 |
temperature |
— | GPT-5/o-series: remove temperature (unsupported on reasoning models) |
python/llm/agents/couchbase_langgraph_agentic_rag.ipynb:423 |
temperature |
— | GPT-5/o-series: remove temperature (unsupported on reasoning models) |
python/llm/agents/couchbase_langgraph_agentic_rag.ipynb:446 |
temperature |
— | GPT-5/o-series: remove temperature (unsupported on reasoning models) |
python/llm/agents/couchbase_langgraph_agentic_rag.ipynb:470 |
temperature |
— | GPT-5/o-series: remove temperature (unsupported on reasoning models) |
python/llm/agents/couchbase_langgraph_agentic_rag.ipynb:658 |
max_tokens |
— | GPT-5/o-series: rename max_tokens → max_completion_tokens |
See the check-models skill. Policy date: 2026-06-18. Add check-models:ignore to a line to skip it.
ℹ️ Platform-wrapped IDs (Bedrock
[region.]anthropic.claude-…, Databricksdatabricks-claude-…, OpenRouter/LiteLLMprovider/model) are flagged on their embedded model name — bump the version but keep the platform's ID format (e.g. Bedrock 4.x needs aus./eu./apac.inference-profile prefix). See the skill's Platform-specific IDs section.
The migrated LLM.generate_text generation model introduced gpt-4o on a changed line, which the check-models gate flags. Use the current-tier gpt-5.4-mini to match the eval docs' app-model convention. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Migrate v7 experiments/datasets API → v8 (datasets.create, experiments.run, experiments.create precomputed via list_examples for server example IDs) in agents-cookbook, openai-agents-cookbook, couchbase; text2sql already v8. - Remove max_tokens from gpt-5.4-mini generate_text calls (GPT-5 rejects max_tokens). - Fix client name collision: Arize client renamed to `arize_client` (text2sql, agents-cookbook) so it no longer clobbers the OpenAI `client`. - text2sql no_error/has_results now return EvaluationResult (bare floats leave reserved eval columns null → Flight rejects). - text2sql verified live end-to-end (both experiments, n_errors=0). couchbase v8 path faithful but not live-verified (needs a Couchbase cluster). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Found by actually executing the notebooks against a live AX space: - openai-agents-cookbook: restore nest_asyncio (import + apply + pip). The async experiment task fails with "asyncio.run() cannot be called from a running event loop" in a notebook without it; dropping it during migration was wrong. - agents-cookbook: attach server example IDs by a unique row_key instead of joining on the question text. Questions repeat, so the content join exploded rows and left eval columns null -> experiments.create 400. Also assign eval labels before the join. Both now run clean (n_errors=0; experiments.create/experiments.run succeed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Pairs with docs PR Arize-ai/docs#767 (deprecated-API / v7→v8 upgrade). |
|
couchbase update: verified the Couchbase integration + migrated arize logging against a local Couchbase (podman |
Migrate off Couchbase Agent Catalog so the notebook is self-contained and runs on current langchain, and fix two pre-existing bugs found by running it against a local Couchbase (podman couchbase/server:enterprise-7.6.2): - Drop agentc: inline the retriever tool (create_retriever_tool over the vector store) and the relevance-grading + RAG prompts (previously fetched from Agent Catalog, whose source files aren't in the repo). - Modernize to current langchain: langchain_core.pydantic_v1 -> pydantic, CouchbaseVectorStore -> CouchbaseSearchVectorStore, create_retriever_tool from langchain_core.tools.retriever, inline rlm/rag-prompt. - Update models to gpt-4.1 (tool-calling + structured output). - Fix reset_vector_store: the document-load block was indented under `if results:`, so a fresh store never ingested (empty retrieval -> grader always "not relevant" -> graph never reaches generate). Dedented + added a short FTS catch-up wait. - Import ChatOpenAI before the graph's first run. Verified end-to-end: docs ingested, similarity search returns hits, agent graph runs (relevant/rewrite decisions), and 4 k/chunk experiments log to Arize (0 errors). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
couchbase update (resolved): the couchbase cookbook + notebook now run end-to-end against a local Couchbase (podman |
What
Migrates the eval engine in four cookbook notebooks off the deprecated
phoenix-evalsinterface onto the current API, keeping them in sync with the paired Arize AX docs cookbooks (migrated in a corresponding docs PR).python/llm/agents/agents-cookbook.ipynbOpenAIModel/llm_classify→LLM.generate_text+create_classifier/evaluate_dataframe; dropnest_asynciopython/llm/agents/openai-agents-cookbook.ipynbcreate_classifier+async_evaluate; dropnest_asynciopython/llm/agents/couchbase_langgraph_agentic_rag.ipynbDocumentRelevanceEvaluator/CorrectnessEvaluatorfromphoenix.evals.metrics; also fixes a pre-existing undefined-variable bug inrun_evaluatorspython/llm/experiments/text2sql-experiment.ipynbcreate_classifier; experiment flow → v8client.datasets.create/client.experiments.run(the v7arize.experimentalAPI is dropped inarize>=8)python/cookbooks/phoenix_evals_examples/ragas_retrieval_evals_tutorial.ipynbwas checked and left unchanged — it is already on the current API.Why
phoenix-evals3.x removedOpenAIModel/GeminiModel/llm_classify/llm_generate(the classic interface moved tophoenix.evals.legacy). These notebooks are linked directly from AX docs cookbooks; this keeps notebook and doc consistent.Testing
The eval/generation API transforms are verified against installed
arize8.35.0 /arize-phoenix-evals3.1.0, and the text2sql v8 experiment flow mirrors a doc snippet that was run end-to-end against a live AX space. The heavy framework paths (couchbase cluster, openai-agents, langgraph, DuckDB dataset) were not executed end-to-end; all four notebooks passnbformatvalidation with zero residual deprecated tokens.🤖 Generated with Claude Code