efugier / smartcat

Putting a brain behind `cat`🐈‍⬛ Integrating language models in the Unix commands ecosystem through text streams.
https://crates.io/crates/smartcat
Apache License 2.0
77 stars 9 forks source link

Copilot Support? #7

Closed leeola closed 8 months ago

leeola commented 8 months ago

Is Github Copilot supported on Smartcat? It seems like not, but this project is tagged with Copilot.

edit: I should add, i am aware Copilot and GPT4 share a lot of functionality, but i was hoping to use my Copilot subscription.

efugier commented 8 months ago

Hey sorry it's not supported as of now. It may be in the somewhat near future.

The main blocker is that copilot's API is not public. I could take inspiration from project like https://github.com/github/copilot.vim but this is more work for an API that has no guarantee to be stable.

However, I have to say chatgpt's api is very cheap for individual usage. It's pay as you go and for a month it totaled to 1.75$ for me with heavy usage and the latest model: https://openai.com/pricing.

I'm also working on integrating with Mistral.

leeola commented 8 months ago

Shouldn't Copilot be removed from this repos tags then? I'm not sure what this repo has to do with Copilot?

efugier commented 8 months ago

It's there because I use it as a copilot (lower-case C). Smartcat is usable within the editor if yours plays nice with text streams :slightly_smiling_face: (e.g. Vim, Kakoune, Helix...).

leeola commented 8 months ago

ah okay lol, kinda confusing imo - but Github took a basic word :shrug:

efugier commented 8 months ago

Yes ahah, I actually started this project because copilot was not available for the editor I use (helix), and in my current workflow it kinda holds the same role!

leeola commented 8 months ago

Out of curiosity, would you be interested in generalizing the underlying communication, if support for Copilot was added?

efugier commented 8 months ago

I'm not sure what you mean by that 🤔

leeola commented 8 months ago

Hah, think i was short on coffee and missed a word. Generalizing the underlying LLM APIs (in this case, generalizing OpenAPI IO), if it isn't already, as to allow for alternate impls of LLMs/etc.

Might be some overlapping space with other similar libraries, too. Eg core libs of llmvm /etc generalize this i believe?

efugier commented 8 months ago

Smartcat is supposed to remain a minimal tool compliant with the unix philosophy. It's pretty unlikely for the project to get abstracted and separated in several lib. However, it's built with the requirement of supporting multiple llm providers in mind.

For now, the only other supported provider is Mistral AI.

As it is almost the same schema as openai additional code was requiered but basically there's kind of an adapter pattern from the generic prompt schema of smartcat to the target API for the call.

Implementing new ones should be super fast if the API is well documented :slightly_smiling_face: