This commit is contained in:
vbarda
2024-12-03 09:06:13 -05:00
parent 2b07d8f7f7
commit 24d210417a
6 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -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
+1 -3
View File
@@ -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" });
+1 -1
View File
@@ -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
+3 -2
View File
@@ -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" });
+1 -1
View File
@@ -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