test
This commit is contained in:
1 parent
13ecfc3e42
commit
cb88f02b40
4 files changed
+55
-3
No files matched your search
+4
-2
@@ -1,10 +1,12 @@
|
||||
FROM python:3.12-slim
|
||||
FROM python:3.12-slim-bookworm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Oracle Instant Client runtime dependencies for thick mode.
|
||||
# `libaio1` is available on Debian bookworm, while newer variants may expose `libaio1t64`.
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends libaio1 libnsl2 \
|
||||
&& (apt-get install -y --no-install-recommends libaio1 libnsl2 \
|
||||
|| apt-get install -y --no-install-recommends libaio1t64 libnsl2) \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python dependencies
|
||||
|
||||
@@ -88,7 +88,7 @@ class DifyService:
|
||||
'inputs': {},
|
||||
'query': query,
|
||||
'response_mode': 'streaming',
|
||||
'conversation_id': conversation_id,
|
||||
'conversation_id': conversation_id or '',
|
||||
'user': str(user_id),
|
||||
}
|
||||
|
||||
@@ -115,6 +115,18 @@ class DifyService:
|
||||
response.status_code,
|
||||
response.reason,
|
||||
)
|
||||
if not response.ok and current_app:
|
||||
try:
|
||||
error_body = response.text[:2000]
|
||||
except Exception:
|
||||
error_body = "<failed to read response body>"
|
||||
current_app.logger.error(
|
||||
"[chat-stream] dify bad response status=%s url=%s payload=%s body=%s",
|
||||
response.status_code,
|
||||
url,
|
||||
json.dumps(payload, ensure_ascii=False),
|
||||
error_body,
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
for line in response.iter_lines():
|
||||
|
||||
Reference in new issue
Block a user