MCPcopy
hub / github.com/lm-sys/FastChat / create_error_response

Function create_error_response

fastchat/serve/openai_api_server.py:134–137  ·  view source on GitHub ↗
(code: int, message: str)

Source from the content-addressed store, hash-verified

132
133
134def create_error_response(code: int, message: str) -> JSONResponse:
135 return JSONResponse(
136 ErrorResponse(message=message, code=code).dict(), status_code=400
137 )
138
139
140@app.exception_handler(RequestValidationError)

Callers 7

check_modelFunction · 0.85
check_lengthFunction · 0.85
check_requestsFunction · 0.85
create_chat_completionFunction · 0.85
create_completionFunction · 0.85
create_embeddingsFunction · 0.85

Calls 2

ErrorResponseClass · 0.90
dictMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…