deepanything 0.1.5__tar.gz → 0.1.6__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {deepanything-0.1.5 → deepanything-0.1.6}/PKG-INFO +1 -1
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/Server/Server.py +10 -7
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/__main__.py +3 -1
- deepanything-0.1.6/deepanything/metadatas.py +1 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything.egg-info/PKG-INFO +1 -1
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything.egg-info/SOURCES.txt +1 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/setup.py +2 -1
- {deepanything-0.1.5 → deepanything-0.1.6}/LICENSE +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/README.md +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/DeepAnythingClient.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/ReasonClient.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/ResponseClient.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/Server/Types.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/Server/__init__.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/Stream.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/Utility.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything/__init__.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything.egg-info/dependency_links.txt +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything.egg-info/entry_points.txt +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything.egg-info/requires.txt +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/deepanything.egg-info/top_level.txt +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/requirements.txt +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/setup.cfg +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/test/server.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/test/think.py +0 -0
- {deepanything-0.1.5 → deepanything-0.1.6}/test/think_async.py +0 -0
@@ -1,3 +1,4 @@
|
|
1
|
+
from chunk import Chunk
|
1
2
|
from dataclasses import dataclass
|
2
3
|
import time
|
3
4
|
import uvicorn
|
@@ -6,7 +7,7 @@ import json
|
|
6
7
|
|
7
8
|
from openai.types.model import Model as OpenaiModel
|
8
9
|
from fastapi import FastAPI,Depends, HTTPException, status,Header,Request
|
9
|
-
from fastapi.responses import StreamingResponse
|
10
|
+
from fastapi.responses import StreamingResponse,Response
|
10
11
|
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
11
12
|
from uvicorn.config import LOGGING_CONFIG
|
12
13
|
|
@@ -184,14 +185,13 @@ class DeepAnythingServer:
|
|
184
185
|
|
185
186
|
model = self.models[query.model]
|
186
187
|
|
187
|
-
# 修改点1:将request传递给_sse_warp生成器
|
188
188
|
async def _sse_warp(it: AsyncStream, req: Request):
|
189
189
|
async for chunk in it:
|
190
190
|
if await req.is_disconnected():
|
191
191
|
await it.close()
|
192
192
|
break
|
193
|
-
yield f"data: {chunk.model_dump_json(indent=None)}\n\n"
|
194
|
-
yield "data: [DONE]"
|
193
|
+
yield f"data: {chunk.model_dump_json(indent=None)}\n\n".encode("utf-8")
|
194
|
+
yield "data: [DONE]".encode('utf-8')
|
195
195
|
|
196
196
|
args = DeepAnythingServer._extract_args(query)
|
197
197
|
|
@@ -214,11 +214,11 @@ class DeepAnythingServer:
|
|
214
214
|
reason_args=args,
|
215
215
|
max_tokens=max_tokens
|
216
216
|
),
|
217
|
-
request
|
217
|
+
request
|
218
218
|
)
|
219
219
|
return StreamingResponse(
|
220
220
|
res,
|
221
|
-
media_type="text/event-stream"
|
221
|
+
media_type="text/event-stream",
|
222
222
|
)
|
223
223
|
else:
|
224
224
|
res = await chat_completion_async(
|
@@ -233,7 +233,10 @@ class DeepAnythingServer:
|
|
233
233
|
reason_args=args,
|
234
234
|
max_tokens=max_tokens
|
235
235
|
)
|
236
|
-
return
|
236
|
+
return Response(
|
237
|
+
content=res.model_dump_json(indent=None),
|
238
|
+
media_type="application/json"
|
239
|
+
)
|
237
240
|
|
238
241
|
def get_models(self) -> Types.ModelsListResponse:
|
239
242
|
return Types.ModelsListResponse(
|
@@ -1,11 +1,13 @@
|
|
1
1
|
from deepanything.Server.Server import DeepAnythingServer
|
2
2
|
import argparse
|
3
3
|
import json
|
4
|
+
from .metadatas import VERSION
|
4
5
|
def main():
|
5
|
-
parser = argparse.ArgumentParser(prog="deepanything",description="Run a DeepAnything Server.")
|
6
|
+
parser = argparse.ArgumentParser(prog=f"deepanything {VERSION}",description="Run a DeepAnything Server.")
|
6
7
|
parser.add_argument('--host', type=str, required=False, help='Specific the host to listen.If specified,the host will be overwritten by this.')
|
7
8
|
parser.add_argument('--port', type=int, required=False, help='Specific the port to listen.If specified,the port will be overwritten by this.')
|
8
9
|
parser.add_argument('--config', type=str, required=True, help='Specific the confi path.')
|
10
|
+
parser.add_argument('--version', action='version', version=f'%(prog)s {VERSION}')
|
9
11
|
|
10
12
|
args = parser.parse_args()
|
11
13
|
|
@@ -0,0 +1 @@
|
|
1
|
+
VERSION = "v0.1.6"
|
@@ -1,4 +1,5 @@
|
|
1
1
|
from setuptools import setup, find_packages
|
2
|
+
from deepanything.metadatas import VERSION
|
2
3
|
|
3
4
|
with open("README.md",encoding='utf-8') as f:
|
4
5
|
long_description = f.read()
|
@@ -8,7 +9,7 @@ with open("requirements.txt") as f:
|
|
8
9
|
|
9
10
|
setup(
|
10
11
|
name="deepanything",
|
11
|
-
version=
|
12
|
+
version=VERSION,
|
12
13
|
author="Junity",
|
13
14
|
author_email="1727636624@qq.com",
|
14
15
|
description="DeepAnything is a project that provides DeepSeek R1's deep thinking capabilities for various large language models (LLMs).",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|