Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/oss/langgraph/agentic-rag.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand All @@ -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",
Expand All @@ -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",
Expand Down