Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed May 2, 2024
1 parent 5c41508 commit 0400bb3
Show file tree
Hide file tree
Showing 4 changed files with 346 additions and 614 deletions.
2 changes: 1 addition & 1 deletion python/langsmith/_expect.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def score(
key: The key to use for logging the score. Defaults to "score".
Examples:
>>> expect.score(0.8) # doctest: +ELLIPSIS
>>> expect.score(0.8) # doctest: +ELLIPSIS
<langsmith._expect._Matcher object at ...>
>>> expect.score(0.8, key="similarity").to_be_greater_than(0.7)
Expand Down
10 changes: 10 additions & 0 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3439,6 +3439,8 @@ def create_feedback(
feedback_config: Optional[ls_schemas.FeedbackConfig] = None,
stop_after_attempt: int = 10,
project_id: Optional[ID_TYPE] = None,
comparative_experiment_id: Optional[ID_TYPE] = None,
feedback_group_id: Optional[ID_TYPE] = None,
**kwargs: Any,
) -> ls_schemas.Feedback:
"""Create a feedback in the LangSmith API.
Expand Down Expand Up @@ -3478,6 +3480,12 @@ def create_feedback(
project_id : str or UUID
The ID of the project_id to provide feedback on. One - and only one - of
this and run_id must be provided.
comparative_experiment_id : str or UUID
If this feedback was logged as a part of a comparative experiment, this
associates the feedback with that experiment.
feedback_group_id : str or UUID
When logging preferences, ranking runs, or other comparative feedback,
this is used to group feedback together.
"""
if run_id is None and project_id is None:
raise ValueError("One of run_id and project_id must be provided")
Expand Down Expand Up @@ -3531,6 +3539,8 @@ def create_feedback(
modified_at=datetime.datetime.now(datetime.timezone.utc),
feedback_config=feedback_config,
session_id=project_id,
comparative_experiment_id=comparative_experiment_id,
feedback_group_id=feedback_group_id,
)
self.request_with_retries(
"POST",
Expand Down
Loading

0 comments on commit 0400bb3

Please sign in to comment.