Skip to content

Commit

Permalink
feat: 更换打包工具
Browse files Browse the repository at this point in the history
  • Loading branch information
winily committed Feb 4, 2024
1 parent 0b86957 commit 3cb156b
Show file tree
Hide file tree
Showing 44 changed files with 1,890 additions and 453 deletions.
49 changes: 0 additions & 49 deletions dist/cjs/completions.js

This file was deleted.

7 changes: 0 additions & 7 deletions dist/cjs/completions.js.map

This file was deleted.

37 changes: 0 additions & 37 deletions dist/cjs/index.js

This file was deleted.

7 changes: 0 additions & 7 deletions dist/cjs/index.js.map

This file was deleted.

7 changes: 0 additions & 7 deletions dist/cjs/jwt.js.map

This file was deleted.

73 changes: 0 additions & 73 deletions dist/cjs/zhipu-ai.js

This file was deleted.

7 changes: 0 additions & 7 deletions dist/cjs/zhipu-ai.js.map

This file was deleted.

73 changes: 73 additions & 0 deletions dist/completions.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};

// lib/completions.ts
var completions_exports = {};
__export(completions_exports, {
default: () => Completions
});
module.exports = __toCommonJS(completions_exports);
var Completions = class {
constructor(app) {
this.app = app;
}
create(options) {
return __async(this, null, function* () {
return this.app.post("/chat/completions", {
"model": options.model,
"request_id": options.request_id,
"temperature": options.temperature,
"top_p": options.top_p,
"do_sample": options.do_sample,
"max_tokens": options.max_tokens,
"seed": options.seed,
"messages": options.messages,
"stop": options.stop,
"sensitive_word_check": options.sensitive_word_check,
"stream": options.stream,
"tools": options.tools,
"tool_choice": options.tool_choice
}, {
headers: options.extra_headers,
responseType: options.stream ? "stream" : "json"
});
});
}
};
//# sourceMappingURL=completions.cjs.map
1 change: 1 addition & 0 deletions dist/completions.cjs.map

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

Loading

0 comments on commit 3cb156b

Please sign in to comment.