koishi-plugin-minecraft-notifier 1.7.1 → 1.8.0
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 +95 -95
- package/lib/index.d.ts +1 -0
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -815,113 +815,112 @@ Input:
|
|
|
815
815
|
${updateContent}
|
|
816
816
|
`;
|
|
817
817
|
let response;
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
818
|
+
const requestData = {
|
|
819
|
+
model: cfg.model,
|
|
820
|
+
temperature: 0.8,
|
|
821
|
+
messages: [
|
|
821
822
|
{
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
823
|
+
role: "system",
|
|
824
|
+
content: await getSustemPrompt(
|
|
825
|
+
ctx,
|
|
826
|
+
cfg,
|
|
827
|
+
updateContent.toLowerCase()
|
|
828
|
+
)
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
role: "user",
|
|
832
|
+
content: userPrompt
|
|
833
|
+
}
|
|
834
|
+
],
|
|
835
|
+
response_format: {
|
|
836
|
+
type: "json_schema",
|
|
837
|
+
json_schema: {
|
|
838
|
+
name: "minecraft_update_summary",
|
|
839
|
+
strict: true,
|
|
840
|
+
schema: {
|
|
841
|
+
type: "object",
|
|
842
|
+
properties: {
|
|
843
|
+
new_features: {
|
|
844
|
+
$ref: "#/definitions/categoryGroup"
|
|
845
|
+
},
|
|
846
|
+
improvements: {
|
|
847
|
+
$ref: "#/definitions/categoryGroup"
|
|
848
|
+
},
|
|
849
|
+
balancing: {
|
|
850
|
+
$ref: "#/definitions/categoryGroup"
|
|
851
|
+
},
|
|
852
|
+
bug_fixes: {
|
|
853
|
+
$ref: "#/definitions/categoryGroup"
|
|
854
|
+
},
|
|
855
|
+
technical_changes: {
|
|
856
|
+
$ref: "#/definitions/categoryGroup"
|
|
857
|
+
}
|
|
833
858
|
},
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
strict: true,
|
|
845
|
-
schema: {
|
|
859
|
+
required: [
|
|
860
|
+
"new_features",
|
|
861
|
+
"improvements",
|
|
862
|
+
"balancing",
|
|
863
|
+
"bug_fixes",
|
|
864
|
+
"technical_changes"
|
|
865
|
+
],
|
|
866
|
+
additionalProperties: false,
|
|
867
|
+
definitions: {
|
|
868
|
+
categoryGroup: {
|
|
846
869
|
type: "object",
|
|
847
870
|
properties: {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
$ref: "#/definitions/categoryGroup"
|
|
853
|
-
},
|
|
854
|
-
balancing: {
|
|
855
|
-
$ref: "#/definitions/categoryGroup"
|
|
856
|
-
},
|
|
857
|
-
bug_fixes: {
|
|
858
|
-
$ref: "#/definitions/categoryGroup"
|
|
871
|
+
general: {
|
|
872
|
+
type: "array",
|
|
873
|
+
description: "\u5C5E\u4E8E\u8BE5\u5927\u7C7B\u4F46\u672A\u7EC6\u5206\u7684\u5C0F\u9879",
|
|
874
|
+
items: { type: "string" }
|
|
859
875
|
},
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
categoryGroup: {
|
|
874
|
-
type: "object",
|
|
875
|
-
properties: {
|
|
876
|
-
general: {
|
|
877
|
-
type: "array",
|
|
878
|
-
description: "\u5C5E\u4E8E\u8BE5\u5927\u7C7B\u4F46\u672A\u7EC6\u5206\u7684\u5C0F\u9879",
|
|
879
|
-
items: { type: "string" }
|
|
880
|
-
},
|
|
881
|
-
subcategories: {
|
|
882
|
-
type: "array",
|
|
883
|
-
description: "\u8BE5\u5927\u7C7B\u4E0B\u7684\u7EC6\u5206\u7C7B\uFF08\u5E26 emoji\uFF09",
|
|
876
|
+
subcategories: {
|
|
877
|
+
type: "array",
|
|
878
|
+
description: "\u8BE5\u5927\u7C7B\u4E0B\u7684\u7EC6\u5206\u7C7B\uFF08\u5E26 emoji\uFF09",
|
|
879
|
+
items: {
|
|
880
|
+
type: "object",
|
|
881
|
+
properties: {
|
|
882
|
+
subcategory: {
|
|
883
|
+
type: "string"
|
|
884
|
+
},
|
|
885
|
+
emoji: {
|
|
886
|
+
type: "string",
|
|
887
|
+
description: "\u5C0F\u7C7B\u524D\u7684 emoji \u56FE\u6807"
|
|
888
|
+
},
|
|
884
889
|
items: {
|
|
885
|
-
type: "
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
},
|
|
890
|
-
emoji: {
|
|
891
|
-
type: "string",
|
|
892
|
-
description: "\u5C0F\u7C7B\u524D\u7684 emoji \u56FE\u6807"
|
|
893
|
-
},
|
|
894
|
-
items: {
|
|
895
|
-
type: "array",
|
|
896
|
-
items: {
|
|
897
|
-
type: "string"
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
},
|
|
901
|
-
required: [
|
|
902
|
-
"subcategory",
|
|
903
|
-
"emoji",
|
|
904
|
-
"items"
|
|
905
|
-
],
|
|
906
|
-
additionalProperties: false
|
|
890
|
+
type: "array",
|
|
891
|
+
items: {
|
|
892
|
+
type: "string"
|
|
893
|
+
}
|
|
907
894
|
}
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
895
|
+
},
|
|
896
|
+
required: [
|
|
897
|
+
"subcategory",
|
|
898
|
+
"emoji",
|
|
899
|
+
"items"
|
|
900
|
+
],
|
|
901
|
+
additionalProperties: false
|
|
902
|
+
}
|
|
912
903
|
}
|
|
913
|
-
}
|
|
904
|
+
},
|
|
905
|
+
required: ["general", "subcategories"],
|
|
906
|
+
additionalProperties: false
|
|
914
907
|
}
|
|
915
908
|
}
|
|
916
909
|
}
|
|
917
|
-
},
|
|
918
|
-
{
|
|
919
|
-
headers: {
|
|
920
|
-
"Content-Type": "application/json",
|
|
921
|
-
Authorization: `Bearer ${cfg.apiKey}`
|
|
922
|
-
}
|
|
923
910
|
}
|
|
924
|
-
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
if (cfg.enableWebSearch) {
|
|
914
|
+
requestData["web_search"] = true;
|
|
915
|
+
requestData["tools"] = [{ type: "web_search_preview" }];
|
|
916
|
+
}
|
|
917
|
+
try {
|
|
918
|
+
response = await import_axios3.default.post(url, requestData, {
|
|
919
|
+
headers: {
|
|
920
|
+
"Content-Type": "application/json",
|
|
921
|
+
Authorization: `Bearer ${cfg.apiKey}`
|
|
922
|
+
}
|
|
923
|
+
});
|
|
925
924
|
} catch (e) {
|
|
926
925
|
ctx.logger("minecraft-notifier").error(
|
|
927
926
|
"Summarization API error:",
|
|
@@ -1034,6 +1033,7 @@ var Config = import_koishi.Schema.object({
|
|
|
1034
1033
|
checkInterval: import_koishi.Schema.number().default(3).description("\u5728\u7EBF\u72B6\u6001\u68C0\u67E5\u95F4\u9694\uFF08\u5206\u949F\uFF09"),
|
|
1035
1034
|
baseApiUrl: import_koishi.Schema.string().default("https://api.openai.com/v1").description("AI \u63A5\u53E3\u7684\u57FA\u7840 URL"),
|
|
1036
1035
|
model: import_koishi.Schema.string().default("gpt-5").description("\u4F7F\u7528\u7684 AI \u6A21\u578B"),
|
|
1036
|
+
enableWebSearch: import_koishi.Schema.boolean().default(true).description("\u662F\u5426\u542F\u7528\u7F51\u7EDC\u641C\u7D22\u529F\u80FD"),
|
|
1037
1037
|
apiKey: import_koishi.Schema.string().role("secret").default("").description("AI \u63A5\u53E3\u7684 API \u5BC6\u94A5").required(),
|
|
1038
1038
|
notifyChannel: import_koishi.Schema.array(String).default([]).description("\u7528\u4E8E\u63A5\u6536\u66F4\u65B0\u901A\u77E5\u7684\u9891\u9053 ID \u5217\u8868"),
|
|
1039
1039
|
giteeApiToken: import_koishi.Schema.string().role("secret").default("").description("Gitee API \u8BBF\u95EE\u4EE4\u724C\uFF0C\u7528\u4E8E\u4E0A\u4F20 XAML \u6587\u4EF6"),
|
package/lib/index.d.ts
CHANGED
package/package.json
CHANGED