Skip to content

Commit 80fd6b4

Browse files
authored
fix error (#1562)
1 parent bf5e953 commit 80fd6b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/oss/langchain/context-engineering.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ Reference these files when answering questions.`;
408408

409409
// Inject file context before recent messages
410410
const messages = [ // [!code highlight]
411-
...request.messages // Rest of conversation
411+
...request.messages, // Rest of conversation
412412
{ role: "user", content: fileContext }
413413
];
414414
request = request.override({ messages }); // [!code highlight]
@@ -1353,6 +1353,7 @@ Dynamic response format selection adapts schemas based on user preferences, conv
13531353
// request.state is a shortcut for request.state.messages
13541354
const messageCount = request.messages.length; // [!code highlight]
13551355

1356+
let responseFormat;
13561357
if (messageCount < 3) {
13571358
// Early conversation - use simple format
13581359
responseFormat = simpleResponse; // [!code highlight]
@@ -1552,6 +1553,7 @@ Dynamic response format selection adapts schemas based on user preferences, conv
15521553
const userRole = request.runtime.context.userRole; // [!code highlight]
15531554
const environment = request.runtime.context.environment; // [!code highlight]
15541555

1556+
let responseFormat;
15551557
if (userRole === "admin" && environment === "production") {
15561558
responseFormat = adminResponse; // [!code highlight]
15571559
} else {

0 commit comments

Comments
 (0)