koishi-plugin-chatluna-google-gemini-adapter 1.2.10 → 1.2.11

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 CHANGED
@@ -185,14 +185,13 @@ function extractSystemMessages(messages) {
185
185
  );
186
186
  return [
187
187
  {
188
+ role: "user",
188
189
  parts: [
189
190
  {
190
191
  text: systemMessages.reduce((acc, cur) => {
191
192
  acc.push(...cur.parts);
192
193
  return acc;
193
- }, []).map((part) => {
194
- return partAsType(part).text;
195
- }).join("\n\n\n")
194
+ }, []).map((part) => partAsType(part).text).join("\n\n\n")
196
195
  }
197
196
  ]
198
197
  },
package/lib/index.mjs CHANGED
@@ -168,14 +168,13 @@ function extractSystemMessages(messages) {
168
168
  );
169
169
  return [
170
170
  {
171
+ role: "user",
171
172
  parts: [
172
173
  {
173
174
  text: systemMessages.reduce((acc, cur) => {
174
175
  acc.push(...cur.parts);
175
176
  return acc;
176
- }, []).map((part) => {
177
- return partAsType(part).text;
178
- }).join("\n\n\n")
177
+ }, []).map((part) => partAsType(part).text).join("\n\n\n")
179
178
  }
180
179
  ]
181
180
  },
package/lib/utils.d.ts CHANGED
@@ -4,7 +4,7 @@ import { ChatCompletionFunction, ChatCompletionResponseMessage, ChatCompletionRe
4
4
  import { Config } from '.';
5
5
  export declare function langchainMessageToGeminiMessage(messages: BaseMessage[], model?: string): Promise<ChatCompletionResponseMessage[]>;
6
6
  export declare function extractSystemMessages(messages: ChatCompletionResponseMessage[]): [
7
- Omit<ChatCompletionResponseMessage, 'role'>,
7
+ ChatCompletionResponseMessage,
8
8
  ChatCompletionResponseMessage[]
9
9
  ];
10
10
  export declare function partAsType<T extends ChatPart>(part: ChatPart): T;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chatluna-google-gemini-adapter",
3
3
  "description": "google-gemini adapter for chatluna",
4
- "version": "1.2.10",
4
+ "version": "1.2.11",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.mjs",
7
7
  "typings": "lib/index.d.ts",