A-F-V / obsidian-arcana

Supercharge your Obsidian note-taking through AI-powered insights and suggestions
MIT License
88 stars 5 forks source link

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

Open autonomygaps opened 1 year ago

autonomygaps commented 1 year ago

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):

A-F-V commented 1 year ago

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.

dodo-the-dev commented 1 year ago

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.

A-F-V commented 1 year ago

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

fullerenedream commented 1 year ago

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