Skip to content

Commit

Permalink
chore: Delete unnecessary package and tsconfig improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pigri committed Jul 25, 2024
1 parent bf029a9 commit 24791cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
14 changes: 7 additions & 7 deletions test-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "tsc",
"start": "node dist/index.js"
},
"author": "",
"license": "ISC",
"description": "",
"author": "David Papp <[email protected]>",
"license": "Apache-2.0",
"description": "Demo client for OpenShield",
"dependencies": {
"https-proxy-agent": "^7.0.4",
"openai": "4.53.0"
},
"devDependencies": {
"@types/node": "^20.12.12",
"typescript": "^5.4.5"
"@types/node": "20.12.12",
"typescript": "5.4.5"
}
}
16 changes: 2 additions & 14 deletions test-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import OpenAI from 'openai';
import { HttpsProxyAgent } from 'https-proxy-agent';

const client = new OpenAI({
// apiKey: '12345',
baseURL: 'http://127.0.0.1:3005/openai/v1',
apiKey: process.env.TEST_API_KEY,
apiKey: process.env.OPENSHIELD_API_KEY,
});

async function main() {
// const model = await client.models.retrieve('gpt-4');
// console.log(model);
// const customModel = await client.models.retrieve('davinci:ft-persio-2023-03-06-11-44-36');
// console.log(customModel);
// const list = await client.models.list();
//
// for await (const model of list) {
// console.log(model);
// }

const completion = await client.chat.completions.create({
model: 'gpt-4',
messages: [
Expand All @@ -28,4 +16,4 @@ async function main() {
console.log(JSON.stringify(completion, null, 2));
}

main().then(r => console.log('done'));
main().then(() => console.log('done'));
7 changes: 4 additions & 3 deletions test-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"compilerOptions": {
"noEmit": true,
"target": "es2021",
"target": "esnext",
"module": "esnext",
"strict": true,
"outDir": "dist",
"moduleResolution": "Bundler"
},
"include": [ "src" ],
"exclude": [ "src/_shims" ]
"exclude": [ "node_modules" ]
}

0 comments on commit 24791cc

Please sign in to comment.