diff --git a/langserve/api_handler.py b/langserve/api_handler.py index d6b24b58..2f2fafcd 100644 --- a/langserve/api_handler.py +++ b/langserve/api_handler.py @@ -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, ) diff --git a/tests/unit_tests/test_server_client.py b/tests/unit_tests/test_server_client.py index 92c7118e..f798d34f 100644 --- a/tests/unit_tests/test_server_client.py +++ b/tests/unit_tests/test_server_client.py @@ -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 @@ -3077,4 +3078,5 @@ async def test_token_feedback_endpoint() -> None: "metadata": {"from_langserve": True}, "score": 3, "value": None, + "correction": None, }