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

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithasync_clientAsyncClientcreate_feedback
Method●Since v0.1

create_feedback

Copy
create_feedback(
  self,
  run_id: Optional[ls_client.ID_TYPE]
View source on GitHub
=
None
,
key
:
str
=
'unnamed'
,
*
,
score
:
Union
[
float
,
int
,
bool
,
None
]
=
None
,
value
:
Union
[
float
,
int
,
bool
,
str
,
dict
,
None
]
=
None
,
trace_id
:
Optional
[
ls_client
.
ID_TYPE
]
=
None
,
correction
:
Union
[
dict
,
None
]
=
None
,
feedback_id
:
Optional
[
ls_client
.
ID_TYPE
]
=
None
,
feedback_config
:
Optional
[
ls_schemas
.
FeedbackConfig
]
=
None
,
feedback_source_type
:
Union
[
ls_schemas
.
FeedbackSourceType
,
str
]
=
ls_schemas
.
FeedbackSourceType
.
API
,
source_info
:
Optional
[
dict
[
str
,
Any
]
]
=
None
,
source_run_id
:
Optional
[
ls_client
.
ID_TYPE
]
=
None
,
stop_after_attempt
:
int
=
10
,
project_id
:
Optional
[
ls_client
.
ID_TYPE
]
=
None
,
comparative_experiment_id
:
Optional
[
ls_client
.
ID_TYPE
]
=
None
,
feedback_group_id
:
Optional
[
ls_client
.
ID_TYPE
]
=
None
,
extra
:
Optional
[
dict
]
=
None
,
error
:
Optional
[
bool
]
=
None
,
session_id
:
Optional
[
ls_client
.
ID_TYPE
]
=
None
,
start_time
:
Optional
[
datetime
.
datetime
]
=
None
,
comment
:
Optional
[
str
]
=
None
,
**
kwargs
:
Any
=
{
}
)
->
ls_schemas
.
Feedback

Parameters

NameTypeDescription
run_idOptional[ls_client.ID_TYPE]
Default:None

The ID of the run to provide feedback for. At least one of run_id, trace_id, or project_id must be specified.

keystr
Default:'unnamed'

The name of the feedback metric.

scoreUnion[float, int, bool, None]
Default:None
valueUnion[float, int, bool, str, dict, None]
Default:None
trace_idOptional[ls_client.ID_TYPE]
Default:None
correctionUnion[dict, None]
Default:None
feedback_idOptional[ls_client.ID_TYPE]
Default:None
feedback_configOptional[ls_schemas.FeedbackConfig]
Default:None
feedback_source_typeUnion[ls_schemas.FeedbackSourceType, str]
Default:ls_schemas.FeedbackSourceType.API
source_infoOptional[dict[str, Any]]
Default:None
source_run_idOptional[ls_client.ID_TYPE]
Default:None
stop_after_attemptint
Default:10
project_idOptional[ls_client.ID_TYPE]
Default:None
comparative_experiment_idOptional[ls_client.ID_TYPE]
Default:None
feedback_group_idOptional[ls_client.ID_TYPE]
Default:None
extraOptional[dict]
Default:None
errorOptional[bool]
Default:None
session_idOptional[ls_client.ID_TYPE]
Default:None
start_timeOptional[datetime.datetime]
Default:None
commentOptional[str]
Default:None
**kwargsAny
Default:{}

Create feedback for a run.

The score to rate this run on the metric or aspect.

The display value or non-numeric value for this feedback.

The ID of the trace that contains the run.

The proper ground truth for this run.

Optional ID to assign to the feedback.

Configuration specifying how to interpret this feedback with this key.

The feedback source type, such as API or model.

Information about the source of this feedback.

The run that generated this feedback, if model-generated.

The number of times to retry the request before giving up.

The project or experiment ID for project-level feedback.

The comparative experiment ID for this feedback.

The group ID for preference or comparative feedback.

Metadata for the feedback.

Whether the feedback represents an error.

The project ID of the run this feedback is for.

The start time of the run this feedback is for.

A comment about this feedback.

Additional deprecated keyword arguments.