Skip to content

Commit

Permalink
[Auto Import] Add run names to LangSmith traces (#195576)
Browse files Browse the repository at this point in the history
## Summary

Adds a name wherever a LangSmith graph is compiled.
This allows us to review the traces faster.

(cherry picked from commit e366c0a)
  • Loading branch information
ilyannn committed Oct 9, 2024
1 parent deeb604 commit af758a6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,6 @@ export async function getCategorizationGraph({ client, model }: CategorizationGr
}
);

const compiledCategorizationGraph = workflow.compile();
const compiledCategorizationGraph = workflow.compile().withConfig({ runName: 'Categorization' });
return compiledCategorizationGraph;
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ export async function getEcsSubGraph({ model }: EcsGraphParams) {
})
.addEdge('modelSubOutput', END);

const compiledEcsSubGraph = workflow.compile();

const compiledEcsSubGraph = workflow.compile().withConfig({ runName: 'ECS Mapping (Chunk)' });
return compiledEcsSubGraph;
}

Expand Down Expand Up @@ -120,7 +119,6 @@ export async function getEcsGraph({ model }: EcsGraphParams) {
})
.addEdge('modelOutput', END);

const compiledEcsGraph = workflow.compile();

const compiledEcsGraph = workflow.compile().withConfig({ runName: 'ECS Mapping' });
return compiledEcsGraph;
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ export async function getKVGraph({ model, client }: KVGraphParams) {
})
.addEdge('modelOutput', END);

const compiledKVGraph = workflow.compile();
const compiledKVGraph = workflow.compile().withConfig({ runName: 'Key-Value' });
return compiledKVGraph;
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ export async function getLogFormatDetectionGraph({ model, client }: LogDetection
}
);

const compiledLogFormatDetectionGraph = workflow.compile();
const compiledLogFormatDetectionGraph = workflow.compile().withConfig({ runName: 'Log Format' });
return compiledLogFormatDetectionGraph;
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,6 @@ export async function getRelatedGraph({ client, model }: RelatedGraphParams) {
}
);

const compiledRelatedGraph = workflow.compile();
const compiledRelatedGraph = workflow.compile().withConfig({ runName: 'Related' });
return compiledRelatedGraph;
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ export async function getUnstructuredGraph({ model, client }: UnstructuredGraphP
.addEdge('handleUnstructuredError', 'handleUnstructuredValidate')
.addEdge('modelOutput', END);

const compiledUnstructuredGraph = workflow.compile();
const compiledUnstructuredGraph = workflow.compile().withConfig({ runName: 'Unstructured' });
return compiledUnstructuredGraph;
}

0 comments on commit af758a6

Please sign in to comment.