obsidian-arcana icon indicating copy to clipboard operation
obsidian-arcana copied to clipboard

Bug: Expected content-type to be text/event-stream, Actual: application/json

Open autonomygaps opened this issue 2 years ago • 4 comments
trafficstars

Describe the bug I'm loving Arcana, but sometimes I get an error message like this:

"Expected content-type to be text/event-stream, Actual: application/json"

To Reproduce Steps to reproduce the behavior:

  1. In a file in Obsidian, activate the command palette
  2. Chose "Feynman Flashcards" or "Nostradamus Names"
  3. See error

Expected behavior Sometime it works as advertised.

Screenshots

Desktop (please complete the following information):

  • OS: macOS Ventura Obsidian Version 1.3.7 (Installer 1.3.5)

autonomygaps avatar Jul 02 '23 16:07 autonomygaps

Yes, this was something I saw. It was at least a problem on LangChain's side a while back. I made a note in the code:

// Sadly, Langchain does not cope well with streaming and exceptions. If an api error happens, it will not return a text/event-stream but instead an application/json with the error message.
// This will throw that the stream was not returned instead of the error message.

I am going to check if this has been fixed.

A-F-V avatar Jul 02 '23 16:07 A-F-V

I'm getting this issue for everything. I've tried a new API key, I've tried both 3.5 and 4 and nothing does anything.

This is what my console shows for Obsidian: image

I've tried on both my work Windows (thought maybe it was a firewall issue) and my personal Laptop running Linux Arch, both give the same issue.

dodo-the-dev avatar Jul 07 '23 15:07 dodo-the-dev

Take a look at: https://platform.openai.com/docs/guides/error-codes/api-errors Looks like you may be out of tokens. You need to set up billing with OpenAI for this to work. Hope that helps

A-F-V avatar Jul 07 '23 16:07 A-F-V

I get this error too, but only on certain files. I was trying to use Darwin to auto-tag. I haven't run out of tokens - it works fine on most of my files.

Windows 10, Obsidian 1.4.5

fullerenedream avatar Sep 01 '23 23:09 fullerenedream