Skip to content

Commit

Permalink
💚 Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
noraincode committed Mar 5, 2024
1 parent ed87410 commit a02280f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 49 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
examples
node_modules
node_modules/*
.github/
.vscode/
.env
Expand All @@ -8,3 +8,4 @@ tsconfig.json
.npmignore
.gitignore
jest.config.js
lib
49 changes: 49 additions & 0 deletions examples/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
```typescript
import { KimiChat } from "../lib";

const kimi = new KimiChat("Your API Key");

// Chat Completion
const { data: messages } = await kimi.chatCompletions({
messages: [
{
role: "user",
content: "Hello, how are you?",
},
],
});

// Estimate Token
const { data: tokenCounts } = await kimi.estimateTokens({
messages: [
{
role: "user",
content: "Hello, how are you?",
},
],
});

// List Models
const { data: models } = await kimi.getModels();

// Upload file
const { data: file } = await kimi.uploadFile(
"pathToYourFile",
(args: { loaded: number; total: number }) => {
// Optional callback
console.log(args.loaded, args.total);
}
);

// Get uploaded files
const { data: files } = await kimi.getFiles();

// Get file content
const { data: fileContent } = await kimi.getFileContent(file.id);

// Get File
const { data: fileDetail } = await kimi.getFile(file.id);

// Delete file
const { data: deletedFile } = await kimi.deleteFile(file.id);
```
46 changes: 0 additions & 46 deletions examples/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ module.exports = {
'.d.ts',
'dist/',
'lib/__tests__/clearFiles.ts',
'examples'
],
};
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"module": "commonjs", /* Specify what module code is generated. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
"outDir": "dist", /* Specify an output folder for all emitted files. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"strict": true, /* Enable all strict type-checking options. */
Expand Down

0 comments on commit a02280f

Please sign in to comment.