Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPT4 API stopped working in beta. #508

Closed
bbecausereasonss opened this issue Mar 13, 2024 · 10 comments
Closed

GPT4 API stopped working in beta. #508

bbecausereasonss opened this issue Mar 13, 2024 · 10 comments

Comments

@bbecausereasonss
Copy link

bbecausereasonss commented Mar 13, 2024

Was testing Claude (but found it to be too prompt). Tried going back to OpenAi/GPT4.

Getting this log error

"plugin:smart-connections:7305 Smart Connections: Error testing API key Error: Request failed, status 401
at new t (app.js:1:1782334)
at Bq (app.js:1:1782526)
at app.js:1:1783203
at app.js:1:237544
at Object.next (app.js:1:237649)
at a (app.js:1:236367)
test_api_key_openai @ plugin:smart-connections:7305
await in test_api_key_openai (async)
handle_on_change @ plugin:smart-connections:7222
eval @ plugin:smart-connections:7169
(anonymous) @ app.js:1
plugin:smart-connections:6395 ['[[Summary - Business - OverPrescribed - Daniel Priestly]]']
plugin:smart-connections:6364 [t]
plugin:smart-connections:5147 chat_ml
plugin:smart-connections:5148 {messages: Array(4)}
plugin:smart-connections:5147 chat_ml
plugin:smart-connections:5148 {messages: Array(5)}
plugin:smart-connections:7017 {name: 'Not found: '}
plugin:smart-connections:7017 {name: 'Not found: '}
plugin:smart-connections:7017 {name: 'Not found: '}
plugin:smart-connections:7017 {name: 'Not found: '}
plugin:smart-connections:5535 POST https://api.openai.com/v1/chat/completions 404
stream @ plugin:smart-connections:5535
full_str @ plugin:smart-connections:6126
stream @ plugin:smart-connections:6084
await in stream (async)
new_user_message @ plugin:smart-connections:6995
await in new_user_message (async)
eval @ plugin:smart-connections:6718
plugin:smart-connections:6121 CustomEvent {isTrusted: false, data: '{\n "error": {\n "message": "The model gp… null,\n "code": "model_not_found"\n }\n}\n', source: SmartStreamer, detail: null, type: 'error', …} eval @ plugin:smart-connections:6121 eval @ plugin:smart-connections:5511 dispatchEvent @ plugin:smart-connections:5510 onStreamFailure_fn @ plugin:smart-connections:5560 onStreamProgress_fn @ plugin:smart-connections:5573 XMLHttpRequest.send (async) stream @ plugin:smart-connections:5535 full_str @ plugin:smart-connections:6126 stream @ plugin:smart-connections:6084 await in stream (async) new_user_message @ plugin:smart-connections:6995 await in new_user_message (async) eval @ plugin:smart-connections:6718 plugin:smart-connections:5147 chat_ml plugin:smart-connections:5148 {messages: Array(6)} plugin:smart-connections:6999 Uncaught (in promise) CustomEvent {isTrusted: false, data: '{\n "error": {\n "message": "The model gp… null,\n "code": "model_not_found"\n }\n}\n', source: SmartStreamer, detail: null, type: 'error', …}"

@bbecausereasonss
Copy link
Author

Obsidian Developer Console
plugin:obsidian-icon-folder:5427 loading iconize
plugin:obsidian-mind-map:32574 Loading Mind Map plugin
plugin:obsidian-tasks-plugin:149 [2024-03-13-18:03:37.904][info][tasks] loading plugin "Tasks" v6.1.2
plugin:obsidian-minimal-settings:80 Folding is on
plugin:obsidian-minimal-settings:94 Line numbers are off
plugin:obsidian-minimal-settings:100 Readable line length is on
plugin:simple-embeds:29615 Loading Simple Embeds v1.15.0
plugin:obsidian-sortable:180 Sortable: loading plugin...
plugin:obsidian-sortable:183 Sortable: loaded plugin.
plugin:highlightr-plugin:3508 Highlightr v1.2.2 loaded
plugin:table-editor-obsidian:28854 loading markdown-table-editor plugin
plugin:webpage-html-export:74719 Loading webpage-html-export plugin
plugin:file-explorer-note-count:933 loading FileExplorerNoteCount
plugin:editing-toolbar:9 cMenuToolbar v2.4.0 loaded
plugin:obsidian-auto-link-title:404 loading obsidian-auto-link-title
plugin:obsidian-paste-image-rename:465 Plugin loading: obsidian-paste-image-rename 1.6.1 BUILD_ENV=production
plugin:recent-files-obsidian:234 Recent Files: Loading plugin v1.3.10
plugin:recent-files-obsidian:272 Recent Files: maxLength is not set, using default (50)
plugin:arrows:52 Loading Obsidian Arrows...
plugin:arrows:62 Loaded Obsidian Arrows.
plugin:link-favicon:9 enabling plugin: link favicons
plugin:obsidian-shortcuts-for-starred-files:96 loading Hotkeys for Bookmarks
2plugin:lovely-mindmap:495 setting
plugin:obsidian42-brat:2300 loading BRAT
plugin:obsidian-focus-mode:152 Loading Focus Mode plugin ...
plugin:obsidian-markdown-formatting-assistant-plugin:2364 Object
plugin:obsidian-markdown-formatting-assistant-plugin:4815 loading obsidian-markdown-formatting-assistant-plugin
plugin:copilot:80585 New LLM chain created.
plugin:copilot:91572 Setting model to GPT-4: gpt-4
plugin:pdf-to-markdown-plugin:62114 Found existing settings file
plugin:smart-connections:7477 Loading Smart Connections v2...
plugin:callout-manager:1620 Unable to fetch Obsidian stylesheet. Error: [obsidian-extra]: Obsidian 1.5.8 has not been tested with this function
at eval (plugin:callout-manager:154:13)
at Generator.next ()
at eval (plugin:callout-manager:147:67)
at new Promise ()
at __awaiter (plugin:callout-manager:129:10)
at fetchObsidianStyles (plugin:callout-manager:152:10)
at StylesheetWatcher.checkForChangesObsidian (plugin:callout-manager:1612:35)
at StylesheetWatcher.checkForChanges (plugin:callout-manager:1594:28)
at StylesheetWatcher.watch (plugin:callout-manager:1531:10)
at eval (plugin:callout-manager:2983:37)
at t. (app.js:1:2003310)
at app.js:1:237544
at Object.next (app.js:1:237649)
at a (app.js:1:236367)
checkForChangesObsidian @ plugin:callout-manager:1620
plugin:obsidian-excalidraw-plugin:95 Initialized Excalidraw Image Cache
plugin:smart-connections:5316 get_conversation_ids_and_file_types
plugin:smart-connections:5318 Object
plugin:smart-connections:6975 SmartConversationMD
plugin:smart-connections:6634 init SmartChatRenderer
plugin:smart-connections:6635 <div class=​"workspace-leaf-content" data-type=​"smart-connections-chat-view">​…​​flex
plugin:smart-connections:6637 SmartConversationMD
plugin:obsidian-icon-folder:581 loaded icon pack font-awesome-brands (459)
plugin:obsidian-icon-folder:581 loaded icon pack font-awesome-regular (161)
plugin:smart-connections:4635 Parent changed, reloading
plugin:obsidian-icon-folder:581 loaded icon pack font-awesome-solid (1128)
plugin:smart-connections:114 Loading: .smart-connections/smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:114 Loading: .smart-connections/smart_blocks-text-embedding-3-small-512.ajson
plugin:smart-connections:122 Loaded: smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:122 Loaded: smart_blocks-text-embedding-3-small-512.ajson
plugin:smart-connections:157 Saving: smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:151 Already saving: smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:1452 total tokens exceeds max_tokens 30660
plugin:smart-connections:7754 Object
plugin:smart-connections:7756 2.1.3
plugin:smart-connections:7759 Already up to date
plugin:smart-connections:114 Loading: .smart-connections/smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:114 Loading: .smart-connections/smart_blocks-text-embedding-3-small-512.ajson
plugin:smart-connections:151 Already saving: smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:157 Saving: smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:122 Loaded: smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:122 Loaded: smart_blocks-text-embedding-3-small-512.ajson
2plugin:smart-connections:151 Already saving: smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:1452 total tokens exceeds max_tokens 30660
plugin:smart-connections:188 Error saving: smart_notes-text-embedding-3-small.ajson
_save @ plugin:smart-connections:188
plugin:smart-connections:189 Error: EPERM: operation not permitted, rename 'W:\Dropbox\Inbox\Obsidian.smart-connections\smart_notes-text-embedding-3-small.temp.ajson' -> 'W:\Dropbox\Inbox\Obsidian.smart-connections\smart_notes-text-embedding-3-small.ajson'
_save @ plugin:smart-connections:189
plugin:smart-connections:188 Error saving: smart_notes-text-embedding-3-small.ajson
_save @ plugin:smart-connections:188
plugin:smart-connections:189 Error: EPERM: operation not permitted, open 'W:\Dropbox\Inbox\Obsidian.smart-connections\smart_notes-text-embedding-3-small.temp.ajson'
_save @ plugin:smart-connections:189
plugin:smart-connections:196 Uncaught (in promise) Error: EPERM: operation not permitted, rename 'W:\Dropbox\Inbox\Obsidian.smart-connections\smart_notes-text-embedding-3-small.temp.ajson' -> 'W:\Dropbox\Inbox\Obsidian.smart-connections\smart_notes-text-embedding-3-small.failed-1710367427484.ajson'
plugin:smart-connections:2062 Uncaught (in promise) Error: EPERM: operation not permitted, rename 'W:\Dropbox\Inbox\Obsidian.smart-connections\smart_notes-text-embedding-3-small.temp.ajson' -> 'W:\Dropbox\Inbox\Obsidian.smart-connections\smart_notes-text-embedding-3-small.failed-1710367427485.ajson'
plugin:obsidian-icon-folder:581 loaded icon pack icon-brew (284)
plugin:smart-connections:151 Already saving: smart_notes-text-embedding-3-small.ajson
plugin:obsidian-icon-folder:581 loaded icon pack lucide-icons (897)
plugin:smart-connections:157 Saving: smart_blocks-text-embedding-3-small-512.ajson
plugin:smart-connections:151 Already saving: smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:203 New file size: 37299857 bytes
plugin:smart-connections:204 Old file size: 37299830 bytes
plugin:smart-connections:183 Saved smart_blocks-text-embedding-3-small-512.ajson in 815ms
plugin:obsidian-icon-folder:581 loaded icon pack remix-icons (2271)
plugin:smart-connections:2183 Object
plugin:smart-connections:2183 Object
plugin:obsidian-icon-folder:581 loaded icon pack simple-icons (2413)
plugin:obsidian-icon-folder:581 loaded icon pack tabler-icons (4140)
plugin:lovely-mindmap:201 Uncaught TypeError: Cannot read properties of undefined (reading 'selection')
at Node.getSelection (plugin:lovely-mindmap:201:29)
at View.isTouching (plugin:lovely-mindmap:431:27)
at Keymap.focusNode (plugin:lovely-mindmap:388:24)
at e.handleKey (app.js:1:748623)
at e.handleKey (app.js:1:748736)
at t.handleKey (app.js:1:748945)
at e.onKeyEvent (app.js:1:749879)
plugin:smart-connections:157 Saving: smart_notes-text-embedding-3-small.ajson
plugin:smart-connections:157 Saving: smart_blocks-text-embedding-3-small-512.ajson
plugin:smart-connections:183 Saved smart_notes-text-embedding-3-small.ajson in 577ms
plugin:smart-connections:203 New file size: 37299857 bytes
plugin:smart-connections:204 Old file size: 37299857 bytes
plugin:smart-connections:183 Saved smart_blocks-text-embedding-3-small-512.ajson in 954ms
plugin:smart-connections:6395 Array(1)
plugin:smart-connections:6364 Array(1)
plugin:smart-connections:5147 chat_ml
plugin:smart-connections:5148 Object
plugin:smart-connections:6371 should trigger retrieval
plugin:smart-connections:6403 get_context_hyde
plugin:smart-connections:6020 Object
plugin:smart-connections:6023 Object
plugin:smart-connections:6025 Object
plugin:smart-connections:6027 Object
complete @ plugin:smart-connections:6027
plugin:smart-connections:6034 TypeError: done_handler is not a function
at SmartModel.complete (plugin:smart-connections:6028:20)
at async ScActions.get_context_hyde (plugin:smart-connections:6409:21)
at async ScActions.new_user_message (plugin:smart-connections:6376:11)
at async ScChat.new_user_message (plugin:smart-connections:6984:9)
complete @ plugin:smart-connections:6034
plugin:smart-connections:1428 input is empty
plugin:smart-connections:5147 chat_ml
plugin:smart-connections:5148 Object
plugin:smart-connections:6433 Array(0)
plugin:smart-connections:5147 chat_ml
plugin:smart-connections:5148 Object
plugin:smart-connections:7017 Object
plugin:smart-connections:7017 Object
api.openai.com/v1/chat/completions:1 Failed to load resource: the server responded with a status of 404 ()
plugin:smart-connections:6121 CustomEvent
eval @ plugin:smart-connections:6121
plugin:smart-connections:5147 chat_ml
plugin:smart-connections:5148 Object
plugin:smart-connections:6999 Uncaught (in promise) CustomEvent
2plugin:smart-connections:7624 old showing notice
plugin:smart-connections:2677 WebSocket connection to 'ws://localhost:37042/' failed:
eval @ plugin:smart-connections:2677
connect_to_websocket @ plugin:smart-connections:2676
init @ plugin:smart-connections:2752
plugin:smart-connections:2699 Websocket error Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
on_error @ plugin:smart-connections:2699
ws.onerror @ plugin:smart-connections:2689
error (async)
eval @ plugin:smart-connections:2687
connect_to_websocket @ plugin:smart-connections:2676
init @ plugin:smart-connections:2752
plugin:smart-connections:2695 Failed to connect to WebSocket: Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
connect_to_websocket @ plugin:smart-connections:2695
await in connect_to_websocket (async)
init @ plugin:smart-connections:2752
plugin:smart-connections:2753 DataviewSocket initialized
plugin:smart-connections:2789 Disconnected from websocket
plugin:smart-connections:2677 WebSocket connection to 'ws://localhost:37042/' failed:
eval @ plugin:smart-connections:2677
connect_to_websocket @ plugin:smart-connections:2676
init @ plugin:smart-connections:2752
plugin:smart-connections:2699 Websocket error Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
on_error @ plugin:smart-connections:2699
ws.onerror @ plugin:smart-connections:2689
error (async)
eval @ plugin:smart-connections:2687
connect_to_websocket @ plugin:smart-connections:2676
init @ plugin:smart-connections:2752
plugin:smart-connections:2695 Failed to connect to WebSocket: Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
connect_to_websocket @ plugin:smart-connections:2695
await in connect_to_websocket (async)
init @ plugin:smart-connections:2752
plugin:smart-connections:2753 DataviewSocket initialized
plugin:smart-connections:2789 Disconnected from websocket

@RickyGrassmuck
Copy link

Just ran into this as well. Looks like the model name gpt-4-turbo isn't a valid model name (anymore? not sure if it ever was) which is the name SmartConnections is using.

Information about available models

I was able to get the chat with the change shown in the diff below (File is located in ${PATH_TO_VAULT}/.obsidian/plugins/smart-connections/main.js on MacOS)

diff --git a/main.js b/main.js
index 0398f15..7e91959 100644
--- a/main.js
+++ b/main.js
@@ -5375,7 +5375,7 @@ var require_models2 = __commonJS({
         streaming: true
       },
       "openai-gpt-4-turbo": {
-        model_name: "gpt-4-turbo",
+        model_name: "gpt-4-turbo-preview",
         description: "OpenAI's GPT-4 model",
         max_input_tokens: 128e3,
         type: "API",

Basically, fix the model_name: "gpt-4-turbo" line, restart obsidian, go back and set the chat model to GPT4 turbo again in Smart Connections settings (Possibly need to reload after this too). Once you do that, chat should go back to working for you.

As a side note to @brianpetro, OpenAI provides the GET /v1/models endpoint for getting a list of all available models, it may be worth using that as a source of truth for model names in the event they go off and change things.

@brianpetro
Copy link
Owner

@RickyGrassmuck @bbecausereasonss good catch.

I'll have that fixed shortly.

🌴

@bbecausereasonss
Copy link
Author

bbecausereasonss commented Mar 13, 2024 via email

@brianpetro
Copy link
Owner

@bbecausereasonss can you confirm that your using the Google AI studio API key? https://aistudio.google.com/app/prompts/new_chat/

@bbecausereasonss
Copy link
Author

bbecausereasonss commented Mar 13, 2024 via email

@brianpetro
Copy link
Owner

@bbecausereasonss thanks, I'll also give that a look shortly
🌴

@bbecausereasonss
Copy link
Author

For the record, getting API error on 3.5 openAI as well.

@brianpetro
Copy link
Owner

@bbecausereasonss the GPT-3.5 error should be fixed. It was token calculation-related.

The Google API key issue was likely caused by the test code. The test code is fixed, so it should return that the API key is valid.

The v2.1 beta version should automatically update to v2.1.4 next time you restart the plugin (enable/disable) or restart Obsidian.

🌴

@brianpetro
Copy link
Owner

@RickyGrassmuck thanks for narrowing down the issue. It's been fixed in v2.1.4.

And I made a note to auto-import the models from the API endpoint. Thanks for the 💡

🌴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants