fix style check

pull/20638/head
lizb 12 months ago
parent 87210b6b3a
commit 997d86a011

@ -197,10 +197,11 @@ def generate_text_hash(text: str) -> str:
def compact_generate_response(response: Union[Mapping, Generator, RateLimitGenerator]) -> Response: def compact_generate_response(response: Union[Mapping, Generator, RateLimitGenerator]) -> Response:
if isinstance(response, dict): if isinstance(response, dict):
return Response(response=json.dumps(response, return Response(
default=lambda x: str(x) if isinstance(x, Decimal) else x), response=json.dumps(response, default=lambda x: str(x) if isinstance(x, Decimal) else x),
status=200, status=200,
mimetype="application/json") mimetype="application/json",
)
else: else:
def generate() -> Generator: def generate() -> Generator:

Loading…
Cancel
Save