Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
eyurtsev committed Sep 2, 2024
1 parent bf3fbfd commit 4b5a78a
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions langserve/api_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,9 @@ def _rename_pydantic_model(model: Type[BaseModel], prefix: str) -> Type[BaseMode
__config__=model.__config__,
**{
fieldname: (
(
_rename_pydantic_model(field.annotation, prefix)
if isclass(field.annotation)
and issubclass(field.annotation, BaseModel)
else field.annotation
),
_rename_pydantic_model(field.annotation, prefix)
if isclass(field.annotation) and issubclass(field.annotation, BaseModel)
else field.annotation,
Field(
field.default,
title=fieldname,
Expand Down Expand Up @@ -852,17 +849,15 @@ async def invoke(
callback_events=callback_events,
metadata=InvokeResponseMetadata(
run_id=run_id,
feedback_tokens=(
[
FeedbackToken(
key=feedback_key,
token_url=feedback_token.url,
expires_at=feedback_token.expires_at.isoformat(),
)
]
if feedback_token
else []
),
feedback_tokens=[
FeedbackToken(
key=feedback_key,
token_url=feedback_token.url,
expires_at=feedback_token.expires_at.isoformat(),
)
]
if feedback_token
else [],
),
),
)
Expand Down

0 comments on commit 4b5a78a

Please sign in to comment.