Skip to content

Commit

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

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Auto Import] Add run names to LangSmith traces
(#195576)](#195576)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ilya
Nikokoshev","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-09T13:49:59Z","message":"[Auto
Import] Add run names to LangSmith traces (#195576)\n\n##
Summary\r\n\r\nAdds a name wherever a LangSmith graph is compiled.
\r\nThis allows us to review the traces
faster.","sha":"e366c0ae7cbe094fc3363b6b0fa152575958346c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major","Team:Security-Scalability","Feature:AutomaticImport"],"title":"[Auto
Import] Add run names to LangSmith
traces","number":195576,"url":"https://github.com/elastic/kibana/pull/195576","mergeCommit":{"message":"[Auto
Import] Add run names to LangSmith traces (#195576)\n\n##
Summary\r\n\r\nAdds a name wherever a LangSmith graph is compiled.
\r\nThis allows us to review the traces
faster.","sha":"e366c0ae7cbe094fc3363b6b0fa152575958346c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195576","number":195576,"mergeCommit":{"message":"[Auto
Import] Add run names to LangSmith traces (#195576)\n\n##
Summary\r\n\r\nAdds a name wherever a LangSmith graph is compiled.
\r\nThis allows us to review the traces
faster.","sha":"e366c0ae7cbe094fc3363b6b0fa152575958346c"}}]}]
BACKPORT-->

Co-authored-by: Ilya Nikokoshev <[email protected]>
  • Loading branch information
kibanamachine and ilyannn authored Oct 9, 2024
1 parent bdcb92a commit 062ea57
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 062ea57

Please sign in to comment.