koishi-plugin-chatluna-google-gemini-adapter 1.0.0-beta.7 → 1.0.0-beta.9

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/client.d.ts CHANGED
@@ -4,7 +4,7 @@ import { ChatHubBaseEmbeddings, ChatLunaChatModel } from 'koishi-plugin-chatluna
4
4
  import { ModelInfo } from 'koishi-plugin-chatluna/lib/llm-core/platform/types';
5
5
  import { Context } from 'koishi';
6
6
  import { Config } from '.';
7
- export declare class GeminiClient extends PlatformModelAndEmbeddingsClient<ClientConfig> {
7
+ export declare class GeminiClient extends PlatformModelAndEmbeddingsClient {
8
8
  private _config;
9
9
  platform: string;
10
10
  private _requester;
package/lib/utils.js CHANGED
@@ -115,10 +115,12 @@ async function langchainMessageToGeminiMessage(messages, model) {
115
115
  if (mappedMessage?.[i + 1]?.role === 'model') {
116
116
  continue;
117
117
  }
118
- result.push({
119
- role: 'model',
120
- parts: [{ text: 'Okay, what do I need to do?' }]
121
- });
118
+ if (mappedMessage?.[i + 1]?.role === 'user') {
119
+ result.push({
120
+ role: 'model',
121
+ parts: [{ text: 'Okay, what do I need to do?' }]
122
+ });
123
+ }
122
124
  }
123
125
  if (result[result.length - 1].role === 'model') {
124
126
  result.push({
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.0.0-beta.7",
4
+ "version": "1.0.0-beta.9",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -38,18 +38,18 @@
38
38
  "adapter"
39
39
  ],
40
40
  "dependencies": {
41
- "@langchain/core": "^0.1.15",
42
- "@streamparser/json": "^0.0.19",
43
- "zod": "^3.22.4",
44
- "zod-to-json-schema": "^3.22.3"
41
+ "@langchain/core": "^0.1.38",
42
+ "@streamparser/json": "^0.0.20",
43
+ "zod": "^3.23.0-canary.20240222T232722",
44
+ "zod-to-json-schema": "^3.22.4"
45
45
  },
46
46
  "devDependencies": {
47
- "atsc": "^1.2.2",
48
- "koishi": "^4.16.4"
47
+ "atsc": "^2.0.1",
48
+ "koishi": "^4.17.1"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "koishi": "^4.16.0",
52
- "koishi-plugin-chatluna": "^1.0.0-beta.33"
52
+ "koishi-plugin-chatluna": "^1.0.0-beta.41"
53
53
  },
54
54
  "koishi": {
55
55
  "description": {