From f5dfdc3dd41d08c974c5e533cc91c952abfd7036 Mon Sep 17 00:00:00 2001 From: Ilya Nikokoshev Date: Thu, 5 Sep 2024 21:37:08 +0300 Subject: [PATCH 1/2] Add run names to LangSmith traces --- .../server/graphs/categorization/graph.ts | 2 +- .../plugins/integration_assistant/server/graphs/ecs/graph.ts | 5 ++--- .../plugins/integration_assistant/server/graphs/kv/graph.ts | 2 +- .../server/graphs/log_type_detection/graph.ts | 2 +- .../integration_assistant/server/graphs/related/graph.ts | 2 +- .../server/graphs/unstructured/graph.ts | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/integration_assistant/server/graphs/categorization/graph.ts b/x-pack/plugins/integration_assistant/server/graphs/categorization/graph.ts index 2517cc1c31886..227bcd6939b94 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/categorization/graph.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/categorization/graph.ts @@ -243,6 +243,6 @@ export async function getCategorizationGraph({ client, model }: CategorizationGr } ); - const compiledCategorizationGraph = workflow.compile(); + const compiledCategorizationGraph = workflow.compile().withConfig({ runName: 'Categorization' }); return compiledCategorizationGraph; } diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts index efe2ac1aeb437..6c0857ad05cb0 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts @@ -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; } @@ -120,7 +119,7 @@ export async function getEcsGraph({ model }: EcsGraphParams) { }) .addEdge('modelOutput', END); - const compiledEcsGraph = workflow.compile(); + const compiledEcsGraph = workflow.compile().withConfig({ runName: 'ECS Mapping' }); return compiledEcsGraph; } diff --git a/x-pack/plugins/integration_assistant/server/graphs/kv/graph.ts b/x-pack/plugins/integration_assistant/server/graphs/kv/graph.ts index 6f7b43ba40f22..f72984655c1f8 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/kv/graph.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/kv/graph.ts @@ -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; } diff --git a/x-pack/plugins/integration_assistant/server/graphs/log_type_detection/graph.ts b/x-pack/plugins/integration_assistant/server/graphs/log_type_detection/graph.ts index b1cdecd39fe69..4a3f2e2536266 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/log_type_detection/graph.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/log_type_detection/graph.ts @@ -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; } diff --git a/x-pack/plugins/integration_assistant/server/graphs/related/graph.ts b/x-pack/plugins/integration_assistant/server/graphs/related/graph.ts index 4ab623788c84e..be4b00852485c 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/related/graph.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/related/graph.ts @@ -207,6 +207,6 @@ export async function getRelatedGraph({ client, model }: RelatedGraphParams) { } ); - const compiledRelatedGraph = workflow.compile(); + const compiledRelatedGraph = workflow.compile().withConfig({ runName: 'Related' }); return compiledRelatedGraph; } diff --git a/x-pack/plugins/integration_assistant/server/graphs/unstructured/graph.ts b/x-pack/plugins/integration_assistant/server/graphs/unstructured/graph.ts index 6048404728bfb..cf3a645effa68 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/unstructured/graph.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/unstructured/graph.ts @@ -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; } From fdac0ded9c3ce5207ccb87143941bc0dd570e883 Mon Sep 17 00:00:00 2001 From: Ilya Nikokoshev Date: Wed, 9 Oct 2024 14:42:36 +0300 Subject: [PATCH 2/2] Consistent spacing --- x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts index 6c0857ad05cb0..89a7e5c600723 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts @@ -120,6 +120,5 @@ export async function getEcsGraph({ model }: EcsGraphParams) { .addEdge('modelOutput', END); const compiledEcsGraph = workflow.compile().withConfig({ runName: 'ECS Mapping' }); - return compiledEcsGraph; }