alfredapp / openai-workflow

OpenAI integrations
BSD 3-Clause "New" or "Revised" License
65 stars 29 forks source link

Stream output is interrupted #38

Closed kevin1sMe closed 4 months ago

kevin1sMe commented 4 months ago

Frequently Asked Questions

Workflow version

v2024.11

Alfred version

5.5

macOS version

14.5

Debugger output

[14:19:05.720] ChatGPT / DALL-E[[Keyword](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EBF340515-39CD-47C9-965D-B1631A3BF45F)] Processing complete
[14:19:05.727] ChatGPT / DALL-E[[Keyword](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EBF340515-39CD-47C9-965D-B1631A3BF45F)] Passing output '' to [Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E2EF95279-1807-40A5-B729-78040FF36DE3)
[14:19:05.728] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E2EF95279-1807-40A5-B729-78040FF36DE3)] Processing complete
[14:19:05.728] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E2EF95279-1807-40A5-B729-78040FF36DE3)] Passing output '' to [Run Script](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E69E7709B-6303-4AE7-8DC3-DE711A831767)
[14:19:05.729] ChatGPT / DALL-E[[Run Script](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E69E7709B-6303-4AE7-8DC3-DE711A831767)] Processing complete
[14:19:05.730] ChatGPT / DALL-E[[Run Script](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E69E7709B-6303-4AE7-8DC3-DE711A831767)] Passing output '' to [Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E3CAF90D9-FBE8-4B90-9B91-8452E0B534EF)
[14:19:05.732] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E3CAF90D9-FBE8-4B90-9B91-8452E0B534EF)] Processing complete
[14:19:05.734] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E3CAF90D9-FBE8-4B90-9B91-8452E0B534EF)] Passing output '' to [Call External Trigger](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E84A47CA0-9D2D-4F06-A7AD-71C5DEF87663)
[14:19:05.738] ChatGPT / DALL-E[[External](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EA6AD2F54-5A90-4F2A-8585-27AE685FD251)] Processing complete
[14:19:05.739] ChatGPT / DALL-E[[External](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EA6AD2F54-5A90-4F2A-8585-27AE685FD251)] Passing output '' to [Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E002874FF-3AE4-4E8F-A4F8-65844E5D6CFB)
[14:19:05.739] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E002874FF-3AE4-4E8F-A4F8-65844E5D6CFB)] Processing complete
[14:19:05.740] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E002874FF-3AE4-4E8F-A4F8-65844E5D6CFB)] Passing output '' to [Conditional](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E74890339-2177-4514-B0CD-9D06DF626D21)
[14:19:05.741] ChatGPT / DALL-E[[Conditional](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E74890339-2177-4514-B0CD-9D06DF626D21)] Processing complete
[14:19:05.742] ChatGPT / DALL-E[[Conditional](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E74890339-2177-4514-B0CD-9D06DF626D21)] Passing output '' to [Run Script](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EF87E8DE0-4373-4E35-B112-2E68DC5B10E8)
[14:19:05.774] ChatGPT / DALL-E[[Run Script](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EF87E8DE0-4373-4E35-B112-2E68DC5B10E8)] Processing complete
[14:19:05.779] ChatGPT / DALL-E[[Run Script](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EF87E8DE0-4373-4E35-B112-2E68DC5B10E8)] Passing output '' to [Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EBEF31BF9-C0C4-47F4-9ECA-3D50C2A84EE7)
[14:19:05.780] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EBEF31BF9-C0C4-47F4-9ECA-3D50C2A84EE7)] Processing complete
[14:19:05.781] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EBEF31BF9-C0C4-47F4-9ECA-3D50C2A84EE7)] Passing output '/Users/kevin/Library/Application Support/Alfred/Workflow Data/com.alfredapp.vitor.openai
/Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai' to [Split Arg](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EE5D42111-A4E5-4C7E-AED9-B0A379A66986)
[14:19:05.786] ChatGPT / DALL-E[[Split Arg](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EE5D42111-A4E5-4C7E-AED9-B0A379A66986)] Processing complete
[14:19:05.787] ChatGPT / DALL-E[[Split Arg](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EE5D42111-A4E5-4C7E-AED9-B0A379A66986)] Passing output '(
    "/Users/kevin/Library/Application Support/Alfred/Workflow Data/com.alfredapp.vitor.openai",
    "/Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai"
)' to [Automation Task](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EA9ABC5CB-D8E3-4E0D-9006-7B7F70A37D50)
[14:19:05.788] ChatGPT / DALL-E[[Automation Task](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EA9ABC5CB-D8E3-4E0D-9006-7B7F70A37D50)] Running task 'New Folder' with arguments (
    "/Users/kevin/Library/Application Support/Alfred/Workflow Data/com.alfredapp.vitor.openai",
    "/Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai"
)
[14:19:05.813] ChatGPT / DALL-E[[Automation Task](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EA9ABC5CB-D8E3-4E0D-9006-7B7F70A37D50)] Processing complete
[14:19:05.816] ChatGPT / DALL-E[[Automation Task](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EA9ABC5CB-D8E3-4E0D-9006-7B7F70A37D50)] Passing output '(
    "/Users/kevin/Library/Application Support/Alfred/Workflow Data/com.alfredapp.vitor.openai",
    "/Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai"
)' to [Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EB34F5D4B-43D6-47E7-AC9E-0258BF80F186)
[14:19:05.817] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EB34F5D4B-43D6-47E7-AC9E-0258BF80F186)] Processing complete
[14:19:05.817] ChatGPT / DALL-E[[Arg and Vars](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3EB34F5D4B-43D6-47E7-AC9E-0258BF80F186)] Passing output '' to [Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)
[14:19:05.827] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument ''
[14:19:05.926] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv '' finished
[14:19:05.936] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@:
readChat@@path@@: /Users/kevin/Library/Application Support/Alfred/Workflow Data/com.alfredapp.vitor.openai/chat.json
fileExists@@path@@: /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/stream.txt
[14:19:05.941] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"response":"","behaviour":{"scroll":"end"}}
[14:19:18.559] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'hello'
[14:19:18.700] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'hello' finished
[14:19:18.706] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true,"stream_marker":true},"response":"### hello\n\n"}
[14:19:18.805] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'hello'
[14:19:18.986] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'hello' finished
[14:19:18.993] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: hello
[14:19:18.994] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true},"response":"…","behaviour":{"response":"append"}}
[14:19:19.094] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'hello'
[14:19:19.251] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'hello' finished
[14:19:19.258] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: hello
[14:19:19.259] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true}}
[14:19:19.353] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'hello'
[14:19:19.474] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'hello' finished
[14:19:19.480] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: hello
[14:19:19.481] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true}}
[14:19:19.578] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'hello'
[14:19:19.703] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'hello' finished
[14:19:19.709] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: hello
[14:19:19.710] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true}}
[14:19:19.807] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'hello'
[14:19:19.922] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'hello' finished
[14:19:19.928] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: hello
readChat@@path@@: /Users/kevin/Library/Application Support/Alfred/Workflow Data/com.alfredapp.vitor.openai/chat.json
deleteFile@path@@ /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/stream.txt
renameFile@@oldPath@@: /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/stream.txt
renameFile@@newPath@@: /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/stream_20240614-141919.txt
deleteFile@path@@ /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/pid.txt
renameFile@@oldPath@@: /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/pid.txt
renameFile@@newPath@@: /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/pid_20240614-141919.txt
[14:19:19.929] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"response":"Hello!","behaviour":{"response":"replacelast","scroll":"end"}}
[14:19:28.763] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'how old are you'
[14:19:28.982] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'how old are you' finished
[14:19:28.989] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true,"stream_marker":true},"response":"### hello\n\nHello!\n\n### how old are you\n\n"}
[14:19:29.091] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'how old are you'
[14:19:29.285] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'how old are you' finished
[14:19:29.292] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: how old are you
[14:19:29.293] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true},"response":"…","behaviour":{"response":"append"}}
[14:19:29.393] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'how old are you'
[14:19:29.592] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'how old are you' finished
[14:19:29.599] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: how old are you
[14:19:29.600] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true}}
[14:19:29.699] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'how old are you'
[14:19:29.918] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'how old are you' finished
[14:19:29.925] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: how old are you
[14:19:29.927] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true}}
[14:19:30.024] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'how old are you'
[14:19:30.242] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'how old are you' finished
[14:19:30.249] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: how old are you
[14:19:30.250] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"rerun":0.1,"variables":{"streaming_now":true}}
[14:19:30.348] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Running with argument 'how old are you'
[14:19:30.488] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] Script with argv 'how old are you' finished
[14:19:30.495] STDERR: ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] @@argv@@: how old are you
readChat@@path@@: /Users/kevin/Library/Application Support/Alfred/Workflow Data/com.alfredapp.vitor.openai/chat.json
deleteFile@path@@ /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/stream.txt
renameFile@@oldPath@@: /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/stream.txt
renameFile@@newPath@@: /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/stream_20240614-141930.txt
deleteFile@path@@ /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/pid.txt
renameFile@@oldPath@@: /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/pid.txt
renameFile@@newPath@@: /Users/kevin/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.openai/pid_20240614-141930.txt
[14:19:30.496] ChatGPT / DALL-E[[Text View](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.142260CD-1733-4CC1-8D50-19C4FD935BCA%3E4DB440D5-3814-4C79-9724-D19FDDDA4BEC)] {"response":"I am a AI","behaviour":{"response":"replacelast","scroll":"end"}}

More details

Steam output is interrupted. I tried debugging and found that the content in the steam.txt file is complete. Directly using the curl stream mode to fetch data also yields a complete result. I'm unsure of what caused the interruption in output. Please help, thank you!

BYW: i had this problem when using other OpenAI-compatible models, and when I switched back to a normal open i model like gpt-3.5-turbo, it seemed to work fine.

image

I have add some log for debug, the steam.txt like this:

data: {"id":"chatcmpl-0fe0e3b0243745e0b4105773509f79d9","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":"I"}}]}

data: {"id":"chatcmpl-5d369a316fbf4af093c3170805d9b46b","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" am"}}]}

data: {"id":"chatcmpl-fd3f9213cddd4893985ec74cb85a1d8d","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" a"}}]}

data: {"id":"chatcmpl-5d435ca7725549119dc101c9bcb422ee","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" AI"}}]}

data: {"id":"chatcmpl-b100eeb332434532ae165b5c76f0df59","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" assistant"}}]}

data: {"id":"chatcmpl-80443155593b44199fb99bf8b2fb07c5","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" and"}}]}

data: {"id":"chatcmpl-df60283e531340f0857934c91d465f32","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" do"}}]}

data: {"id":"chatcmpl-61bb88ecd249446f9deb157621833f10","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" not"}}]}

data: {"id":"chatcmpl-b987bc0ba3d049c3ad2f58fbc4624409","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" have"}}]}

data: {"id":"chatcmpl-14acff8876d2436fa1122cd51372c33d","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" a"}}]}

data: {"id":"chatcmpl-cf5ab19b6e3e47d19b1cb3b74f22125b","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" physical"}}]}

data: {"id":"chatcmpl-04554ff498fd4b10bae4e0324aee43e1","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" body"}}]}

data: {"id":"chatcmpl-8e377c4a1ac64f009bf5b856977521cb","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" or"}}]}

data: {"id":"chatcmpl-78dc27243e664e57bf67e917cc50835f","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":" age"}}]}

data: {"id":"chatcmpl-0fe770a10cef4a149cf613ce01231fe8","object":"chat.completion.chunk","created":1718345899,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":"."}}]}

data: {"id":"chatcmpl-93ddb6aac4fa494bb2bf87d31dab7290","object":"chat.completion.chunk","created":1718345899,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":""},"finish_reason":"stop"}]}

data: [DONE]
vitorgalvao commented 4 months ago

readChat@@path@@

I don’t know where this is coming from, but it’s not from my code in the workflow. If you’ve modified the workflow, supporting those changes becomes up to you.

i had this problem when using other OpenAI-compatible models, and when I switched back to a normal open i model like gpt-3.5-turbo, it seemed to work fine.

As per the FAQ (emphasis added):

The workflow offers the ability to change the API end points and override model names in the Workflow Environment Variables. This requires advanced configuration and is not something we can provide support for, but our community are doing it with great success and can help you on a different thread.

There are too many alternative models and their behaviour may be inconsistent despite claiming OpenAI-compatibility. They may for example not support streaming (real example, though I forget the exact model). The workflow supports local models on a best-effort basis but debugging those is up to users who choose to go that path. The linked thread exists precisely to help with those. You can also try a different workflow geared specifically for those models.

Have a nice weekend.

kevin1sMe commented 4 months ago

I think I understand the reason now. The issue is caused by the omission of the finish_reason field in the response from the OpenAI-compatible API. Here is an example of the response:

data: {"id":"chatcmpl-0fe0e3b0243745e0b4105773509f79d9","object":"chat.completion.chunk","created":1718345898,"model":"tencent-hunyuan","choices":[{"index":0,"delta":{"content":"I"}}]}

This omission leads to the following condition not being met:

  // If response is not finished, continue loop
  if (finishReason === null) return JSON.stringify({
    rerun: 0.1,
    variables: { streaming_now: true },
    response: responseText,
    behaviour: { response: "replacelast", scroll: "end" }
  })

To make it compatible, I modified it as follows:

  // If response is not finished, continue loop
  if (finishReason === null || finishReason == undefined) return JSON.stringify({
    rerun: 0.1,
    variables: { streaming_now: true },
    response: responseText,
    behaviour: { response: "replacelast", scroll: "end" }
  })

Thank you for your response. I'm not sure if others are experiencing the same issue. I am using this universal API (https://github.com/songquanpeng/one-api), which has over 15k+ stars. I believe supporting it would be beneficial to many users. Should I submit a PR for this?

Have a great weekend!

vitorgalvao commented 4 months ago

Should I submit a PR for this?

No, but thank you for asking. The fix isn’t that straightforward because it needs to prioritise and be robust for the main use case. A workaround could be added but not without complicating the code and interface, and a specific goal of this workflow is to be focused and not become overwhelming. APIs which claim to be compatible but aren’t are out of scope.