From 15b28c799c75639a73cc4f534e7a1c29ee8f1d18 Mon Sep 17 00:00:00 2001 From: nvms Date: Tue, 5 Dec 2023 16:37:29 -0500 Subject: [PATCH] update defaults for LM Studio preset --- extension/dist/extension.umd.js | 2 +- extension/src/extension.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extension/dist/extension.umd.js b/extension/dist/extension.umd.js index ae58aea..a6e69aa 100644 --- a/extension/dist/extension.umd.js +++ b/extension/dist/extension.umd.js @@ -154,4 +154,4 @@ ASSISTANT:`,first:`{system}
- `}};var t5=()=>{H2().forEach(d=>{V.set(`${d.id}-presets`,void 0),V.set(`${d.id}-activePreset`,void 0)});let I=H2().map(d=>V.get(`${d.id}-presets`)).filter(Boolean);(!I||!I.length)&&H2().forEach(G=>{V.set(`${G.id}-presets`,[{id:d1(),name:"OpenAI (gpt-3.5-turbo)",provider:"OpenAI",format:"OpenAI",tokenizer:"OpenAI",url:"https://api.openai.com/v1/chat/completions",system:E1.get(G.id),completionParams:{...m1("OpenAI")}},{id:d1(),name:"OpenAI (gpt-4-1106-preview)",provider:"OpenAI",format:"OpenAI",tokenizer:"OpenAI",url:"https://api.openai.com/v1/chat/completions",system:E1.get(G.id),completionParams:{...m1("OpenAI"),model:"gpt-4-1106-preview",max_tokens:64e3}},{id:d1(),name:"Anthropic (claude-instant-1)",provider:"Anthropic",format:"Anthropic",tokenizer:"Anthropic",url:"https://api.anthropic.com/v1/complete",system:E1.get(G.id),completionParams:{...m1("Anthropic")}},{id:d1(),name:"Anthropic (claude-2.1)",provider:"Anthropic",format:"Anthropic",tokenizer:"Anthropic",url:"https://api.anthropic.com/v1/complete",system:E1.get(G.id),completionParams:{...m1("Anthropic"),model:"claude-2.1"}},{id:d1(),name:"LM Studio",provider:"OpenAI",format:"OpenAI",tokenizer:"OpenAI",url:"http://localhost:1234/v1/chat/completions",system:E1.get(G.id),completionParams:{...m1("OpenAI")}}]),V.set(`${G.id}-activePreset`,V.get(`${G.id}-presets`)[0])})};var u2=()=>{V.clear(),V.set(N.modes(),[...T1]),t5(),h5(),V.set(N.stateCreated(),!0)},p3=async l=>{if(!h1[l])return;let I=await t1.window.showInputBox({prompt:`Enter your ${l} API key.`});I!==void 0&&await V.setSecret(N.providerApiKey(l),I)};function b0(l){V.create(l),V.get(N.stateCreated())||u2();try{let G=t1.commands.registerCommand("wingman.setApiKey",async()=>{let b=await t1.window.showQuickPick(Object.keys(h1).map(W=>({label:W})),{placeHolder:"Select the provider you want to set the API key for."});if(!b)return;let Z=await t1.window.showInputBox({prompt:`Enter your ${b.label} API key.`});Z&&await V.setSecret(N.providerApiKey(b.label),Z)});l.subscriptions.push(G)}catch(G){console.error(G)}let d=new G2(l.extensionPath,l.extensionUri);l.subscriptions.push(t1.window.registerWebviewViewProvider(G2.viewType,d,{webviewOptions:{retainContextWhenHidden:!0}}))}function Z0(){}0&&(module.exports={activate,createDefaultPresetsForAllModes,createState,deactivate,promptSetProviderKey}); + `}};var t5=()=>{H2().forEach(d=>{V.set(`${d.id}-presets`,void 0),V.set(`${d.id}-activePreset`,void 0)});let I=H2().map(d=>V.get(`${d.id}-presets`)).filter(Boolean);(!I||!I.length)&&H2().forEach(G=>{V.set(`${G.id}-presets`,[{id:d1(),name:"OpenAI (gpt-3.5-turbo)",provider:"OpenAI",format:"OpenAI",tokenizer:"OpenAI",url:"https://api.openai.com/v1/chat/completions",system:E1.get(G.id),completionParams:{...m1("OpenAI")}},{id:d1(),name:"OpenAI (gpt-4-1106-preview)",provider:"OpenAI",format:"OpenAI",tokenizer:"OpenAI",url:"https://api.openai.com/v1/chat/completions",system:E1.get(G.id),completionParams:{...m1("OpenAI"),model:"gpt-4-1106-preview",max_tokens:64e3}},{id:d1(),name:"Anthropic (claude-instant-1)",provider:"Anthropic",format:"Anthropic",tokenizer:"Anthropic",url:"https://api.anthropic.com/v1/complete",system:E1.get(G.id),completionParams:{...m1("Anthropic")}},{id:d1(),name:"Anthropic (claude-2.1)",provider:"Anthropic",format:"Anthropic",tokenizer:"Anthropic",url:"https://api.anthropic.com/v1/complete",system:E1.get(G.id),completionParams:{...m1("Anthropic"),model:"claude-2.1"}},{id:d1(),name:"LM Studio",provider:"OpenAI",format:"OpenAI",tokenizer:"OpenAI",url:"http://localhost:1234/v1/chat/completions",system:E1.get(G.id),completionParams:{...m1("OpenAI"),model:null,stop:null}}]),V.set(`${G.id}-activePreset`,V.get(`${G.id}-presets`)[0])})};var u2=()=>{V.clear(),V.set(N.modes(),[...T1]),t5(),h5(),V.set(N.stateCreated(),!0)},p3=async l=>{if(!h1[l])return;let I=await t1.window.showInputBox({prompt:`Enter your ${l} API key.`});I!==void 0&&await V.setSecret(N.providerApiKey(l),I)};function b0(l){V.create(l),V.get(N.stateCreated())||u2();try{let G=t1.commands.registerCommand("wingman.setApiKey",async()=>{let b=await t1.window.showQuickPick(Object.keys(h1).map(W=>({label:W})),{placeHolder:"Select the provider you want to set the API key for."});if(!b)return;let Z=await t1.window.showInputBox({prompt:`Enter your ${b.label} API key.`});Z&&await V.setSecret(N.providerApiKey(b.label),Z)});l.subscriptions.push(G)}catch(G){console.error(G)}let d=new G2(l.extensionPath,l.extensionUri);l.subscriptions.push(t1.window.registerWebviewViewProvider(G2.viewType,d,{webviewOptions:{retainContextWhenHidden:!0}}))}function Z0(){}0&&(module.exports={activate,createDefaultPresetsForAllModes,createState,deactivate,promptSetProviderKey}); diff --git a/extension/src/extension.ts b/extension/src/extension.ts index 9fa74ea..857a9f8 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -81,6 +81,8 @@ export const createDefaultPresetsForAllModes = () => { system: systems.get(mode.id), completionParams: { ...getProviderCompletionParamDefaults("OpenAI") as any, + model: null, + stop: null, }, } ] as Preset[]);