deepanything 0.1.6__py3-none-any.whl → 0.1.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- deepanything/DeepAnythingClient.py +253 -32
- deepanything/ReasonClient.py +102 -0
- deepanything/ResponseClient.py +58 -2
- deepanything/Server/Server.py +74 -32
- deepanything/Server/Types.py +3 -2
- deepanything/Stream.py +39 -1
- deepanything/Utility.py +14 -1
- deepanything/__main__.py +1 -1
- deepanything/metadatas.py +4 -1
- {deepanything-0.1.6.dist-info → deepanything-0.1.8.dist-info}/METADATA +28 -7
- deepanything-0.1.8.dist-info/RECORD +17 -0
- deepanything-0.1.6.dist-info/RECORD +0 -17
- {deepanything-0.1.6.dist-info → deepanything-0.1.8.dist-info}/LICENSE +0 -0
- {deepanything-0.1.6.dist-info → deepanything-0.1.8.dist-info}/WHEEL +0 -0
- {deepanything-0.1.6.dist-info → deepanything-0.1.8.dist-info}/entry_points.txt +0 -0
- {deepanything-0.1.6.dist-info → deepanything-0.1.8.dist-info}/top_level.txt +0 -0
deepanything/Utility.py
CHANGED
@@ -6,6 +6,7 @@ import uuid
|
|
6
6
|
from openai.types.chat import chat_completion_chunk,chat_completion,chat_completion_message
|
7
7
|
from openai.types import completion_usage,completion_choice
|
8
8
|
|
9
|
+
|
9
10
|
def make_usage(
|
10
11
|
completion_tokens,
|
11
12
|
prompt_tokens,
|
@@ -207,4 +208,16 @@ def merge_usage(
|
|
207
208
|
)
|
208
209
|
|
209
210
|
def make_id_by_timestamp():
|
210
|
-
return "chatcmpl-" + str(uuid.uuid4())
|
211
|
+
return "chatcmpl-" + str(uuid.uuid4())
|
212
|
+
|
213
|
+
def extend_message(
|
214
|
+
messages : List,
|
215
|
+
role : Literal["developer", "system", "user", "assistant", "tool"],
|
216
|
+
content : Optional[str] = None,
|
217
|
+
reason_content : Optional[str] = None,
|
218
|
+
) -> List:
|
219
|
+
return messages + [make_chat_completion_message(
|
220
|
+
role=role,
|
221
|
+
content=content,
|
222
|
+
reasoning_content=reason_content
|
223
|
+
)]
|
deepanything/__main__.py
CHANGED
@@ -12,7 +12,7 @@ def main():
|
|
12
12
|
args = parser.parse_args()
|
13
13
|
|
14
14
|
if args.config is not None:
|
15
|
-
with open(args.config) as f:
|
15
|
+
with open(args.config, encoding='utf-8') as f:
|
16
16
|
config = json.load(f)
|
17
17
|
server = DeepAnythingServer(host=args.host, port=args.port, config=config)
|
18
18
|
server.run()
|
deepanything/metadatas.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: deepanything
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.8
|
4
4
|
Summary: DeepAnything is a project that provides DeepSeek R1's deep thinking capabilities for various large language models (LLMs).
|
5
5
|
Author: Junity
|
6
6
|
Author-email: 1727636624@qq.com
|
@@ -169,6 +169,12 @@ Below is an example of a configuration file:
|
|
169
169
|
"type" : "deepseek",
|
170
170
|
"base_url" : "https://api.siliconflow.cn/v1",
|
171
171
|
"api_key" : "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
172
|
+
},
|
173
|
+
{
|
174
|
+
"name" : "qwen",
|
175
|
+
"type" : "openai",
|
176
|
+
"base_url" : "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
177
|
+
"api_key" : "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
172
178
|
}
|
173
179
|
],
|
174
180
|
"response_clients": [
|
@@ -185,7 +191,17 @@ Below is an example of a configuration file:
|
|
185
191
|
"reason_client" : "siliconflow",
|
186
192
|
"response_client" : "qwen",
|
187
193
|
"reason_model": "Pro/deepseek-ai/DeepSeek-R1",
|
188
|
-
"response_model" : "qwen-max-latest"
|
194
|
+
"response_model" : "qwen-max-latest",
|
195
|
+
"reason_prompt" : "<think>{}</think>"
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"name": "QWQ-Qwen-max",
|
199
|
+
"reason_client" : "qwen",
|
200
|
+
"response_client" : "qwen",
|
201
|
+
"reason_model": "qwq-32b-preview",
|
202
|
+
"response_model" : "qwen-max-latest",
|
203
|
+
"reason_prompt" : "<think>{}</think>",
|
204
|
+
"reason_system_prompt" : "You are a model designed to contemplate questions before providing answers. Your thought process and responses are not directly visible to the user but are instead passed as prompts to the next model. For any question posed by the user, you should carefully consider it and provide as detailed a thought process as possible."
|
189
205
|
}
|
190
206
|
],
|
191
207
|
"api_keys" : [
|
@@ -220,7 +236,8 @@ Below is an example of a configuration file:
|
|
220
236
|
"loggers": {
|
221
237
|
"uvicorn": {"handlers": ["default"], "level": "INFO", "propagate": false},
|
222
238
|
"uvicorn.error": {"level": "INFO"},
|
223
|
-
"uvicorn.access": {"handlers": ["access"], "level": "INFO", "propagate": false}
|
239
|
+
"uvicorn.access": {"handlers": ["access"], "level": "INFO", "propagate": false},
|
240
|
+
"deepanything": {"handlers": ["default"], "level": "INFO", "propagate": false}
|
224
241
|
}
|
225
242
|
}
|
226
243
|
}
|
@@ -228,13 +245,17 @@ Below is an example of a configuration file:
|
|
228
245
|
|
229
246
|
#### **Detailed Explanation**
|
230
247
|
|
231
|
-
- reason_clients: Configuration for thinking
|
232
|
-
- response_clients: Configuration for response
|
233
|
-
-
|
234
|
-
-
|
248
|
+
- reason_clients: Configuration for the thinking model, currently supporting two types: deepseek and openai. When the type is openai, DeepAnything directly uses the model's output as the thinking content; it is recommended to use qwq-32b in this case.
|
249
|
+
- response_clients: Configuration for the response model, currently supporting only one type: openai.
|
250
|
+
- models: Model configuration, including model name, thinking model, response model, parameters for the thinking model, and parameters for the response model.
|
251
|
+
- reason_prompt: Specifies how the thinking content should be embedded into the conversation. DeepAnything will use `reason_prompt` to format the thinking content. The default is `<think>{}</think>`.
|
252
|
+
- reason_system_prompt: Adds extra prompt words for the thinking model. This prompt will be placed at the end of the message as a `system` role and passed to the thinking model. If not specified, it will not take effect.
|
253
|
+
- api_keys: API keys used for user identity verification. When not filled or an empty list, the server does not use API keys for authentication.
|
254
|
+
- log: Log configuration. If this item is not filled, the default uvicorn log configuration will be used. For more details, refer to [uvicorn logging configuration](https://www.uvicorn.org/settings/#logging) and [Python Logging configuration](https://docs.python.org/3/library/logging.config.html).}
|
235
255
|
|
236
256
|
## Deploying with Docker
|
237
257
|
### 1. Pull the Image
|
258
|
+
|
238
259
|
```bash
|
239
260
|
docker pull junity233/deepanything:latest
|
240
261
|
```
|
@@ -0,0 +1,17 @@
|
|
1
|
+
deepanything/DeepAnythingClient.py,sha256=4dJg5CFsQLlhxCWgtj7UYa9VTchogeFm_-B3YExk8Ns,28622
|
2
|
+
deepanything/ReasonClient.py,sha256=P1uuwfgds6qch5gPp2BKD1y1myLPZ8BKCs1PiqsZHmw,12888
|
3
|
+
deepanything/ResponseClient.py,sha256=BT-5qBv1xs3-5SbYfFEjHYzH0E09I4Fl8h4K1IvSJ8U,5089
|
4
|
+
deepanything/Stream.py,sha256=8GSsKeAhSwSt0T6JAO4l3ivTwGuJYMxp7GlqpExp8T8,2440
|
5
|
+
deepanything/Utility.py,sha256=dZeCg_D28rwJILLuCsE-ZtcKUkbW1prXPVlpSkYFCKA,7024
|
6
|
+
deepanything/__init__.py,sha256=_2RolcKcpxmW0dmtiQpXlvgxe5dvqx90Yg_Q_oVLVZQ,175
|
7
|
+
deepanything/__main__.py,sha256=BWGtAVWDgJg50uGTEvZNV4P4PFghYwx5cTpXlEAWRio,1084
|
8
|
+
deepanything/metadatas.py,sha256=hfYSJI8zYLB9fgn5puFIHPQWxuMPY_n-YXoSW7y0XZ0,82
|
9
|
+
deepanything/Server/Server.py,sha256=avsTMQVtX9RErhKm2JqYt_U_auUyhHiE4u-Xu1zPzOI,11460
|
10
|
+
deepanything/Server/Types.py,sha256=yGd1vwYMg2nXXOdFh6esHfrAjCglkg9ivqzBMA4go6Y,646
|
11
|
+
deepanything/Server/__init__.py,sha256=eIpn6NbNvEg4ST8CuuIuzPT3m_fTlmPC3sikPoPFsYo,92
|
12
|
+
deepanything-0.1.8.dist-info/LICENSE,sha256=JWYd2E-mcNcSYjT5nk4ayM5kkkDq6ZlOxVcYsyqCIwU,1059
|
13
|
+
deepanything-0.1.8.dist-info/METADATA,sha256=iLcSCMcTt4SpS5VweRtGlUDrU3Bp9GpCc12j9qWoWbI,9486
|
14
|
+
deepanything-0.1.8.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
15
|
+
deepanything-0.1.8.dist-info/entry_points.txt,sha256=UT4gNGx6dJsKBjZIl3VkMekh385O5WMbMidAAla6UB4,60
|
16
|
+
deepanything-0.1.8.dist-info/top_level.txt,sha256=wGeRb__4jEJTclCUl0cxhgubD_Bq-QT38VIH6C4KpzY,13
|
17
|
+
deepanything-0.1.8.dist-info/RECORD,,
|
@@ -1,17 +0,0 @@
|
|
1
|
-
deepanything/DeepAnythingClient.py,sha256=B6m67keuGqUsTBABjSaMpyQpI2e2USbos5Fsmma73HU,15377
|
2
|
-
deepanything/ReasonClient.py,sha256=4IAotSKIzxR-jXHfU9YJH1KHdWvBfbTKMVlXvEEHq9E,7558
|
3
|
-
deepanything/ResponseClient.py,sha256=NbXjlU_0qTKBNjZy8B9J9emuABQYvx3NZsWuja9OnMI,2989
|
4
|
-
deepanything/Stream.py,sha256=8ESR8ttjyPZ-uXPDENsVWUzaL34_GT2OZBJ0PWu7vsA,1578
|
5
|
-
deepanything/Utility.py,sha256=TFH-4NS-gQpzzEb1Aba7WpDEqBqNRF1STWFzfRqQLcg,6645
|
6
|
-
deepanything/__init__.py,sha256=_2RolcKcpxmW0dmtiQpXlvgxe5dvqx90Yg_Q_oVLVZQ,175
|
7
|
-
deepanything/__main__.py,sha256=N40zRebnTUmVd9a0wcK_I0au7Lvl4axxKX6zJGDdXq0,1066
|
8
|
-
deepanything/metadatas.py,sha256=WspkzXRul9GiZA9N8kBo-wnZEexn6N3Y_ykPEaT8dL8,18
|
9
|
-
deepanything/Server/Server.py,sha256=HIM-MHuRG98jv8MTeGK9So-xd8OiTA9R74uvKbWrXyk,9847
|
10
|
-
deepanything/Server/Types.py,sha256=b7aMaRBgODEKdyYe0FeraUfrygJuye3b5lfQTOWASXA,650
|
11
|
-
deepanything/Server/__init__.py,sha256=eIpn6NbNvEg4ST8CuuIuzPT3m_fTlmPC3sikPoPFsYo,92
|
12
|
-
deepanything-0.1.6.dist-info/LICENSE,sha256=JWYd2E-mcNcSYjT5nk4ayM5kkkDq6ZlOxVcYsyqCIwU,1059
|
13
|
-
deepanything-0.1.6.dist-info/METADATA,sha256=-h3eS_CkiwY27ju-QxH2_40IJMBszckjbjmhBTqW0Ig,7851
|
14
|
-
deepanything-0.1.6.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
15
|
-
deepanything-0.1.6.dist-info/entry_points.txt,sha256=UT4gNGx6dJsKBjZIl3VkMekh385O5WMbMidAAla6UB4,60
|
16
|
-
deepanything-0.1.6.dist-info/top_level.txt,sha256=wGeRb__4jEJTclCUl0cxhgubD_Bq-QT38VIH6C4KpzY,13
|
17
|
-
deepanything-0.1.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|