Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply noqa to specific statement rather than entire file #223

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions langserve/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,14 @@ def _scrub_exceptions_in_event(event: CallbackEventDict) -> CallbackEventDict:
def _setup_global_app_handlers(app: Union[FastAPI, APIRouter]) -> None:
@app.on_event("startup")
async def startup_event():
# ruff: noqa: E501
LANGSERVE = """
__ ___ .__ __. _______ _______. _______ .______ ____ ____ _______
| | / \ | \ | | / _____| / || ____|| _ \ \ \ / / | ____|
| | / ^ \ | \| | | | __ | (----`| |__ | |_) | \ \/ / | |__
| | / /_\ \ | . ` | | | |_ | \ \ | __| | / \ / | __|
| `----./ _____ \ | |\ | | |__| | .----) | | |____ | |\ \----. \ / | |____
|_______/__/ \__\ |__| \__| \______| |_______/ |_______|| _| `._____| \__/ |_______|
"""
""" # noqa: E501

def green(text):
return "\x1b[1;32;40m" + text + "\x1b[0m"
Expand All @@ -284,7 +283,8 @@ def green(text):
print(LANGSERVE)
for path in paths:
print(
f'{green("LANGSERVE:")} Playground for chain "{path or ""}/" is live at:'
f'{green("LANGSERVE:")} Playground for chain "{path or ""}/" is '
f'live at:'
)
print(f'{green("LANGSERVE:")} │')
print(f'{green("LANGSERVE:")} └──> {path}/playground/')
Expand Down Expand Up @@ -613,8 +613,8 @@ async def invoke(
return _json_encode_response(
InvokeResponse(
output=well_known_lc_serializer.dumpd(output),
# Callbacks are scrubbed and exceptions are converted to serializable format
# before returned in the response.
# Callbacks are scrubbed and exceptions are converted to
# serializable format before returned in the response.
callback_events=callback_events,
metadata=SingletonResponseMetadata(
run_id=_get_base_run_id_as_str(event_aggregator)
Expand Down