From 94ab3dbbb6847da15f6feb676f2fea1acd7da60c Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sat, 4 Nov 2023 11:43:13 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20vscode=20context=20menus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/webview/assets/index.js | 4 +- extensions/vscode/gui/assets/index.js | 4 +- extensions/vscode/package.json | 61 ++++++++++++++++++- extensions/vscode/src/commands.ts | 40 ++++++++++++ gui/src/components/ComboBox.tsx | 2 +- 5 files changed, 104 insertions(+), 7 deletions(-) diff --git a/extensions/intellij/src/main/resources/webview/assets/index.js b/extensions/intellij/src/main/resources/webview/assets/index.js index 33c85d4ac..ca635cbb1 100644 --- a/extensions/intellij/src/main/resources/webview/assets/index.js +++ b/extensions/intellij/src/main/resources/webview/assets/index.js @@ -598,7 +598,7 @@ ${e.item.content} right: 12px; background-color: ${Wt}; border-radius: ${It}; - z-index: 100; + z-index: 50; `,Fhe=ze.div` position: absolute; right: 0px; @@ -1200,7 +1200,7 @@ __p += '`),zt&&(ke+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+ke+`return __p -}`;var wt=gA(function(){return Jt(F,lt+"return "+ke).apply(n,G)});if(wt.source=ke,V5(wt))throw wt;return wt}function PV(l){return en(l).toLowerCase()}function BV(l){return en(l).toUpperCase()}function UV(l,d,h){if(l=en(l),l&&(h||d===n))return wS(l);if(!l||!(d=ki(d)))return l;var _=ka(l),k=ka(d),F=AS(_,k),G=xS(_,k)+1;return Is(_,F,G).join("")}function $V(l,d,h){if(l=en(l),l&&(h||d===n))return l.slice(0,kS(l)+1);if(!l||!(d=ki(d)))return l;var _=ka(l),k=xS(_,ka(d))+1;return Is(_,0,k).join("")}function zV(l,d,h){if(l=en(l),l&&(h||d===n))return l.replace(Or,"");if(!l||!(d=ki(d)))return l;var _=ka(l),k=AS(_,ka(d));return Is(_,k).join("")}function HV(l,d){var h=P,_=Q;if(Rn(d)){var k="separator"in d?d.separator:k;h="length"in d?St(d.length):h,_="omission"in d?ki(d.omission):_}l=en(l);var F=l.length;if($u(l)){var G=ka(l);F=G.length}if(h>=F)return l;var Z=h-zu(_);if(Z<1)return _;var ie=G?Is(G,0,Z).join(""):l.slice(0,Z);if(k===n)return ie+_;if(G&&(Z+=ie.length-Z),W5(k)){if(l.slice(Z).search(k)){var we,xe=ie;for(k.global||(k=l5(k.source,en(We.exec(k))+"g")),k.lastIndex=0;we=k.exec(xe);)var ke=we.index;ie=ie.slice(0,ke===n?Z:ke)}}else if(l.indexOf(ki(k),Z)!=Z){var Ye=ie.lastIndexOf(k);Ye>-1&&(ie=ie.slice(0,Ye))}return ie+_}function jV(l){return l=en(l),l&&Rt.test(l)?l.replace(Je,y$):l}var GV=Ku(function(l,d,h){return l+(h?" ":"")+d.toUpperCase()}),Y5=mw("toUpperCase");function hA(l,d,h){return l=en(l),d=h?n:d,d===n?f$(l)?_$(l):i$(l):l.match(d)||[]}var gA=kt(function(l,d){try{return xi(l,n,d)}catch(h){return V5(h)?h:new _t(h)}}),VV=Po(function(l,d){return Zi(d,function(h){h=ao(h),Mo(l,h,j5(l[h],l))}),l});function WV(l){var d=l==null?0:l.length,h=mt();return l=d?An(l,function(_){if(typeof _[1]!="function")throw new Qi(o);return[h(_[0]),_[1]]}):[],kt(function(_){for(var k=-1;++kW)return[];var h=fe,_=Mr(l,fe);d=mt(d),l-=fe;for(var k=a5(_,d);++h0||d<0)?new Ft(h):(l<0?h=h.takeRight(-l):l&&(h=h.drop(l)),d!==n&&(d=St(d),h=d<0?h.dropRight(-d):h.take(d-l)),h)},Ft.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ft.prototype.toArray=function(){return this.take(fe)},ro(Ft.prototype,function(l,d){var h=/^(?:filter|find|map|reject)|While$/.test(d),_=/^(?:head|last)$/.test(d),k=M[_?"take"+(d=="last"?"Right":""):d],F=_||/^find/.test(d);k&&(M.prototype[d]=function(){var G=this.__wrapped__,Z=_?[1]:arguments,ie=G instanceof Ft,we=Z[0],xe=ie||Tt(G),ke=function(Nt){var zt=k.apply(M,Ss([Nt],Z));return _&&Ye?zt[0]:zt};xe&&h&&typeof we=="function"&&we.length!=1&&(ie=xe=!1);var Ye=this.__chain__,lt=!!this.__actions__.length,bt=F&&!Ye,wt=ie&&!lt;if(!F&&xe){G=wt?G:new Ft(this);var yt=l.apply(G,Z);return yt.__actions__.push({func:t0,args:[ke],thisArg:n}),new Ji(yt,Ye)}return bt&&wt?l.apply(this,Z):(yt=this.thru(ke),bt?_?yt.value()[0]:yt.value():yt)})}),Zi(["pop","push","shift","sort","splice","unshift"],function(l){var d=Cf[l],h=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",_=/^(?:pop|shift)$/.test(l);M.prototype[l]=function(){var k=arguments;if(_&&!this.__chain__){var F=this.value();return d.apply(Tt(F)?F:[],k)}return this[h](function(G){return d.apply(Tt(G)?G:[],k)})}}),ro(Ft.prototype,function(l,d){var h=M[d];if(h){var _=h.name+"";an.call(Vu,_)||(Vu[_]=[]),Vu[_].push({name:d,func:h})}}),Vu[Kf(n,E).name]=[{name:"wrapper",func:n}],Ft.prototype.clone=j$,Ft.prototype.reverse=G$,Ft.prototype.value=V$,M.prototype.at=vj,M.prototype.chain=_j,M.prototype.commit=Tj,M.prototype.next=Sj,M.prototype.plant=Aj,M.prototype.reverse=xj,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Cj,M.prototype.first=M.prototype.head,Oc&&(M.prototype[Oc]=wj),M},Hu=T$();Dl?((Dl.exports=Hu)._=Hu,Z2._=Hu):mr._=Hu}).call(eu)})(lm,lm.exports);var Z4e=lm.exports;const tl=Wi(Z4e);function uo(e,t){const n=tl.cloneDeep(e);for(const r in t)typeof t[r]=="function"?tl.updateWith(n,r,t[r]):tl.updateWith(n,r,i=>t[r]);return n}const Rc={};Rc["Requires API Key"]="#FF0000";Rc.Local="#00bb00";Rc["Open-Source"]="#0033FF";Rc.Free="#ffff00";const Q4e={inputType:"number",key:"context_length",label:"Context Length",defaultValue:2048,required:!1},J4e={inputType:"number",key:"temperature",label:"Temperature",defaultValue:void 0,required:!1,min:0,max:1,step:.01},ebe={inputType:"number",key:"top_p",label:"Top-P",defaultValue:void 0,required:!1,min:0,max:1,step:.01},tbe={inputType:"number",key:"top_k",label:"Top-K",defaultValue:void 0,required:!1,min:0,max:1,step:.01},nbe={inputType:"number",key:"presence_penalty",label:"Presence Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},rbe={inputType:"number",key:"frequency_penalty",label:"Frequency Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},Ma=[Q4e,J4e,tbe,ebe,nbe,rbe],Z4={inputType:"text",key:"server_url",label:"Server URL",placeholder:"e.g. http://localhost:8080",required:!1},lE={title:"CodeLlama Instruct",description:"A model from Meta, fine-tuned for code generation and conversation",refUrl:"",params:{title:"CodeLlama-7b-Instruct",model:"codellama:7b-instruct",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"codellama:7b-instruct",title:"CodeLlama-7b-Instruct"},"13b":{model:"codellama:13b-instruct",title:"CodeLlama-13b-Instruct"},"34b":{model:"codellama:34b-instruct",title:"CodeLlama-34b-Instruct"}}}]},uE={title:"Llama2 Chat",description:"The latest Llama model from Meta, fine-tuned for chat",refUrl:"",params:{title:"Llama2-7b-Chat",model:"llama2:7b-chat",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"llama2:7b-chat",title:"Llama2-7b-Chat"},"13b":{model:"llama2:13b-chat",title:"Llama2-13b-Chat"},"34b":{model:"llama2:34b-chat",title:"Llama2-34b-Chat"}}}]},cE={title:"WizardCoder",description:"A CodeLlama-based code generation model from WizardLM, focused on Python",refUrl:"",params:{title:"WizardCoder-7b-Python",model:"wizardcoder:7b-python",context_length:2048,template_messages:"template_alpaca_messages",prompt_templates:{edit:"alpaca_edit_prompt"}},icon:"wizardlm.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"wizardcoder:7b-python",title:"WizardCoder-7b-Python"},"13b":{model:"wizardcoder:13b-python",title:"WizardCoder-13b-Python"},"34b":{model:"wizardcoder:34b-python",title:"WizardCoder-34b-Python"}}}]},dU={title:"Phind CodeLlama (34b)",description:"A finetune of CodeLlama by Phind",params:{title:"Phind CodeLlama",model:"phind-codellama",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}}},dE={title:"Mistral (7b)",description:"A 7b parameter base model created by Mistral AI, very competent for code generation and other tasks",params:{title:"Mistral",model:"mistral",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},icon:"mistral.png"},pU={title:"SQLCoder",description:"A finetune of StarCoder by Defog.ai, focused specifically on SQL",params:{title:"SQLCoder",model:"sqlcoder",context_length:2048,template_messages:"sqlcoder_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"sqlcoder:7b",title:"SQLCoder-7b"},"13b":{model:"sqlcoder:15b",title:"SQLCoder-15b"}}}]},ibe={title:"CodeUp (13b)",description:"An open-source coding model based on Llama2",params:{title:"CodeUp",model:"codeup",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"alpaca_edit_prompt"}}},o1=[lE,uE,cE,dU,pU,dE,ibe],CN={title:"GPT-4",description:"The latest model from OpenAI",params:{model:"gpt-4",context_length:8096,api_key:"",title:"GPT-4"}},kN={title:"GPT-3.5-Turbo",description:"A faster, cheaper OpenAI model with slightly lower capabilities",params:{model:"gpt-3.5-turbo",context_length:8096,title:"GPT-3.5-Turbo",api_key:""}},abe={"codellama:7b-instruct":"meta/codellama-7b-instruct:6527b83e01e41412db37de5110a8670e3701ee95872697481a355e05ce12af0e","codellama:13b-instruct":"meta/codellama-13b-instruct:1f01a52ff933873dff339d5fb5e1fd6f24f77456836f514fa05e91c1a42699c7","codellama:34b-instruct":"meta/codellama-34b-instruct:8281a5c610f6e88237ff3ddaf3c33b56f60809e2bdd19fbec2fda742aa18167e","llama2:7b-chat":"meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e","llama2:13b-chat":"meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d"};function IN(e){return abe[e]||e}const fU={openai:{title:"OpenAI",class:"OpenAI",description:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model",longDescription:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",icon:"openai.png",tags:["Requires API Key"],packages:[CN,kN],collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your OpenAI API key",required:!0},...Ma]},anthropic:{title:"Anthropic",class:"AnthropicLLM",description:"Claude-2 is a highly capable model with a 100k context length",icon:"anthropic.png",tags:["Requires API Key"],longDescription:"To get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.",collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your Anthropic API key",required:!0},...Ma],packages:[{title:"Claude-2",description:"A highly capable model with a 100k context length",params:{model:"claude-2",context_length:1e5,title:"Claude-2"}}]},ollama:{title:"Ollama",class:"Ollama",description:"One of the fastest ways to get started with local models on Mac or Linux",longDescription:'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.',icon:"ollama.png",tags:["Local","Open-Source"],packages:o1,collectInputFor:[...Ma,Z4]},together:{title:"TogetherAI",class:"TogetherLLM",description:"Use the TogetherAI API for extremely fast streaming of open-source models",icon:"together.png",longDescription:`Together is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together: +}`;var wt=gA(function(){return Jt(F,lt+"return "+ke).apply(n,G)});if(wt.source=ke,V5(wt))throw wt;return wt}function PV(l){return en(l).toLowerCase()}function BV(l){return en(l).toUpperCase()}function UV(l,d,h){if(l=en(l),l&&(h||d===n))return wS(l);if(!l||!(d=ki(d)))return l;var _=ka(l),k=ka(d),F=AS(_,k),G=xS(_,k)+1;return Is(_,F,G).join("")}function $V(l,d,h){if(l=en(l),l&&(h||d===n))return l.slice(0,kS(l)+1);if(!l||!(d=ki(d)))return l;var _=ka(l),k=xS(_,ka(d))+1;return Is(_,0,k).join("")}function zV(l,d,h){if(l=en(l),l&&(h||d===n))return l.replace(Or,"");if(!l||!(d=ki(d)))return l;var _=ka(l),k=AS(_,ka(d));return Is(_,k).join("")}function HV(l,d){var h=P,_=Q;if(Rn(d)){var k="separator"in d?d.separator:k;h="length"in d?St(d.length):h,_="omission"in d?ki(d.omission):_}l=en(l);var F=l.length;if($u(l)){var G=ka(l);F=G.length}if(h>=F)return l;var Z=h-zu(_);if(Z<1)return _;var ie=G?Is(G,0,Z).join(""):l.slice(0,Z);if(k===n)return ie+_;if(G&&(Z+=ie.length-Z),W5(k)){if(l.slice(Z).search(k)){var we,xe=ie;for(k.global||(k=l5(k.source,en(We.exec(k))+"g")),k.lastIndex=0;we=k.exec(xe);)var ke=we.index;ie=ie.slice(0,ke===n?Z:ke)}}else if(l.indexOf(ki(k),Z)!=Z){var Ye=ie.lastIndexOf(k);Ye>-1&&(ie=ie.slice(0,Ye))}return ie+_}function jV(l){return l=en(l),l&&Rt.test(l)?l.replace(Je,y$):l}var GV=Ku(function(l,d,h){return l+(h?" ":"")+d.toUpperCase()}),Y5=mw("toUpperCase");function hA(l,d,h){return l=en(l),d=h?n:d,d===n?f$(l)?_$(l):i$(l):l.match(d)||[]}var gA=kt(function(l,d){try{return xi(l,n,d)}catch(h){return V5(h)?h:new _t(h)}}),VV=Po(function(l,d){return Zi(d,function(h){h=ao(h),Mo(l,h,j5(l[h],l))}),l});function WV(l){var d=l==null?0:l.length,h=mt();return l=d?An(l,function(_){if(typeof _[1]!="function")throw new Qi(o);return[h(_[0]),_[1]]}):[],kt(function(_){for(var k=-1;++kW)return[];var h=fe,_=Mr(l,fe);d=mt(d),l-=fe;for(var k=a5(_,d);++h0||d<0)?new Ft(h):(l<0?h=h.takeRight(-l):l&&(h=h.drop(l)),d!==n&&(d=St(d),h=d<0?h.dropRight(-d):h.take(d-l)),h)},Ft.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ft.prototype.toArray=function(){return this.take(fe)},ro(Ft.prototype,function(l,d){var h=/^(?:filter|find|map|reject)|While$/.test(d),_=/^(?:head|last)$/.test(d),k=M[_?"take"+(d=="last"?"Right":""):d],F=_||/^find/.test(d);k&&(M.prototype[d]=function(){var G=this.__wrapped__,Z=_?[1]:arguments,ie=G instanceof Ft,we=Z[0],xe=ie||Tt(G),ke=function(Nt){var zt=k.apply(M,Ss([Nt],Z));return _&&Ye?zt[0]:zt};xe&&h&&typeof we=="function"&&we.length!=1&&(ie=xe=!1);var Ye=this.__chain__,lt=!!this.__actions__.length,bt=F&&!Ye,wt=ie&&!lt;if(!F&&xe){G=wt?G:new Ft(this);var yt=l.apply(G,Z);return yt.__actions__.push({func:t0,args:[ke],thisArg:n}),new Ji(yt,Ye)}return bt&&wt?l.apply(this,Z):(yt=this.thru(ke),bt?_?yt.value()[0]:yt.value():yt)})}),Zi(["pop","push","shift","sort","splice","unshift"],function(l){var d=Cf[l],h=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",_=/^(?:pop|shift)$/.test(l);M.prototype[l]=function(){var k=arguments;if(_&&!this.__chain__){var F=this.value();return d.apply(Tt(F)?F:[],k)}return this[h](function(G){return d.apply(Tt(G)?G:[],k)})}}),ro(Ft.prototype,function(l,d){var h=M[d];if(h){var _=h.name+"";an.call(Vu,_)||(Vu[_]=[]),Vu[_].push({name:d,func:h})}}),Vu[Kf(n,E).name]=[{name:"wrapper",func:n}],Ft.prototype.clone=j$,Ft.prototype.reverse=G$,Ft.prototype.value=V$,M.prototype.at=vj,M.prototype.chain=_j,M.prototype.commit=Tj,M.prototype.next=Sj,M.prototype.plant=Aj,M.prototype.reverse=xj,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Cj,M.prototype.first=M.prototype.head,Oc&&(M.prototype[Oc]=wj),M},Hu=T$();Dl?((Dl.exports=Hu)._=Hu,Z2._=Hu):mr._=Hu}).call(eu)})(lm,lm.exports);var Z4e=lm.exports;const tl=Wi(Z4e);function uo(e,t){const n=tl.cloneDeep(e);for(const r in t)typeof t[r]=="function"?tl.updateWith(n,r,t[r]):tl.updateWith(n,r,i=>t[r]);return n}const Rc={};Rc["Requires API Key"]="#FF0000";Rc.Local="#00bb00";Rc["Open-Source"]="#0033FF";Rc.Free="#ffff00";const Q4e={inputType:"number",key:"context_length",label:"Context Length",defaultValue:2048,required:!1},J4e={inputType:"number",key:"temperature",label:"Temperature",defaultValue:void 0,required:!1,min:0,max:1,step:.01},ebe={inputType:"number",key:"top_p",label:"Top-P",defaultValue:void 0,required:!1,min:0,max:1,step:.01},tbe={inputType:"number",key:"top_k",label:"Top-K",defaultValue:void 0,required:!1,min:0,max:1,step:.01},nbe={inputType:"number",key:"presence_penalty",label:"Presence Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},rbe={inputType:"number",key:"frequency_penalty",label:"Frequency Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},Ma=[Q4e,J4e,tbe,ebe,nbe,rbe],Z4={inputType:"text",key:"server_url",label:"Server URL",placeholder:"e.g. http://localhost:8080",required:!1},lE={title:"CodeLlama Instruct",description:"A model from Meta, fine-tuned for code generation and conversation",refUrl:"",params:{title:"CodeLlama-7b-Instruct",model:"codellama:7b-instruct",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"codellama:7b-instruct",title:"CodeLlama-7b-Instruct"},"13b":{model:"codellama:13b-instruct",title:"CodeLlama-13b-Instruct"},"34b":{model:"codellama:34b-instruct",title:"CodeLlama-34b-Instruct"}}}]},uE={title:"Llama2 Chat",description:"The latest Llama model from Meta, fine-tuned for chat",refUrl:"",params:{title:"Llama2-7b-Chat",model:"llama2:7b-chat",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"llama2:7b-chat",title:"Llama2-7b-Chat"},"13b":{model:"llama2:13b-chat",title:"Llama2-13b-Chat"},"34b":{model:"llama2:34b-chat",title:"Llama2-34b-Chat"}}}]},cE={title:"WizardCoder",description:"A CodeLlama-based code generation model from WizardLM, focused on Python",refUrl:"",params:{title:"WizardCoder-7b-Python",model:"wizardcoder:7b-python",context_length:2048,template_messages:"template_alpaca_messages",prompt_templates:{edit:"alpaca_edit_prompt"}},icon:"wizardlm.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"wizardcoder:7b-python",title:"WizardCoder-7b-Python"},"13b":{model:"wizardcoder:13b-python",title:"WizardCoder-13b-Python"},"34b":{model:"wizardcoder:34b-python",title:"WizardCoder-34b-Python"}}}]},dU={title:"Phind CodeLlama (34b)",description:"A finetune of CodeLlama by Phind",params:{title:"Phind CodeLlama",model:"phind-codellama",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}}},dE={title:"Mistral (7b)",description:"A 7b parameter base model created by Mistral AI, very competent for code generation and other tasks",params:{title:"Mistral",model:"mistral",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},icon:"mistral.png"},pU={title:"SQLCoder",description:"A finetune of StarCoder by Defog.ai, focused specifically on SQL",params:{title:"SQLCoder",model:"sqlcoder",context_length:2048,template_messages:"sqlcoder_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"sqlcoder:7b",title:"SQLCoder-7b"},"13b":{model:"sqlcoder:15b",title:"SQLCoder-15b"}}}]},ibe={title:"CodeUp (13b)",description:"An open-source coding model based on Llama2",params:{title:"CodeUp",model:"codeup",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"alpaca_edit_prompt"}}},o1=[lE,uE,cE,dU,pU,dE,ibe],CN={title:"GPT-4",description:"The latest model from OpenAI",params:{model:"gpt-4",context_length:8096,api_key:"",title:"GPT-4"}},kN={title:"GPT-3.5-Turbo",description:"A faster, cheaper OpenAI model with slightly lower capabilities",params:{model:"gpt-3.5-turbo",context_length:8096,title:"GPT-3.5-Turbo",api_key:""}},abe={"codellama:7b-instruct":"meta/codellama-7b-instruct:6527b83e01e41412db37de5110a8670e3701ee95872697481a355e05ce12af0e","codellama:13b-instruct":"meta/codellama-13b-instruct:1f01a52ff933873dff339d5fb5e1fd6f24f77456836f514fa05e91c1a42699c7","codellama:34b-instruct":"meta/codellama-34b-instruct:8281a5c610f6e88237ff3ddaf3c33b56f60809e2bdd19fbec2fda742aa18167e","llama2:7b-chat":"meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e","llama2:13b-chat":"meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d"};function IN(e){return abe[e]||e}const fU={openai:{title:"OpenAI",class:"OpenAI",description:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model",longDescription:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",icon:"openai.png",tags:["Requires API Key"],packages:[CN,kN],collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your OpenAI API key",required:!0},...Ma]},anthropic:{title:"Anthropic",class:"AnthropicLLM",description:"Claude-2 is a highly capable model with a 100k context length",icon:"anthropic.png",tags:["Requires API Key"],longDescription:"To get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.",collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your Anthropic API key",required:!0},...Ma],packages:[{title:"Claude-2",description:"A highly capable model with a 100k context length",params:{model:"claude-2",context_length:1e5,title:"Claude-2"}}]},ollama:{title:"Ollama",class:"Ollama",description:"One of the fastest ways to get started with local models on Mac or Linux",longDescription:'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.',icon:"ollama.png",tags:["Local","Open-Source"],packages:o1,collectInputFor:[...Ma,{...Z4,defaultValue:"http://localhost:11434"}]},together:{title:"TogetherAI",class:"TogetherLLM",description:"Use the TogetherAI API for extremely fast streaming of open-source models",icon:"together.png",longDescription:`Together is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together: 1. Obtain an API key from [here](https://together.ai) 2. Paste below 3. Select a model preset`,tags:["Requires API Key","Open-Source"],params:{api_key:""},collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your TogetherAI API key",required:!0},...Ma],packages:[uo(uE,{"dimensions[0].options":e=>tl.mapValues(e,t=>tl.assign({},t,{model:"togethercomputer/"+t.model.replace("llama2","llama-2").replace(":","-")}))}),uo(lE,{"dimensions[0].options":e=>tl.mapValues(e,t=>tl.assign({},t,{model:"togethercomputer/"+t.model.replace("codellama","CodeLlama").replace(":","-").replace("instruct","Instruct")}))}),uo(cE,{"params.model":"WizardLM/WizardCoder-15B-V1.0","params.title":"WizardCoder-15b","dimensions[0].options":{"15b":{model:"WizardLM/WizardCoder-15B-V1.0",title:"WizardCoder-15b"},"34b (Python)":{model:"WizardLM/WizardCoder-Python-34B-V1.0",title:"WizardCoder-34b-Python"}}}),uo(dU,{"params.model":"Phind/Phind-CodeLlama-34B-Python-v1"}),uo(dE,{"params.model":"mistralai/Mistral-7B-Instruct-v0.1"})].map(e=>(e.params.context_length=4096,e))},lmstudio:{title:"LM Studio",class:"GGML",description:"One of the fastest ways to get started with local models on Mac or Windows",longDescription:`LMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started: diff --git a/extensions/vscode/gui/assets/index.js b/extensions/vscode/gui/assets/index.js index 33c85d4ac..ca635cbb1 100644 --- a/extensions/vscode/gui/assets/index.js +++ b/extensions/vscode/gui/assets/index.js @@ -598,7 +598,7 @@ ${e.item.content} right: 12px; background-color: ${Wt}; border-radius: ${It}; - z-index: 100; + z-index: 50; `,Fhe=ze.div` position: absolute; right: 0px; @@ -1200,7 +1200,7 @@ __p += '`),zt&&(ke+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+ke+`return __p -}`;var wt=gA(function(){return Jt(F,lt+"return "+ke).apply(n,G)});if(wt.source=ke,V5(wt))throw wt;return wt}function PV(l){return en(l).toLowerCase()}function BV(l){return en(l).toUpperCase()}function UV(l,d,h){if(l=en(l),l&&(h||d===n))return wS(l);if(!l||!(d=ki(d)))return l;var _=ka(l),k=ka(d),F=AS(_,k),G=xS(_,k)+1;return Is(_,F,G).join("")}function $V(l,d,h){if(l=en(l),l&&(h||d===n))return l.slice(0,kS(l)+1);if(!l||!(d=ki(d)))return l;var _=ka(l),k=xS(_,ka(d))+1;return Is(_,0,k).join("")}function zV(l,d,h){if(l=en(l),l&&(h||d===n))return l.replace(Or,"");if(!l||!(d=ki(d)))return l;var _=ka(l),k=AS(_,ka(d));return Is(_,k).join("")}function HV(l,d){var h=P,_=Q;if(Rn(d)){var k="separator"in d?d.separator:k;h="length"in d?St(d.length):h,_="omission"in d?ki(d.omission):_}l=en(l);var F=l.length;if($u(l)){var G=ka(l);F=G.length}if(h>=F)return l;var Z=h-zu(_);if(Z<1)return _;var ie=G?Is(G,0,Z).join(""):l.slice(0,Z);if(k===n)return ie+_;if(G&&(Z+=ie.length-Z),W5(k)){if(l.slice(Z).search(k)){var we,xe=ie;for(k.global||(k=l5(k.source,en(We.exec(k))+"g")),k.lastIndex=0;we=k.exec(xe);)var ke=we.index;ie=ie.slice(0,ke===n?Z:ke)}}else if(l.indexOf(ki(k),Z)!=Z){var Ye=ie.lastIndexOf(k);Ye>-1&&(ie=ie.slice(0,Ye))}return ie+_}function jV(l){return l=en(l),l&&Rt.test(l)?l.replace(Je,y$):l}var GV=Ku(function(l,d,h){return l+(h?" ":"")+d.toUpperCase()}),Y5=mw("toUpperCase");function hA(l,d,h){return l=en(l),d=h?n:d,d===n?f$(l)?_$(l):i$(l):l.match(d)||[]}var gA=kt(function(l,d){try{return xi(l,n,d)}catch(h){return V5(h)?h:new _t(h)}}),VV=Po(function(l,d){return Zi(d,function(h){h=ao(h),Mo(l,h,j5(l[h],l))}),l});function WV(l){var d=l==null?0:l.length,h=mt();return l=d?An(l,function(_){if(typeof _[1]!="function")throw new Qi(o);return[h(_[0]),_[1]]}):[],kt(function(_){for(var k=-1;++kW)return[];var h=fe,_=Mr(l,fe);d=mt(d),l-=fe;for(var k=a5(_,d);++h0||d<0)?new Ft(h):(l<0?h=h.takeRight(-l):l&&(h=h.drop(l)),d!==n&&(d=St(d),h=d<0?h.dropRight(-d):h.take(d-l)),h)},Ft.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ft.prototype.toArray=function(){return this.take(fe)},ro(Ft.prototype,function(l,d){var h=/^(?:filter|find|map|reject)|While$/.test(d),_=/^(?:head|last)$/.test(d),k=M[_?"take"+(d=="last"?"Right":""):d],F=_||/^find/.test(d);k&&(M.prototype[d]=function(){var G=this.__wrapped__,Z=_?[1]:arguments,ie=G instanceof Ft,we=Z[0],xe=ie||Tt(G),ke=function(Nt){var zt=k.apply(M,Ss([Nt],Z));return _&&Ye?zt[0]:zt};xe&&h&&typeof we=="function"&&we.length!=1&&(ie=xe=!1);var Ye=this.__chain__,lt=!!this.__actions__.length,bt=F&&!Ye,wt=ie&&!lt;if(!F&&xe){G=wt?G:new Ft(this);var yt=l.apply(G,Z);return yt.__actions__.push({func:t0,args:[ke],thisArg:n}),new Ji(yt,Ye)}return bt&&wt?l.apply(this,Z):(yt=this.thru(ke),bt?_?yt.value()[0]:yt.value():yt)})}),Zi(["pop","push","shift","sort","splice","unshift"],function(l){var d=Cf[l],h=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",_=/^(?:pop|shift)$/.test(l);M.prototype[l]=function(){var k=arguments;if(_&&!this.__chain__){var F=this.value();return d.apply(Tt(F)?F:[],k)}return this[h](function(G){return d.apply(Tt(G)?G:[],k)})}}),ro(Ft.prototype,function(l,d){var h=M[d];if(h){var _=h.name+"";an.call(Vu,_)||(Vu[_]=[]),Vu[_].push({name:d,func:h})}}),Vu[Kf(n,E).name]=[{name:"wrapper",func:n}],Ft.prototype.clone=j$,Ft.prototype.reverse=G$,Ft.prototype.value=V$,M.prototype.at=vj,M.prototype.chain=_j,M.prototype.commit=Tj,M.prototype.next=Sj,M.prototype.plant=Aj,M.prototype.reverse=xj,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Cj,M.prototype.first=M.prototype.head,Oc&&(M.prototype[Oc]=wj),M},Hu=T$();Dl?((Dl.exports=Hu)._=Hu,Z2._=Hu):mr._=Hu}).call(eu)})(lm,lm.exports);var Z4e=lm.exports;const tl=Wi(Z4e);function uo(e,t){const n=tl.cloneDeep(e);for(const r in t)typeof t[r]=="function"?tl.updateWith(n,r,t[r]):tl.updateWith(n,r,i=>t[r]);return n}const Rc={};Rc["Requires API Key"]="#FF0000";Rc.Local="#00bb00";Rc["Open-Source"]="#0033FF";Rc.Free="#ffff00";const Q4e={inputType:"number",key:"context_length",label:"Context Length",defaultValue:2048,required:!1},J4e={inputType:"number",key:"temperature",label:"Temperature",defaultValue:void 0,required:!1,min:0,max:1,step:.01},ebe={inputType:"number",key:"top_p",label:"Top-P",defaultValue:void 0,required:!1,min:0,max:1,step:.01},tbe={inputType:"number",key:"top_k",label:"Top-K",defaultValue:void 0,required:!1,min:0,max:1,step:.01},nbe={inputType:"number",key:"presence_penalty",label:"Presence Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},rbe={inputType:"number",key:"frequency_penalty",label:"Frequency Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},Ma=[Q4e,J4e,tbe,ebe,nbe,rbe],Z4={inputType:"text",key:"server_url",label:"Server URL",placeholder:"e.g. http://localhost:8080",required:!1},lE={title:"CodeLlama Instruct",description:"A model from Meta, fine-tuned for code generation and conversation",refUrl:"",params:{title:"CodeLlama-7b-Instruct",model:"codellama:7b-instruct",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"codellama:7b-instruct",title:"CodeLlama-7b-Instruct"},"13b":{model:"codellama:13b-instruct",title:"CodeLlama-13b-Instruct"},"34b":{model:"codellama:34b-instruct",title:"CodeLlama-34b-Instruct"}}}]},uE={title:"Llama2 Chat",description:"The latest Llama model from Meta, fine-tuned for chat",refUrl:"",params:{title:"Llama2-7b-Chat",model:"llama2:7b-chat",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"llama2:7b-chat",title:"Llama2-7b-Chat"},"13b":{model:"llama2:13b-chat",title:"Llama2-13b-Chat"},"34b":{model:"llama2:34b-chat",title:"Llama2-34b-Chat"}}}]},cE={title:"WizardCoder",description:"A CodeLlama-based code generation model from WizardLM, focused on Python",refUrl:"",params:{title:"WizardCoder-7b-Python",model:"wizardcoder:7b-python",context_length:2048,template_messages:"template_alpaca_messages",prompt_templates:{edit:"alpaca_edit_prompt"}},icon:"wizardlm.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"wizardcoder:7b-python",title:"WizardCoder-7b-Python"},"13b":{model:"wizardcoder:13b-python",title:"WizardCoder-13b-Python"},"34b":{model:"wizardcoder:34b-python",title:"WizardCoder-34b-Python"}}}]},dU={title:"Phind CodeLlama (34b)",description:"A finetune of CodeLlama by Phind",params:{title:"Phind CodeLlama",model:"phind-codellama",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}}},dE={title:"Mistral (7b)",description:"A 7b parameter base model created by Mistral AI, very competent for code generation and other tasks",params:{title:"Mistral",model:"mistral",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},icon:"mistral.png"},pU={title:"SQLCoder",description:"A finetune of StarCoder by Defog.ai, focused specifically on SQL",params:{title:"SQLCoder",model:"sqlcoder",context_length:2048,template_messages:"sqlcoder_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"sqlcoder:7b",title:"SQLCoder-7b"},"13b":{model:"sqlcoder:15b",title:"SQLCoder-15b"}}}]},ibe={title:"CodeUp (13b)",description:"An open-source coding model based on Llama2",params:{title:"CodeUp",model:"codeup",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"alpaca_edit_prompt"}}},o1=[lE,uE,cE,dU,pU,dE,ibe],CN={title:"GPT-4",description:"The latest model from OpenAI",params:{model:"gpt-4",context_length:8096,api_key:"",title:"GPT-4"}},kN={title:"GPT-3.5-Turbo",description:"A faster, cheaper OpenAI model with slightly lower capabilities",params:{model:"gpt-3.5-turbo",context_length:8096,title:"GPT-3.5-Turbo",api_key:""}},abe={"codellama:7b-instruct":"meta/codellama-7b-instruct:6527b83e01e41412db37de5110a8670e3701ee95872697481a355e05ce12af0e","codellama:13b-instruct":"meta/codellama-13b-instruct:1f01a52ff933873dff339d5fb5e1fd6f24f77456836f514fa05e91c1a42699c7","codellama:34b-instruct":"meta/codellama-34b-instruct:8281a5c610f6e88237ff3ddaf3c33b56f60809e2bdd19fbec2fda742aa18167e","llama2:7b-chat":"meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e","llama2:13b-chat":"meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d"};function IN(e){return abe[e]||e}const fU={openai:{title:"OpenAI",class:"OpenAI",description:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model",longDescription:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",icon:"openai.png",tags:["Requires API Key"],packages:[CN,kN],collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your OpenAI API key",required:!0},...Ma]},anthropic:{title:"Anthropic",class:"AnthropicLLM",description:"Claude-2 is a highly capable model with a 100k context length",icon:"anthropic.png",tags:["Requires API Key"],longDescription:"To get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.",collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your Anthropic API key",required:!0},...Ma],packages:[{title:"Claude-2",description:"A highly capable model with a 100k context length",params:{model:"claude-2",context_length:1e5,title:"Claude-2"}}]},ollama:{title:"Ollama",class:"Ollama",description:"One of the fastest ways to get started with local models on Mac or Linux",longDescription:'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.',icon:"ollama.png",tags:["Local","Open-Source"],packages:o1,collectInputFor:[...Ma,Z4]},together:{title:"TogetherAI",class:"TogetherLLM",description:"Use the TogetherAI API for extremely fast streaming of open-source models",icon:"together.png",longDescription:`Together is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together: +}`;var wt=gA(function(){return Jt(F,lt+"return "+ke).apply(n,G)});if(wt.source=ke,V5(wt))throw wt;return wt}function PV(l){return en(l).toLowerCase()}function BV(l){return en(l).toUpperCase()}function UV(l,d,h){if(l=en(l),l&&(h||d===n))return wS(l);if(!l||!(d=ki(d)))return l;var _=ka(l),k=ka(d),F=AS(_,k),G=xS(_,k)+1;return Is(_,F,G).join("")}function $V(l,d,h){if(l=en(l),l&&(h||d===n))return l.slice(0,kS(l)+1);if(!l||!(d=ki(d)))return l;var _=ka(l),k=xS(_,ka(d))+1;return Is(_,0,k).join("")}function zV(l,d,h){if(l=en(l),l&&(h||d===n))return l.replace(Or,"");if(!l||!(d=ki(d)))return l;var _=ka(l),k=AS(_,ka(d));return Is(_,k).join("")}function HV(l,d){var h=P,_=Q;if(Rn(d)){var k="separator"in d?d.separator:k;h="length"in d?St(d.length):h,_="omission"in d?ki(d.omission):_}l=en(l);var F=l.length;if($u(l)){var G=ka(l);F=G.length}if(h>=F)return l;var Z=h-zu(_);if(Z<1)return _;var ie=G?Is(G,0,Z).join(""):l.slice(0,Z);if(k===n)return ie+_;if(G&&(Z+=ie.length-Z),W5(k)){if(l.slice(Z).search(k)){var we,xe=ie;for(k.global||(k=l5(k.source,en(We.exec(k))+"g")),k.lastIndex=0;we=k.exec(xe);)var ke=we.index;ie=ie.slice(0,ke===n?Z:ke)}}else if(l.indexOf(ki(k),Z)!=Z){var Ye=ie.lastIndexOf(k);Ye>-1&&(ie=ie.slice(0,Ye))}return ie+_}function jV(l){return l=en(l),l&&Rt.test(l)?l.replace(Je,y$):l}var GV=Ku(function(l,d,h){return l+(h?" ":"")+d.toUpperCase()}),Y5=mw("toUpperCase");function hA(l,d,h){return l=en(l),d=h?n:d,d===n?f$(l)?_$(l):i$(l):l.match(d)||[]}var gA=kt(function(l,d){try{return xi(l,n,d)}catch(h){return V5(h)?h:new _t(h)}}),VV=Po(function(l,d){return Zi(d,function(h){h=ao(h),Mo(l,h,j5(l[h],l))}),l});function WV(l){var d=l==null?0:l.length,h=mt();return l=d?An(l,function(_){if(typeof _[1]!="function")throw new Qi(o);return[h(_[0]),_[1]]}):[],kt(function(_){for(var k=-1;++kW)return[];var h=fe,_=Mr(l,fe);d=mt(d),l-=fe;for(var k=a5(_,d);++h0||d<0)?new Ft(h):(l<0?h=h.takeRight(-l):l&&(h=h.drop(l)),d!==n&&(d=St(d),h=d<0?h.dropRight(-d):h.take(d-l)),h)},Ft.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ft.prototype.toArray=function(){return this.take(fe)},ro(Ft.prototype,function(l,d){var h=/^(?:filter|find|map|reject)|While$/.test(d),_=/^(?:head|last)$/.test(d),k=M[_?"take"+(d=="last"?"Right":""):d],F=_||/^find/.test(d);k&&(M.prototype[d]=function(){var G=this.__wrapped__,Z=_?[1]:arguments,ie=G instanceof Ft,we=Z[0],xe=ie||Tt(G),ke=function(Nt){var zt=k.apply(M,Ss([Nt],Z));return _&&Ye?zt[0]:zt};xe&&h&&typeof we=="function"&&we.length!=1&&(ie=xe=!1);var Ye=this.__chain__,lt=!!this.__actions__.length,bt=F&&!Ye,wt=ie&&!lt;if(!F&&xe){G=wt?G:new Ft(this);var yt=l.apply(G,Z);return yt.__actions__.push({func:t0,args:[ke],thisArg:n}),new Ji(yt,Ye)}return bt&&wt?l.apply(this,Z):(yt=this.thru(ke),bt?_?yt.value()[0]:yt.value():yt)})}),Zi(["pop","push","shift","sort","splice","unshift"],function(l){var d=Cf[l],h=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",_=/^(?:pop|shift)$/.test(l);M.prototype[l]=function(){var k=arguments;if(_&&!this.__chain__){var F=this.value();return d.apply(Tt(F)?F:[],k)}return this[h](function(G){return d.apply(Tt(G)?G:[],k)})}}),ro(Ft.prototype,function(l,d){var h=M[d];if(h){var _=h.name+"";an.call(Vu,_)||(Vu[_]=[]),Vu[_].push({name:d,func:h})}}),Vu[Kf(n,E).name]=[{name:"wrapper",func:n}],Ft.prototype.clone=j$,Ft.prototype.reverse=G$,Ft.prototype.value=V$,M.prototype.at=vj,M.prototype.chain=_j,M.prototype.commit=Tj,M.prototype.next=Sj,M.prototype.plant=Aj,M.prototype.reverse=xj,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Cj,M.prototype.first=M.prototype.head,Oc&&(M.prototype[Oc]=wj),M},Hu=T$();Dl?((Dl.exports=Hu)._=Hu,Z2._=Hu):mr._=Hu}).call(eu)})(lm,lm.exports);var Z4e=lm.exports;const tl=Wi(Z4e);function uo(e,t){const n=tl.cloneDeep(e);for(const r in t)typeof t[r]=="function"?tl.updateWith(n,r,t[r]):tl.updateWith(n,r,i=>t[r]);return n}const Rc={};Rc["Requires API Key"]="#FF0000";Rc.Local="#00bb00";Rc["Open-Source"]="#0033FF";Rc.Free="#ffff00";const Q4e={inputType:"number",key:"context_length",label:"Context Length",defaultValue:2048,required:!1},J4e={inputType:"number",key:"temperature",label:"Temperature",defaultValue:void 0,required:!1,min:0,max:1,step:.01},ebe={inputType:"number",key:"top_p",label:"Top-P",defaultValue:void 0,required:!1,min:0,max:1,step:.01},tbe={inputType:"number",key:"top_k",label:"Top-K",defaultValue:void 0,required:!1,min:0,max:1,step:.01},nbe={inputType:"number",key:"presence_penalty",label:"Presence Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},rbe={inputType:"number",key:"frequency_penalty",label:"Frequency Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},Ma=[Q4e,J4e,tbe,ebe,nbe,rbe],Z4={inputType:"text",key:"server_url",label:"Server URL",placeholder:"e.g. http://localhost:8080",required:!1},lE={title:"CodeLlama Instruct",description:"A model from Meta, fine-tuned for code generation and conversation",refUrl:"",params:{title:"CodeLlama-7b-Instruct",model:"codellama:7b-instruct",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"codellama:7b-instruct",title:"CodeLlama-7b-Instruct"},"13b":{model:"codellama:13b-instruct",title:"CodeLlama-13b-Instruct"},"34b":{model:"codellama:34b-instruct",title:"CodeLlama-34b-Instruct"}}}]},uE={title:"Llama2 Chat",description:"The latest Llama model from Meta, fine-tuned for chat",refUrl:"",params:{title:"Llama2-7b-Chat",model:"llama2:7b-chat",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"llama2:7b-chat",title:"Llama2-7b-Chat"},"13b":{model:"llama2:13b-chat",title:"Llama2-13b-Chat"},"34b":{model:"llama2:34b-chat",title:"Llama2-34b-Chat"}}}]},cE={title:"WizardCoder",description:"A CodeLlama-based code generation model from WizardLM, focused on Python",refUrl:"",params:{title:"WizardCoder-7b-Python",model:"wizardcoder:7b-python",context_length:2048,template_messages:"template_alpaca_messages",prompt_templates:{edit:"alpaca_edit_prompt"}},icon:"wizardlm.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"wizardcoder:7b-python",title:"WizardCoder-7b-Python"},"13b":{model:"wizardcoder:13b-python",title:"WizardCoder-13b-Python"},"34b":{model:"wizardcoder:34b-python",title:"WizardCoder-34b-Python"}}}]},dU={title:"Phind CodeLlama (34b)",description:"A finetune of CodeLlama by Phind",params:{title:"Phind CodeLlama",model:"phind-codellama",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}}},dE={title:"Mistral (7b)",description:"A 7b parameter base model created by Mistral AI, very competent for code generation and other tasks",params:{title:"Mistral",model:"mistral",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},icon:"mistral.png"},pU={title:"SQLCoder",description:"A finetune of StarCoder by Defog.ai, focused specifically on SQL",params:{title:"SQLCoder",model:"sqlcoder",context_length:2048,template_messages:"sqlcoder_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"sqlcoder:7b",title:"SQLCoder-7b"},"13b":{model:"sqlcoder:15b",title:"SQLCoder-15b"}}}]},ibe={title:"CodeUp (13b)",description:"An open-source coding model based on Llama2",params:{title:"CodeUp",model:"codeup",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"alpaca_edit_prompt"}}},o1=[lE,uE,cE,dU,pU,dE,ibe],CN={title:"GPT-4",description:"The latest model from OpenAI",params:{model:"gpt-4",context_length:8096,api_key:"",title:"GPT-4"}},kN={title:"GPT-3.5-Turbo",description:"A faster, cheaper OpenAI model with slightly lower capabilities",params:{model:"gpt-3.5-turbo",context_length:8096,title:"GPT-3.5-Turbo",api_key:""}},abe={"codellama:7b-instruct":"meta/codellama-7b-instruct:6527b83e01e41412db37de5110a8670e3701ee95872697481a355e05ce12af0e","codellama:13b-instruct":"meta/codellama-13b-instruct:1f01a52ff933873dff339d5fb5e1fd6f24f77456836f514fa05e91c1a42699c7","codellama:34b-instruct":"meta/codellama-34b-instruct:8281a5c610f6e88237ff3ddaf3c33b56f60809e2bdd19fbec2fda742aa18167e","llama2:7b-chat":"meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e","llama2:13b-chat":"meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d"};function IN(e){return abe[e]||e}const fU={openai:{title:"OpenAI",class:"OpenAI",description:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model",longDescription:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",icon:"openai.png",tags:["Requires API Key"],packages:[CN,kN],collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your OpenAI API key",required:!0},...Ma]},anthropic:{title:"Anthropic",class:"AnthropicLLM",description:"Claude-2 is a highly capable model with a 100k context length",icon:"anthropic.png",tags:["Requires API Key"],longDescription:"To get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.",collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your Anthropic API key",required:!0},...Ma],packages:[{title:"Claude-2",description:"A highly capable model with a 100k context length",params:{model:"claude-2",context_length:1e5,title:"Claude-2"}}]},ollama:{title:"Ollama",class:"Ollama",description:"One of the fastest ways to get started with local models on Mac or Linux",longDescription:'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.',icon:"ollama.png",tags:["Local","Open-Source"],packages:o1,collectInputFor:[...Ma,{...Z4,defaultValue:"http://localhost:11434"}]},together:{title:"TogetherAI",class:"TogetherLLM",description:"Use the TogetherAI API for extremely fast streaming of open-source models",icon:"together.png",longDescription:`Together is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together: 1. Obtain an API key from [here](https://together.ai) 2. Paste below 3. Select a model preset`,tags:["Requires API Key","Open-Source"],params:{api_key:""},collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your TogetherAI API key",required:!0},...Ma],packages:[uo(uE,{"dimensions[0].options":e=>tl.mapValues(e,t=>tl.assign({},t,{model:"togethercomputer/"+t.model.replace("llama2","llama-2").replace(":","-")}))}),uo(lE,{"dimensions[0].options":e=>tl.mapValues(e,t=>tl.assign({},t,{model:"togethercomputer/"+t.model.replace("codellama","CodeLlama").replace(":","-").replace("instruct","Instruct")}))}),uo(cE,{"params.model":"WizardLM/WizardCoder-15B-V1.0","params.title":"WizardCoder-15b","dimensions[0].options":{"15b":{model:"WizardLM/WizardCoder-15B-V1.0",title:"WizardCoder-15b"},"34b (Python)":{model:"WizardLM/WizardCoder-Python-34B-V1.0",title:"WizardCoder-34b-Python"}}}),uo(dU,{"params.model":"Phind/Phind-CodeLlama-34B-Python-v1"}),uo(dE,{"params.model":"mistralai/Mistral-7B-Instruct-v0.1"})].map(e=>(e.params.context_length=4096,e))},lmstudio:{title:"LM Studio",class:"GGML",description:"One of the fastest ways to get started with local models on Mac or Windows",longDescription:`LMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started: diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index bf57be923..0cd7d608c 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -100,15 +100,30 @@ "category": "Continue", "title": "Toggle Right Sidebar" }, + { + "command": "continue.focusContinueInput", + "category": "Continue", + "title": "Add Highlighted Code to Context" + }, { "command": "continue.focusContinueInputWithEdit", "category": "Continue", - "title": "Focus Continue Input With Edit" + "title": "Edit Highlighted Code" }, { "command": "continue.debugTerminal", "category": "Continue", "title": "Debug Terminal" + }, + { + "command": "continue.shareSession", + "category": "Continue", + "title": "Share Session" + }, + { + "command": "continue.selectFilesAsContext", + "category": "Continue", + "title": "Continue: Select Files as Context" } ], "keybindings": [ @@ -148,8 +163,50 @@ "key": "ctrl+shift+r" } ], + "submenus": [ + { + "id": "continue.continueSubMenu", + "label": "Continue" + } + ], "menus": { - "view/title": [] + "terminal/context": [ + { + "command": "continue.debugTerminal", + "group": "1_debug@1" + } + ], + "webview/context": [ + { + "command": "continue.shareSession", + "group": "navigation@1" + } + ], + "editor/context": [ + { + "submenu": "continue.continueSubMenu", + "group": "1_debug@1", + "when": "editorHasSelection" + } + ], + "continue.continueSubMenu": [ + { + "command": "continue.focusContinueInput", + "when": "editorHasSelection", + "group": "Continue" + }, + { + "command": "continue.focusContinueInputWithEdit", + "group": "Continue", + "when": "editorHasSelection" + } + ], + "explorer/context": [ + { + "command": "continue.selectFilesAsContext", + "group": "1_debug@1" + } + ] }, "viewsContainers": { "activitybar": [ diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index ee91e3d37..6a9b83edd 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -40,6 +40,33 @@ function addHighlightedCodeToContext(edit: boolean) { } } +async function addEntireFileToContext(filepath: vscode.Uri, edit: boolean) { + focusedOnContinueInput = !focusedOnContinueInput; + + // Get the contents of the file + const contents = (await vscode.workspace.fs.readFile(filepath)).toString(); + const rangeInFileWithContents = { + filepath: filepath.fsPath, + contents: contents, + range: { + start: { + line: 0, + character: 0, + }, + end: { + line: contents.split(os.EOL).length - 1, + character: 0, + }, + }, + }; + + debugPanelWebview?.postMessage({ + type: "highlightedCode", + rangeInFileWithContents, + edit, + }); +} + export const setFocusedOnContinueInput = (value: boolean) => { focusedOnContinueInput = value; }; @@ -130,6 +157,9 @@ const commandsMap: { [command: string]: (...args: any) => any } = { "continue.sendMainUserInput": (text: string) => { ideProtocolClient.sendMainUserInput(text); }, + "continue.shareSession": () => { + ideProtocolClient.sendMainUserInput("/share"); + }, "continue.selectRange": (startLine: number, endLine: number) => { if (!vscode.window.activeTextEditor) { return; @@ -155,6 +185,16 @@ const commandsMap: { [command: string]: (...args: any) => any } = { "continue.sendToTerminal": (text: string) => { ideProtocolClient.runCommand(text); }, + "continue.selectFilesAsContext": ( + firstUri: vscode.Uri, + uris: vscode.Uri[] + ) => { + vscode.commands.executeCommand("continue.continueGUIView.focus"); + + for (const uri of uris) { + addEntireFileToContext(uri, false); + } + }, }; export function registerAllCommands(context: vscode.ExtensionContext) { diff --git a/gui/src/components/ComboBox.tsx b/gui/src/components/ComboBox.tsx index ead552366..3b5c0291c 100644 --- a/gui/src/components/ComboBox.tsx +++ b/gui/src/components/ComboBox.tsx @@ -205,7 +205,7 @@ const DeleteButtonDiv = styled.div` right: 12px; background-color: ${secondaryDark}; border-radius: ${defaultBorderRadius}; - z-index: 100; + z-index: 50; `; const DynamicQueryTitleDiv = styled.div`