mirror of
https://github.com/langchain-ai/rag-research-agent-template-js.git
synced 2026-07-01 20:04:02 -04:00
cr
This commit is contained in:
@@ -4,7 +4,7 @@ import { RunnableConfig } from "@langchain/core/runnables";
|
||||
import { ensureBaseConfiguration } from "../shared/configuration.js";
|
||||
|
||||
// This file contains sample documents to index, based on the following LangChain and LangGraph documentation pages:
|
||||
// - https://python.langchain.com/v0.3/docs/concepts/
|
||||
// - https://python.langchain.com/docs/concepts/
|
||||
// - https://langchain-ai.github.io/langgraph/concepts/low_level/
|
||||
const DEFAULT_DOCS_FILE = "src/sample_docs.json";
|
||||
|
||||
@@ -27,7 +27,7 @@ export const IndexConfigurationAnnotation = Annotation.Root({
|
||||
* @returns An instance of typeof IndexConfigurationAnnotation.State with the specified configuration.
|
||||
*/
|
||||
export function ensureIndexConfiguration(
|
||||
config: RunnableConfig | undefined = undefined,
|
||||
config: RunnableConfig,
|
||||
): typeof IndexConfigurationAnnotation.State {
|
||||
const configurable = (config?.configurable || {}) as Partial<
|
||||
typeof IndexConfigurationAnnotation.State
|
||||
|
||||
@@ -47,6 +47,4 @@ const builder = new StateGraph(
|
||||
.addEdge("indexDocs", END);
|
||||
|
||||
// Compile into a graph object that you can invoke and deploy.
|
||||
export const graph = builder.compile();
|
||||
|
||||
graph.name = "IndexGraph";
|
||||
export const graph = builder.compile().withConfig({ runName: "IndexGraph" });
|
||||
|
||||
@@ -72,7 +72,7 @@ export const AgentConfigurationAnnotation = Annotation.Root({
|
||||
* @returns An instance of typeof ConfigurationAnnotation.State with the specified configuration.
|
||||
*/
|
||||
export function ensureAgentConfiguration(
|
||||
config: RunnableConfig | undefined = undefined,
|
||||
config: RunnableConfig,
|
||||
): typeof AgentConfigurationAnnotation.State {
|
||||
const configurable = (config?.configurable || {}) as Partial<
|
||||
typeof AgentConfigurationAnnotation.State
|
||||
|
||||
@@ -172,5 +172,6 @@ const builder = new StateGraph(
|
||||
.addEdge("respond", END);
|
||||
|
||||
// Compile into a graph object that you can invoke and deploy.
|
||||
export const graph = builder.compile();
|
||||
graph.name = "RetrievalGraph";
|
||||
export const graph = builder
|
||||
.compile()
|
||||
.withConfig({ runName: "RetrievalGraph" });
|
||||
|
||||
@@ -63,5 +63,6 @@ const builder = new StateGraph({
|
||||
.addEdge("retrieveDocuments", END);
|
||||
|
||||
// Compile into a graph object that you can invoke and deploy.
|
||||
export const graph = builder.compile();
|
||||
graph.name = "ResearcherGraph";
|
||||
export const graph = builder
|
||||
.compile()
|
||||
.withConfig({ runName: "ResearcherGraph" });
|
||||
|
||||
@@ -40,7 +40,7 @@ export const BaseConfigurationAnnotation = Annotation.Root({
|
||||
* @returns An instance of typeof BaseConfigurationAnnotation.State with the specified configuration.
|
||||
*/
|
||||
export function ensureBaseConfiguration(
|
||||
config: RunnableConfig | undefined = undefined,
|
||||
config: RunnableConfig,
|
||||
): typeof BaseConfigurationAnnotation.State {
|
||||
const configurable = (config?.configurable || {}) as Partial<
|
||||
typeof BaseConfigurationAnnotation.State
|
||||
|
||||
Reference in New Issue
Block a user