Comments (4)
Hey thanks for the suggestion this is a good idea.
To be honest I am not sure how these small models handle FIM for multiple languages in the same prompt, probably not well is my assumption.
It might be easier in the chat as we can have a drop down as you mention. In terms of detecting the current language from the editor, I am not sure what the best approach would be currently it might require more advanced techniques to establish it.
from twinny.
To be honest I am not sure how these small models handle FIM for multiple languages in the same prompt, probably not well is my assumption.
They aren't good with multiple languages in the same place but usually it's not required to have a lot of content outside the small area to get suggestions so usually it can adapt to the situation because (mostly) all it will see is that singular embedded language's code (E.g. javascript in an HTML document) or it's so small the help isn't useful.
It might be easier in the chat as we can have a drop down as you mention.
Yep. That's what I recommend too. Maybe with some kinks to make it fast to swap out, for example, fast tabbing or a shortcut only available in that window to open the dropdown.
For now, I'd just have a hardcoded list of languages for each defined language and accept PRs to make them more complete. For example, for PHP:
- PHP
- HTML
- Javascript
- CSS
The order is designed to make the most likely language to encounter in each language mode. In PHP, PHP should be the most common. Followed by HTML (because JS and CSS, most likely will be in external files). Then I went with js just because non-AI has gotten really good with CSS, so js is most likely to be asked about.
For other file types, for example, HTML, would be the 2,3,4 of the previous list.
A very different example: jinja2. Would probably get the same set as PHP except the 1st one is jinja2 or just straight up move the jinja2 to 2nd and select HTML 1st instead (Maybe leave the jinja2 help to the non-AI... Not sure. Dunno how good the AI is with jinja2).
There's a lot that would be correct so I'd start with some languages that are "multi-language" and hardcode possibilities for the drop down. After ppl start using this more, maybe someone will have good ideas how to proceed to viably please people.
For automatic detection... I'd probably start with half-arsed regex or similar to figure out some identifiers but I wouldn't try yet. It's full of issues and annoying (to the user) edge-cases that are not worthwhile yet.
For implementation, I'd just have a very simple translation table (can be a js object) from a name and an array of options for the drop box. If not defined in the translation table, just use the language provided.
For now, I'd be happy with:
- PHP
- HTML
- jinja-py
There might be more and ppl with other embeds but this should work fine for now.
What do you think?
from twinny.
I'm unable to find viable alternatives.
You could make your own buttons for each language being hardcoded. Explain JS
, Explain HTML
and enable/disable the ones you do not want at that specific moment so it's not clutering the buttons too much. And you use these dedicated buttons to request explanation from whitin that given language instead of having one generic button like now:
{{{systemMessage}}}
Explain the following code;
{{{code}}}
Do not waffle on. The language is:
{{language}}
from twinny.
stale
from twinny.
Related Issues (20)
- TypeError while attempting to use FIM from remote Open WebUI server HOT 4
- Wrong language: getting python suggestions in Javascript file HOT 1
- Unable to select model when using Ollama HOT 3
- command 'twinny.showSidebar' not found HOT 1
- Change shortcuts for suggestions HOT 2
- Improve documentation for FIM HOT 2
- How to configure proxy? HOT 1
- Incomplete Code Autocompletion and Non-Responsive Chat UI in Twinny Extension HOT 5
- feat: open new chat window in new editor tab HOT 1
- Edit and re-submit in chat mode HOT 4
- Robot icon keeps spinning, no inference HOT 1
- Code completion not working HOT 7
- Code completion works, but chat just spins the progress circle indefinitely HOT 2
- Configured providers but twinny not sending any requests to provider. HOT 3
- Multiline completion is confusing HOT 1
- Code snippets in the chat window loose syntax highlighting occasionally
- FIM doesn't work with Keep Alive = -1 HOT 1
- Cannot read long model names when configuring provider
- Option to save provider configuration to disk
- invalid option provided option=""
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twinny.