Add support for streaming chat response from OpenAI to Obsidian

- I needed to installed node-fetch to accomplish this, as the built-in request object from Obsidian doesn't seem to support streaming and the built-in fetch object is very sensitive to any and all cross origin requests
This commit is contained in:
sabaimran
2023-07-05 15:01:22 -07:00
parent 3ff5074cf5
commit 4e6b66b139
4 changed files with 159 additions and 14 deletions

View File

@@ -8,7 +8,12 @@
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"version": "node version-bump.mjs && git add manifest.json versions.json"
},
"keywords": ["search", "chat", "AI", "assistant"],
"keywords": [
"search",
"chat",
"AI",
"assistant"
],
"author": "Debanjum Singh Solanky",
"license": "GPL-3.0-or-later",
"devDependencies": {
@@ -20,5 +25,9 @@
"obsidian": "latest",
"tslib": "2.4.0",
"typescript": "4.7.4"
},
"dependencies": {
"@types/node-fetch": "^2.6.4",
"node-fetch": "3.0.0"
}
}