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

create_feedback_config

Copy
create_feedback_config(
  self,
  feedback_key: str,
  *,
  feedback_config: ls_schemas.FeedbackConfig,
  is_lower_score_better: Optional
View source on GitHub
[
bool
]
=
None
,
is_enforced
:
bool
=
False
)
->
ls_schemas
.
FeedbackConfigSchema

Parameters

NameTypeDescription
feedback_key*str

The feedback key to configure.

feedback_config*FeedbackConfig

The configuration defining type, bounds, and categories.

is_lower_score_betterOptional[bool]
Default:None

Whether a lower score is considered better. When omitted, a key that already has configs keeps its direction, and a new key defaults to False.

is_enforcedbool
Default:False

Create a feedback configuration.

Defines how feedback with a given key should be interpreted. If an identical configuration already exists for the key, it is returned unchanged. If a different configuration already exists for the key, the result depends on the workspace: with enforced feedback configs on, the new configuration is added next to the existing ones (unless the key has an enforced configuration); otherwise an HTTP 400 "Feedback config already exists" is raised.

Example:

.. code-block:: python

from langsmith import Client

client = Client() config = client.create_feedback_config( feedback_key="user-rating", feedback_config={ "type": "continuous", "min": 0.0, "max": 5.0, }, )

tags = client.create_feedback_config( feedback_key="topics", feedback_config={ "type": "categorical", "categories": [ {"value": 0, "label": "billing"}, {"value": 1, "label": "shipping"}, ], "allows_multiple_categories": True, }, )

Create the key's enforced configuration, which sets the rules for the whole workspace. Requires the feedback-configs:manage-enforced permission, which workspace admins have. Fails if the key already has an enforced configuration. Defaults to False.