Skip to content

Commit

Permalink
feat: add event_type query parameter to /stream
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw authored Oct 2, 2024
1 parent 96b149d commit b00c1ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/api/v4/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ def translator_stream(
examples=[Example(summary=code, value=code) for code in get_args(Languages.__value__)], # pylint: disable=no-member
),
],
event_type: Annotated[str | None, Parameter(description='the event that an event listener will listen for')] = None,
) -> ServerSentEvent:
"""
Summary
-------
the `/translator/stream` returns a Server-Sent Event stream of the translation
"""
return ServerSentEvent(state.translator.translate_stream(text, source, target))
return ServerSentEvent(state.translator.translate_stream(text, source, target), event_type=event_type)

0 comments on commit b00c1ef

Please sign in to comment.