| Name | Type | Description |
|---|---|---|
name* | str | The name of the run. |
inputs* | Dict[str, Any] | The input values for the run. |
run_type* | str | The type of the run, such as tool, chain, llm, retriever, embedding, prompt, or parser. |
project_name | Optional[str] | Default: None |
revision_id | Optional[Union[UUID, str]] | Default: None |
api_key | Optional[str] | Default: None |
api_url | Optional[str] | Default: None |
service_key* | Optional[str] | |
tenant_id* | Optional[str] | |
authorization* | Optional[str] | |
cookie* | Optional[str] | |
**kwargs | Any | Default: {} |
Persist a run to the LangSmith API.
Example:
from langsmith import Client
import datetime
from uuid import uuid4
client = Client()
run_id = uuid4()
client.create_run(
id=run_id,
project_name=project_name,
name="test_run",
run_type="llm",
inputs={"prompt": "hello world"},
outputs={"generation": "hi there"},
start_time=datetime.datetime.now(datetime.timezone.utc),
end_time=datetime.datetime.now(datetime.timezone.utc),
hide_inputs=True,
hide_outputs=True,
)The project name of the run.
The revision ID of the run.
The API key to use for this specific run.
The API URL to use for this specific run.
The service JWT key for service-to-service auth.
The tenant ID for multi-tenant requests.
The Authorization header value.
The Cookie header value.
Additional keyword arguments.