LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
PythonlangsmithresourcesevaluatorsAsyncEvaluatorsResourcecreate_decision_model
Method●Since v0.14

create_decision_model

Copy
create_decision_model(
  self,
  *,
  display_name: str,
  prompt: Iterable
View source on GitHub
[
Iterable
[
object
]
]
,
questions
:
Dict
[
str
,
evaluator_create_decision_model_params
.
Questions
]
,
base_url
:
Optional
[
str
]
|
Omit
=
omit
,
dataset_id
:
Optional
[
str
]
|
Omit
=
omit
,
filter
:
Optional
[
str
]
|
Omit
=
omit
,
max_retries
:
Optional
[
int
]
|
Omit
=
omit
,
model
:
Optional
[
str
]
|
Omit
=
omit
,
model_headers
:
Optional
[
Dict
[
str
,
str
]
]
|
Omit
=
omit
,
playground_settings_id
:
Optional
[
str
]
|
Omit
=
omit
,
provider
:
Literal
[
'typesafe'
,
'typesafe_compatible'
,
'openai_decisions'
]
|
Omit
=
omit
,
sampling_rate
:
float
|
Omit
=
omit
,
session_id
:
Optional
[
str
]
|
Omit
=
omit
,
template_format
:
Literal
[
'mustache'
,
'f-string'
]
|
Omit
=
omit
,
timeout_seconds
:
Optional
[
int
]
|
Omit
=
omit
,
variable_mapping
:
Optional
[
Dict
[
str
,
str
]
]
|
Omit
=
omit
,
extra_headers
:
Headers
|
None
=
None
,
extra_query
:
Query
|
None
=
None
,
extra_body
:
Body
|
None
=
None
,
timeout
:
float
|
httpx
.
Timeout
|
None
|
NotGiven
=
not_given
)
->
Evaluator

Parameters

NameTypeDescription
prompt*Iterable[Iterable[object]]

The prompt the model reads, as (role, template) pairs.

questions*Dict[str, evaluator_create_decision_model_params.Questions]

The questions, keyed by feedback key, in the order to ask them.

base_urlOptional[str] | Omit
Default:omit
dataset_idOptional[str] | Omit
Default:omit
filterOptional[str] | Omit
Default:omit
max_retriesOptional[int] | Omit
Default:omit
modelOptional[str] | Omit
Default:omit
model_headersOptional[Dict[str, str]] | Omit
Default:omit
playground_settings_idOptional[str] | Omit
Default:omit
providerLiteral['typesafe', 'typesafe_compatible', 'openai_decisions'] | Omit
Default:omit
sampling_ratefloat | Omit
Default:omit
session_idOptional[str] | Omit
Default:omit
timeout_secondsOptional[int] | Omit
Default:omit
variable_mappingOptional[Dict[str, str]] | Omit
Default:omit
extra_headersHeaders | None
Default:None
extra_queryQuery | None
Default:None
extra_bodyBody | None
Default:None
timeoutfloat | httpx.Timeout | None | NotGiven
Default:not_given

Create a decision-model evaluator (Jev, SemIf or OpenAI Decisions) from its prompt and questions, and attach it to a project or dataset. Each question's key becomes a feedback key.

Call this endpoint directly instead of through the LangSmith gateway, with the workspace's TYPESAFE_API_KEY or OPENAI_API_KEY secret. Required for typesafe_compatible.

The dataset whose experiments to evaluate.

Only evaluate runs that match this filter.

How many times to retry a failed model call. openai_decisions only.

Defaults to jev-latest for typesafe and gpt-6-luna for openai_decisions. Use semif-qwen3.5-4b for SemIf.

Headers sent with each model call. They are saved in the evaluator's prompt as given, so do not put API keys here.

A saved model configuration to start from: its model, endpoint, key and settings apply unless set here.

typesafe for Jev and SemIf, typesafe_compatible for a TypeSafe-compatible endpoint, or openai_decisions.

The fraction of runs to evaluate.

The tracing project to evaluate.

Seconds to wait for each model call. openai_decisions only.

Maps the prompt's variables to run fields.

Send extra headers

Add additional query parameters to the request

Add additional JSON properties to the request

Override the client-level default timeout for this request, in seconds