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
PythonlangsmithclientClientupdate_feedback
Method●Since v0.14

update_feedback

Copy
update_feedback(
  self,
  feedback_id: ID_TYPE,
  *,
  score: Union[float, int,
View source on GitHub
bool
,
None
]
=
cast
(
Any
,
_UNSET
)
,
value
:
Union
[
float
,
int
,
bool
,
str
,
dict
,
None
]
=
cast
(
Any
,
_UNSET
)
,
correction
:
Union
[
dict
,
None
]
=
cast
(
Any
,
_UNSET
)
,
comment
:
Union
[
str
,
None
]
=
cast
(
Any
,
_UNSET
)
)
->
None

Parameters

NameTypeDescription
feedback_id*Union[UUID, str]

The ID of the feedback to update.

scoreOptional[Union[float, int, bool]]
Default:cast(Any, _UNSET)
valueOptional[Union[float, int, bool, str, dict]]
Default:cast(Any, _UNSET)
correctionOptional[dict]
Default:cast(Any, _UNSET)
commentOptional[str]
Default:cast(Any, _UNSET)

Update a feedback in the LangSmith API.

Only the fields you pass are changed. Pass None to clear a field; omit it to keep its current value.

Example:

.. code-block:: python

from langsmith import Client

client = Client()

Change the score and remove the comment.

client.update_feedback(feedback_id, score=0.5, comment=None)

The score to update the feedback with. Floats are rounded to 4 decimal places, the most the API stores; the API rejects more precise scores sent to it directly.

The value to update the feedback with.

The correction to update the feedback with.

The comment to update the feedback with.