Download lib/python3.11/site-packages/dashscope/protocol/websocket.py from michaelu0826/phantom_env: direct link, hf CLI and curl.
- Browser
- Download file 637 Bytes
-
https://huggingface.co/datasets/michaelu0826/phantom_env/resolve/main/lib/python3.11/site-packages/dashscope/protocol/websocket.py
- Command line
-
hf download hf://datasets/michaelu0826/phantom_env/lib/python3.11/site-packages/dashscope/protocol/websocket.py
-
curl -L -o websocket.py https://huggingface.co/datasets/michaelu0826/phantom_env/resolve/main/lib/python3.11/site-packages/dashscope/protocol/websocket.py
637 Bytes
| # -*- coding: utf-8 -*- | |
| # Copyright (c) Alibaba, Inc. and its affiliates. | |
| class WebsocketStreamingMode: | |
| # TODO how to know request is duplex or other. | |
| NONE = "none" # no stream | |
| IN = "in" # stream in | |
| OUT = "out" | |
| DUPLEX = "duplex" | |
| ACTION_KEY = "action" | |
| EVENT_KEY = "event" | |
| HEADER = "header" | |
| TASK_ID = "task_id" | |
| ERROR_NAME = "error_code" | |
| ERROR_MESSAGE = "error_message" | |
| class EventType: | |
| STARTED = "task-started" | |
| GENERATED = "result-generated" | |
| FINISHED = "task-finished" | |
| FAILED = "task-failed" | |
| class ActionType: | |
| START = "run-task" | |
| CONTINUE = "continue-task" | |
| FINISHED = "finish-task" | |