diff --git a/src/oss/langgraph/agentic-rag.mdx b/src/oss/langgraph/agentic-rag.mdx index 4fae096b5f..f760ba75b9 100644 --- a/src/oss/langgraph/agentic-rag.mdx +++ b/src/oss/langgraph/agentic-rag.mdx @@ -457,7 +457,7 @@ Note that the components will operate on the [`MessagesState`](/oss/langgraph/gr temperature: 0, }).withStructuredOutput(gradeDocumentsSchema); - const score = await chain.invoke({ + const score = await prompt.pipe(model).invoke({ question: messages.at(0)?.content, context: messages.at(-1)?.content, }); @@ -470,13 +470,15 @@ Note that the components will operate on the [`MessagesState`](/oss/langgraph/gr ``` 2. Run this with irrelevant documents in the tool response: ```typescript + import { ToolMessage } from "@langchain/core/messages"; + const input = { messages: [ new HumanMessage("What does Lilian Weng say about types of reward hacking?"), new AIMessage({ tool_calls: [ { - type: "tool_call" + type: "tool_call", name: "retrieve_blog_posts", args: { query: "types of reward hacking" }, id: "1", @@ -499,7 +501,7 @@ Note that the components will operate on the [`MessagesState`](/oss/langgraph/gr new AIMessage({ tool_calls: [ { - type: "tool_call" + type: "tool_call", name: "retrieve_blog_posts", args: { query: "types of reward hacking" }, id: "1",