Skip to content

Commit

Permalink
Support correction when creating feedback with token (#736)
Browse files Browse the repository at this point in the history
Closes #735

---------

Co-authored-by: Eugene Yurtsev <[email protected]>
  • Loading branch information
hinthornw and eyurtsev authored Sep 2, 2024
1 parent a74e072 commit 62e648a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions langserve/api_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,7 @@ async def create_feedback_from_token(
score=create_request.score,
value=create_request.value,
comment=create_request.comment,
correction=create_request.correction,
metadata=metadata,
)

Expand Down
4 changes: 3 additions & 1 deletion tests/unit_tests/test_server_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3066,7 +3066,8 @@ async def test_token_feedback_endpoint() -> None:
local_app, raise_app_exceptions=True
) as async_client:
response = await async_client.post(
"/token_feedback", json={"token_or_url": "some_url", "score": 3}
"/token_feedback",
json={"token_or_url": "some_url", "score": 3},
)
assert response.status_code == 200

Expand All @@ -3077,4 +3078,5 @@ async def test_token_feedback_endpoint() -> None:
"metadata": {"from_langserve": True},
"score": 3,
"value": None,
"correction": None,
}

0 comments on commit 62e648a

Please sign in to comment.