epam / ai-dial

Documentation for AI DIAL
https://docs.epam-rail.com/
Apache License 2.0
54 stars 17 forks source link

Error: Cannot read properties of undefined (reading 'delta') #111

Closed UladzimirStsepanovich closed 4 months ago

UladzimirStsepanovich commented 5 months ago

Hello team! I'm receiving the error when trying to ask question in chat

core-1 | 2024-05-23 15:52:59.278 INFO [vert.x-eventloop-thread-1] Received request from client. Trace: 65eff921ddf95659112c0f5274d63170. Span: 2007f685cd27e873. Key: TEST-PROJECT. Deployment: gpt-35-turbo. Headers: 10 core-1 | 2024-05-23 15:52:59.328 INFO [vert.x-worker-thread-0] Received body from client. Trace: 65eff921ddf95659112c0f5274d63170. Span: 2007f685cd27e873. Key: TEST-PROJECT. Deployment: gpt-35-turbo. Length: 101 core-1 | 2024-05-23 15:52:59.338 INFO [vert.x-eventloop-thread-1] Connected to origin. Trace: 65eff921ddf95659112c0f5274d63170. Span: 2007f685cd27e873. Key: TEST-PROJECT. Deployment: gpt-35-turbo. Address: adapter-openai:5000 adapter-openai-1 | INFO: | 2024-05-23 15:53:00 | uvicorn.access | 9 | 172.20.0.5:42396 - "POST /openai/deployments/gpt-35-turbo/chat/completions?api-version=2024-02-01 HTTP/1.1" 200 core-1 | 2024-05-23 15:53:00.313 INFO [vert.x-eventloop-thread-1] Received header from origin. Trace: 65eff921ddf95659112c0f5274d63170. Span: 2007f685cd27e873. Key: TEST-PROJECT. Deployment: gpt-35-turbo. Endpoint: http://adapter-openai:5000/openai/deployments/gpt-35-turbo/chat/completions. Upstream: https:///openai/deployments/gpt-35-turbo/chat/completions. Status: 200. Headers: 4 core-1 | 2024-05-23 15:53:00.964 INFO [vert.x-eventloop-thread-1] Sent response to client. Trace: 65eff921ddf95659112c0f5274d63170. Span: 2007f685cd27e873. Key: TEST-PROJECT. Deployment: gpt-35-turbo. Endpoint: http://adapter-openai:5000/openai/deployments/gpt-35-turbo/chat/completions. Upstream: https:///openai/deployments/gpt-35-turbo/chat/completions. Status: 200. Length: 13372. Timing: 1726 (body=91, connect=10, header=975, body=650). Tokens: completion=28, prompt=9, total=37 chat-1 | [15:53:00.317] ERROR (17): Error reading stream: [trace_id=65eff921ddf95659112c0f5274d63170, span_id=7bfc986f54d5dc72] chat-1 | trace_id: "65eff921ddf95659112c0f5274d63170" chat-1 | span_id: "7bfc986f54d5dc72" chat-1 | trace_flags: "01" chat-1 | err: { chat-1 | "type": "TypeError", chat-1 | "message": "Cannot read properties of undefined (reading 'delta')", chat-1 | "stack": chat-1 | TypeError: Cannot read properties of undefined (reading 'delta') chat-1 | at /app/.next/server/pages/api/chat.js:1:6876 chat-1 | at parseEventStreamLine (/app/node_modules/eventsource-parser/dist/index.js:78:9) chat-1 | at Object.feed (/app/node_modules/eventsource-parser/dist/index.js:66:7) chat-1 | at Object.start (/app/.next/server/pages/api/chat.js:1:7101) chat-1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) chat-1 | }

config.json file:

{ "routes": {}, "models": { "gpt-35-turbo": { "type": "chat", "displayName": "GPT-3.5", "endpoint": "http://adapter-openai:5000/openai/deployments/gpt-35-turbo/chat/completions", "iconUrl": "http://localhost:3001/gpt3.svg", "upstreams": [ { "endpoint": "https:///openai/deployments/gpt-35-turbo/chat/completions", "key": "" } ] } }, "keys": { "dial_api_key": { "project": "TEST-PROJECT", "role": "default" } }, "roles": { "default": { "limits": { "gpt-35-turbo": {} } } } }

Installed on the local machine by provided Tutorial Launch AI DIAL Chat with an Azure model

adubovik commented 4 months ago

@UladzimirStsepanovich please upgrade dial-chat to version 0.12.0 (or later), where this bug has been fixed.