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
PythonlangsmithclientClientcreate_feedback_formula
Methodā—Since v0.4

create_feedback_formula

Copy
create_feedback_formula(
  self,
  *,
  feedback_key: str,
  aggregation_type: Literal['sum', 'avg'],
  formula_parts
View source on GitHub
:
Sequence
[
Union
[
ls_schemas
.
FeedbackFormulaWeightedVariable
,
dict
]
]
,
dataset_id
:
Optional
[
ID_TYPE
]
=
None
,
session_id
:
Optional
[
ID_TYPE
]
=
None
)
->
ls_schemas
.
FeedbackFormula

Parameters

NameTypeDescription
feedback_key*str

The feedback key for the formula.

aggregation_type*Literal['sum', 'avg']

The aggregation type to use when combining parts.

formula_parts*Sequence[FeedbackFormulaWeightedVariable | dict]
dataset_idOptional[Union[UUID, str]]
Default:None
session_idOptional[Union[UUID, str]]
Default:None

Create a feedback formula.

The weighted feedback keys included in the formula.

The dataset to scope the formula to.

The session to scope the formula to.