We've been trying to use the Feedback Token feature but are consistently getting token_url equal to None in the metadata returned by the invoke endpoint:
What is surprising is that expires_at is correctly set.
Also calling directly langsmith_client.create_presigned_feedback_token() with a valid run_id does return a proper Token URL.
It creates a FeedbackToken object and sets the url on the url attribute, however when looking at that data structure definition it turns out that the URL is expected to be set on the token_url attribute:
class FeedbackToken(BaseModelV1):
"""Represents the feedback tokens for a given request."""
key: str # The key of the feedback token
token_url: Optional[str] = None
expires_at: Optional[datetime] = None
We've been trying to use the Feedback Token feature but are consistently getting
token_url
equal toNone
in the metadata returned by theinvoke
endpoint:What is surprising is that
expires_at
is correctly set. Also calling directlylangsmith_client.create_presigned_feedback_token()
with a validrun_id
does return a proper Token URL.Upon review of the code, it looks like the problem comes from this line: https://github.com/langchain-ai/langserve/blob/bb74431183277e5a640e4c343f0a134525eb6eef/langserve/api_handler.py#L855
It creates a
FeedbackToken
object and sets the url on theurl
attribute, however when looking at that data structure definition it turns out that the URL is expected to be set on thetoken_url
attribute: