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

chore: adopt @vscode/prompt-tsx 0.2.1-alpha #1047

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions chat-sample/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions chat-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,11 @@
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "npm run setupTiktoken",
"setupTiktoken": "run-script-os",
"setupTiktoken:linux:darwin": "cp node_modules/@vscode/prompt-tsx/dist/base/tokenizer/cl100k_base.tiktoken out/",
"setupTiktoken:windows": "copy node_modules\\@vscode\\prompt-tsx\\dist\\base\\tokenizer\\cl100k_base.tiktoken out\\"
"watch": "tsc -watch -p ./"
},
"devDependencies": {
"@types/node": "^20.5.9",
"@vscode/prompt-tsx": "^0.1.10-alpha",
"@vscode/prompt-tsx": "^0.2.1-alpha",
"eslint": "^7.22.0",
"run-script-os": "^1.1.6",
"tslint": "^6.1.3",
Expand Down
4 changes: 2 additions & 2 deletions chat-sample/src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderPrompt, Cl100KBaseTokenizer } from '@vscode/prompt-tsx';
import { renderPrompt } from '@vscode/prompt-tsx';
import * as vscode from 'vscode';
import { PlayPrompt } from './play';

Expand Down Expand Up @@ -56,7 +56,7 @@ export function activate(context: vscode.ExtensionContext) {
PlayPrompt,
{ userQuery: request.prompt },
{ modelMaxPromptTokens: model.maxInputTokens },
new Cl100KBaseTokenizer());
model);

const chatResponse = await model.sendRequest(messages, {}, token);
for await (const fragment of chatResponse.text) {
Expand Down