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

Any chance we could get Claude.ai too? #66

Open
gobijan opened this issue Oct 24, 2024 · 9 comments
Open

Any chance we could get Claude.ai too? #66

gobijan opened this issue Oct 24, 2024 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@gobijan
Copy link

gobijan commented Oct 24, 2024

I slowly made the switch from OpenAI to Claude.ai as the Sonnet Model is super fast and top scorer in benchmarks. Are you planning on extending the providers to work with other non OpenAIish APIs?

@yaroslavyaroslav yaroslavyaroslav added the enhancement New feature or request label Oct 24, 2024
@yaroslavyaroslav
Copy link
Owner

Yeah, there's a problem with that.

Both claude and gemeni API require strict order of messages to be sent, like [user, assistant, user, assistant], which is not the case for openai API thus for this plugin. This is the main blocker to add support for them here, bc this plugin treats each text chunk as a separate message, so it's like [user, user, user, assistant].

In addition to that I'm pretty sure they have made functions support (coming pretty soon) they way as well.

So in overall it's kinda pretty complex adapter required to communicate with those, and I have no plans to implement it by my own for the time being.

@gobijan
Copy link
Author

gobijan commented Oct 24, 2024

Yeah totally get your point. It would be a lot of work.

Do you think that something like https://github.com/SilasMarvin/lsp-ai/ could be of any help?

@yaroslavyaroslav
Copy link
Owner

Thanks for sharing this, seems like a pretty cool stuff (the first gif), gonna dig it deeper in a while. But looking at a glance it doesn't fit with this plugin as it's in no way an lsp client.

Speaking about the solution, there is this #29 (comment) in a previous issue about support different services.

This thing fits better to the plugin, as it's python library that solves just that. Last time there were an issue of missing dependencies on package control side to use that, but it could be solved recently, as the main blocker - modern requests package - has been added recently to the dependency list. Which means this library could be added either and then used here instead of the current network layer implementation.

So if being optimistic it's not that much of work to be done here, if that library is available and if it manages messages ordering by its own. But honestly this is not in my priority list as I'm not using Claude nor haunted to use it anytime soon.

@yaroslavyaroslav yaroslavyaroslav added the good first issue Good for newcomers label Oct 24, 2024
@jalsco
Copy link

jalsco commented Dec 8, 2024

nice discussion - I also like the idea of Claude engine over the chatGPT one.
But understand that you have other priorities 😥

@yaroslavyaroslav
Copy link
Owner

Actually things got changed recently, especially after their introduction of MCP, so i'm about to add support of their API to this plugin. Not sure how soon though.

@yaroslavyaroslav yaroslavyaroslav pinned this issue Dec 8, 2024
@jalsco
Copy link

jalsco commented Dec 9, 2024

That is awesome ! Thank you 👍

I live in Philippines for most of each year, and from this location I have had problems add extra funds into Anthropic account, so no urgency from my side. In the meantime (today) I will be trying to use your plugin with Grok 2. I am expecting that to be quite straightforward as Grok's documentation says it can just use the OpenAI interface unchanged (just pointing it to Grok and supply the Grok API KEY ) . I hope that works and thank you so much for developing this 🙏🏻🙏🏻🙏🏻

About Grok - it is much cheaper - and is fast catching up to the others. It is still a long way behind ChatGPT and Claude for coding support BUT there is a massive upgrade to Grok3 scheduled for "December 2024" so it is possible it will catch up to the others within a few weeks. Maybe.... 🤷🏻‍♂️

@jalsco
Copy link

jalsco commented Dec 9, 2024

Well maybe not so easy to just run Grok via a plugin designed for OpenAI, not matter what X/Ai say ...

I got the plugin setup - and customized - clean as a whistle, no errors or messages (though my machine is on py 3.13 ). One issue is the super-k keystroke..... in my Windows10 that is taken by some system level "project to wireless display" service. So i changed it to super-o (mostly because o is near k ).

Anyway - I ctrl-shift-p and enter: OpenAI: Chat Model Select.
image

And I just (for now) want to run a a prompt thru to Grok and get a reply.... so show that it works.

So I select one of the "panel" ones.

It does drop me down to the areas to type in a question/prompt. Which I do ... and then it, sadly, it bombs out with some py errors.

ERROR:root:OpenAI error: The requested resource was not found. Please check the URL and try again. Documentation is available at https://docs.x.ai/
Traceback (most recent call last):
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_worker.py", line 301, in handle_response
    self.handle_chat_response()
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_worker.py", line 281, in handle_chat_response
    response: HTTPResponse | None = self.provider.execute_response()
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_network_client.py", line 114, in execute_response
    return self._execute_network_request()
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_network_client.py", line 134, in _execute_network_request
    raise UnknownException(error_data.get('error').get('message'))
OpenAI completion.plugins.errors.OpenAIException.UnknownException: The requested resource was not found. Please check the URL and try again. Documentation is available at https://docs.x.ai/
error: OpenAI error
The requested resource was not found. Please check the URL and try again. Documentation is available at https://docs.x.ai/
ERROR:root:OpenAI error: The requested resource was not found. Please check the URL and try again. Documentation is available at https://docs.x.ai/
Traceback (most recent call last):
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_worker.py", line 301, in handle_response
    self.handle_chat_response()
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_worker.py", line 281, in handle_chat_response
    response: HTTPResponse | None = self.provider.execute_response()
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_network_client.py", line 114, in execute_response
    return self._execute_network_request()
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_network_client.py", line 134, in _execute_network_request
    raise UnknownException(error_data.get('error').get('message'))
OpenAI completion.plugins.errors.OpenAIException.UnknownException: The requested resource was not found. Please check the URL and try again. Documentation is available at https://docs.x.ai/
error: OpenAI error
The requested resource was not found. Please check the URL and try again. Documentation is available at https://docs.x.ai/

@jalsco
Copy link

jalsco commented Dec 9, 2024

I tried a few things for those errors above.

To make it clearer - I restarted Sublime, and then tried ONLY ONE Example | panel | grok-beta , and gave it one easy prompt... something like "Please tell me about how Grok compares to the other more well-known LLMs ?" .

These are the errors from that single attempt:

Exception in thread Thread-41:
Traceback (most recent call last):
  File "./python3.8/threading.py", line 932, in _bootstrap_inner
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_worker.py", line 490, in run
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_worker.py", line 403, in manage_chat_completion
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_worker.py", line 301, in handle_response
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_worker.py", line 281, in handle_chat_response
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_network_client.py", line 114, in execute_response
  File "C:\Users\Sean\AppData\Roaming\Sublime Text 3\Installed Packages\OpenAI completion.sublime-package\plugins/openai_network_client.py", line 129, in _execute_network_request
AttributeError: 'str' object has no attribute 'get'

@yaroslavyaroslav
Copy link
Owner

@jalsco Text in first message seems to say that there's something wrong with the url you're trying to request. I suggest you to create a separate issue for that and profile the full plugin settings there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants