fusionkit-server 0.2.0__tar.gz → 0.3.0__tar.gz
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.
- {fusionkit_server-0.2.0 → fusionkit_server-0.3.0}/PKG-INFO +1 -1
- {fusionkit_server-0.2.0 → fusionkit_server-0.3.0}/pyproject.toml +1 -1
- {fusionkit_server-0.2.0 → fusionkit_server-0.3.0}/src/fusionkit_server/openai_endpoint.py +12 -6
- {fusionkit_server-0.2.0 → fusionkit_server-0.3.0}/src/fusionkit_server/__init__.py +0 -0
- {fusionkit_server-0.2.0 → fusionkit_server-0.3.0}/src/fusionkit_server/app.py +0 -0
|
@@ -153,13 +153,19 @@ def make_handler(endpoint: ModelEndpoint) -> type[BaseHTTPRequestHandler]:
|
|
|
153
153
|
)
|
|
154
154
|
|
|
155
155
|
async def run() -> Any:
|
|
156
|
+
# Build and close the client within this request's event
|
|
157
|
+
# loop so the SDK's HTTP connection pool is released instead
|
|
158
|
+
# of leaking a socket/file descriptor per request.
|
|
156
159
|
client = build_client(endpoint)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
try:
|
|
161
|
+
return await client.chat(
|
|
162
|
+
messages,
|
|
163
|
+
sampling,
|
|
164
|
+
tools=tools,
|
|
165
|
+
tool_choice=tool_choice if isinstance(tool_choice, str) else None,
|
|
166
|
+
)
|
|
167
|
+
finally:
|
|
168
|
+
await client.aclose()
|
|
163
169
|
|
|
164
170
|
started = time.perf_counter()
|
|
165
171
|
response = asyncio.run(run())
|
|
File without changes
|
|
File without changes
|