| 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 |
address* | Optional[str] | |
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.
(beta) An address string, e.g.
from langsmith.address.agent, to send the run to instead of a project.
Cannot be combined with project_name / session_id in the
same call. Defaults to the LANGSMITH_AGENT_* env vars.
This is in beta and enabled per workspace; a
workspace without it rejects the run, so the trace is lost
rather than falling back to a project.
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.