You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/core/langchain_core/callbacks
William FH 780337488e
[Enhancement] Add support for directly providing a run_id (#18990)
The root run id (~trace id's) is useful for assigning feedback, but the
current recommended approach is to use callbacks to retrieve it, which
has some drawbacks:
1. Doesn't work for streaming until after the first event
2. Doesn't let you call other endpoints with the same trace ID in
parallel (since you have to wait until the call is completed/started to
use

This PR lets you provide = "run_id" in the runnable config.

Couple considerations:

1. For batch calls, we split the trace up into separate trees (to permit
better rendering). We keep the provided run ID for the first one and
generate a unique one for other elements of the batch.
2. For nested calls, the provided ID is ONLY used on the top root/trace.



### Example Usage


```
chain.invoke("foo", {"run_id": uuid.uuid4()})
```
6 months ago
..
__init__.py docs: modules descriptions (#17844) 7 months ago
base.py core[major]: On Tool End Observation Casting Fix (#18798) 6 months ago
manager.py [Enhancement] Add support for directly providing a run_id (#18990) 6 months ago
stdout.py core[major]: On Tool End Observation Casting Fix (#18798) 6 months ago
streaming_stdout.py core[major]: On Tool End Observation Casting Fix (#18798) 6 months ago