Trace a function with langsmith.
| Name | Type | Description |
|---|---|---|
run_type* | unknown | The type of run (span) to create. Examples: Defaults to "chain". |
name* | unknown | The name of the run. Defaults to the function name. |
metadata* | unknown | The metadata to add to the run. Defaults to |
tags* | unknown | The tags to add to the run. Defaults to |
client* | unknown | The client to use for logging the run to LangSmith. Defaults to
|
reduce_fn* | unknown | A function to reduce the output of the function if the function returns a generator. Defaults to Note If the iterator is never exhausted (e.g. the function returns an infinite generator), this will never be called, and the run itself will be stuck in a pending state. |
project_name* | unknown | |
process_inputs* | unknown | |
process_outputs* | unknown | |
dangerously_allow_filesystem* | unknown | |
enabled* | unknown | |
exceptions_to_handle* | unknown |
Requires that LANGSMITH_TRACING_V2 be set to 'true' in the environment.
The name of the project to log the run to.
Defaults to None, which will use the default project.
Custom serialization / processing function for inputs.
Defaults to None.
Custom serialization / processing function for outputs.
Defaults to None.
Whether to allow filesystem access for attachments.
Defaults to False.
Traces that reference local filepaths will be uploaded to LangSmith. In general, network-hosted applications should not be using this because referenced files are usually on the user's machine, not the host machine.
Whether tracing is enabled for this function.
Defaults to None, which will use the default value from the current context.
Exception types to ignore when logging errors.
If an exception of one of these types is raised, the run will still be recorded
but the error field will be None instead of containing the full traceback.
Defaults to None.