| correct | langchain.agents.create_agent |
Task 2: create_agent from langchain.agents with @tool from langchain.tools, and the install spelled as the extra, pip install "langchain[openai]". |
| correct | create_agent(system_prompt=...) |
Task 3: system_prompt=, with the rename attributed correctly — "In the pre-1.0 LangGraph create_react_agent this parameter was called prompt." |
| correct | langchain.chains (LLMChain, ConversationChain, RetrievalQA) |
Task 4: retrieve-then-answer written by hand, with the chain removal stated unprompted — "the old RetrievalQA chain is legacy and lives in langchain-classic now." |
| correct | langchain.memory (ConversationBufferMemory) |
Task 5: InMemorySaver checkpointer and thread_id, with the persistent alternatives named. |
| correct | create_agent(response_format=...) |
Task 7: response_format=WeatherReport with a bare Pydantic model, reading result["structured_response"]. Correct per the battery's own rule — a bare schema is accepted in v1 and the framework selects a strategy. |
| correct | run-scoped context (context= / context_schema=) |
Task 8: ToolRuntime[Context] with context_schema and context=, plus the correct pre-1.0 comparison (InjectedToolArg / config["configurable"]). |
| correct | create_agent(pre_model_hook=...) / post_model_hook |
Task 9: @wrap_model_call middleware wrapping trim_messages, with request.override(messages=...). |
| correct | agent streaming node name |
Task 10: both spellings of the filter — "model" in chunk for stream_mode="updates" and meta.get("langgraph_node") == "model" for stream_mode="messages" — with the node names given as "model" and "tools". |
| correct | message.text |
Task 11: .text as a property, with the version note — ".text is a property in langchain-core 1.x; on older 0.3.x it was the method resp.text()." |
| imprecision | langchain.hub |
Task 6 wrote the correct langsmith.Client().pull_prompt(...) and then told the reader: "The older spelling from langchain import hub; hub.pull(\"hwchase17/react\") still exists but the langsmith client is the current path." It does not still exist — 1.0.0 moved hub to langchain-classic. (Code-vs-claim rule, applied against the Index's own interest. The generated code is correct and the correct path is named; the false half is an aside about the legacy route. Under a stricter reading this is a flat wrong statement rather than a hedge, and it is the one place in this run where the rule's edge is doing real work — recorded here in full so a reader can disagree with the call.) |
| imprecision | ChatAnthropic(max_tokens=...) |
Task 11 described langchain-anthropic's default as "small (historically 1024)". 1.0.0 replaced the flat 1024 default with a per-model value. (Hedged with "historically", and the code sets max_tokens=8192 explicitly, which is correct regardless of the default.) |
| correct | langchain package namespace |
Belief probe (c): listed the v1 namespace accurately — langchain.agents (with create_agent, AgentState, middleware), langchain.chat_models, langchain.tools, langchain.messages, langchain.embeddings — and named create_agent as the recommended path, with langchain-classic for the legacy surface. |