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

Setting the endpoint parameter breaks the extension. #4

Open
lukolszewski opened this issue Jan 2, 2024 · 2 comments
Open

Setting the endpoint parameter breaks the extension. #4

lukolszewski opened this issue Jan 2, 2024 · 2 comments

Comments

@lukolszewski
Copy link

lukolszewski commented Jan 2, 2024

If the endpoint parameter is set to anything including OpenAI's current endpoint" https://api.openai.com/v1/chat/completions" The extension fails to work. It doesn't even attempt to talk to the address provided, just errors with:

Error: Error accessing OpenAI. The "Update OpenAPI Api Key" command may help you.
undefined
	at [/home/luk/.vscode/extensions/jaaxxx.llm-book-0.1.1/dist/extension.js:1:4704](https://file+.vscode-resource.vscode-cdn.net/home/luk/.vscode/extensions/jaaxxx.llm-book-0.1.1/dist/extension.js:1:4704)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async Object.<anonymous> (/home/luk/.vscode/extensions/jaaxxx.llm-book-0.1.1/dist/extension.js:1:2494)
	at async n.$executeCells (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:96089)

I know this is not an API key issue as when I delete the endpoint it works fine. This also prevents use of any local OpenAI api endpoints.

I don't know why would it fail as the code seems to set the endpoint to the same value, but it fails nevertheless.Screenshot attached.
Screenshot from 2024-01-02 15-54-11

For some reason chaning the parameter in the settings GUI works fine, but using the Configure LLM button and inputting wia the command box results with the error above.

Furthermore, if it was possible to set this (as well as other settings and parameters) on a per document basis that would be great.

@JacksonKearl
Copy link
Owner

The Configure LLM menu is for adjusting the fields included in the body of the request. I see the PR you raised.. including a settings field in the top-level .llm.json format is a possibility.

@JacksonKearl
Copy link
Owner

Pushed a new version which fixes the error message not being properly preserved.

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

2 participants