logancyang / obsidian-copilot

THE Copilot in Obsidian
GNU Affero General Public License v3.0
2.58k stars 179 forks source link

CORS policy blocks embedding models for QA #528

Closed unicorn-kp closed 1 week ago

unicorn-kp commented 2 weeks ago

This bug report is for using OpenAI embedding. Upon indexing, CORS policy blocks a POST. However, Vault QA indexing seems to recover after an attempt.

The CORS issue has popped up now for Long Note and Vault QA when using both an OpenAI embedding model as well as a self-hosted OpenAI API clone. The self-hosted clone is not able to index any file within the vault due to the CORS policy block.

Describe how to reproduce

Expected behavior Vault begins to index all pages

Screenshots

image

image

Additional context

495 seems to have resolved the CORS issue for chat with a self-hosted OpenAI API clone, but I don't believe the proxy was integrated for Long Note QA or Vault QA.

logancyang commented 2 weeks ago

Right, #495 was for chat only. Embedding models will have it next.

But you also see CORS issue with the official OpenAI embedding API? That I haven't seen before 🤔

logancyang commented 2 weeks ago

@unicorn-kp For your self-hosted clone, were you able to Allow CORS on the server side? That is the way to go.

unicorn-kp commented 2 weeks ago

I'll see if we can explicitly allow traffic from Obsidian.

logancyang commented 1 week ago

This should be good from 2.6.0.