@chatluna/v1-shared-adapter 1.0.23 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +6 -0
- package/lib/index.mjs +6 -0
- package/lib/utils.d.ts +2 -2
- package/package.json +2 -2
package/lib/index.cjs
CHANGED
|
@@ -413,6 +413,12 @@ function removeAdditionalProperties(schema) {
|
|
|
413
413
|
if (Object.hasOwn(current, "$schema")) {
|
|
414
414
|
delete current["$schema"];
|
|
415
415
|
}
|
|
416
|
+
if (Object.hasOwn(current, "const")) {
|
|
417
|
+
if (!Object.hasOwn(current, "enum")) {
|
|
418
|
+
current["enum"] = [current["const"]];
|
|
419
|
+
}
|
|
420
|
+
delete current["const"];
|
|
421
|
+
}
|
|
416
422
|
for (const key of Object.keys(current)) {
|
|
417
423
|
const value = current[key];
|
|
418
424
|
if (value && typeof value === "object") {
|
package/lib/index.mjs
CHANGED
|
@@ -377,6 +377,12 @@ function removeAdditionalProperties(schema) {
|
|
|
377
377
|
if (Object.hasOwn(current, "$schema")) {
|
|
378
378
|
delete current["$schema"];
|
|
379
379
|
}
|
|
380
|
+
if (Object.hasOwn(current, "const")) {
|
|
381
|
+
if (!Object.hasOwn(current, "enum")) {
|
|
382
|
+
current["enum"] = [current["const"]];
|
|
383
|
+
}
|
|
384
|
+
delete current["const"];
|
|
385
|
+
}
|
|
380
386
|
for (const key of Object.keys(current)) {
|
|
381
387
|
const value = current[key];
|
|
382
388
|
if (value && typeof value === "object") {
|
package/lib/utils.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ export declare function messageTypeToOpenAIRole(type: MessageType): ChatCompleti
|
|
|
11
11
|
export declare function formatToolsToOpenAITools(tools: StructuredTool[], includeGoogleSearch: boolean): ChatCompletionTool[];
|
|
12
12
|
export declare function formatToolToOpenAITool(tool: StructuredTool): ChatCompletionTool;
|
|
13
13
|
export declare function removeAdditionalProperties(schema: JsonSchema7Type): JsonSchema7Type;
|
|
14
|
-
export declare function convertMessageToMessageChunk(message: ChatCompletionResponseMessage):
|
|
15
|
-
export declare function convertDeltaToMessageChunk(delta: Record<string, any>, defaultRole?: ChatCompletionResponseMessageRoleEnum):
|
|
14
|
+
export declare function convertMessageToMessageChunk(message: ChatCompletionResponseMessage): HumanMessageChunk | AIMessageChunk | SystemMessageChunk | FunctionMessageChunk | ToolMessageChunk | ChatMessageChunk;
|
|
15
|
+
export declare function convertDeltaToMessageChunk(delta: Record<string, any>, defaultRole?: ChatCompletionResponseMessageRoleEnum): HumanMessageChunk | AIMessageChunk | SystemMessageChunk | FunctionMessageChunk | ToolMessageChunk | ChatMessageChunk;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatluna/v1-shared-adapter",
|
|
3
3
|
"description": "chatluna shared adapter",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.24",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "lib/index.mjs",
|
|
7
7
|
"typings": "lib/index.d.ts",
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"koishi": "^4.18.9",
|
|
73
|
-
"koishi-plugin-chatluna": "^1.3.
|
|
73
|
+
"koishi-plugin-chatluna": "^1.3.20"
|
|
74
74
|
}
|
|
75
75
|
}
|