wirejs-deploy-amplify-basic 0.1.142-llm → 0.1.144-llm

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.
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.42",
6
- "wirejs-resources": "^0.1.142-llm"
6
+ "wirejs-resources": "^0.1.144-llm"
7
7
  }
8
8
  }
@@ -3,6 +3,7 @@ export declare class LLM extends BaseLLM {
3
3
  private bedrockClient;
4
4
  constructor(scope: Resource | string, id: string, options: {
5
5
  models: string[];
6
+ systemPrompt?: string;
6
7
  });
7
8
  private createBedrockInstructionMessage;
8
9
  private convertToBedrockFormat;
@@ -6,6 +6,7 @@ export class LLM extends BaseLLM {
6
6
  constructor(scope, id, options) {
7
7
  super(scope, id, options);
8
8
  this.models = options.models;
9
+ this.systemPrompt = options.systemPrompt;
9
10
  this.bedrockClient = new BedrockRuntimeClient({
10
11
  credentials: defaultProvider(),
11
12
  });
@@ -18,7 +19,7 @@ export class LLM extends BaseLLM {
18
19
  }
19
20
  convertToBedrockFormat(messages) {
20
21
  return messages.map(msg => ({
21
- role: msg.role === 'user' ? 'user' : 'assistant',
22
+ role: msg.role,
22
23
  content: [{
23
24
  text: msg.content
24
25
  }]
@@ -43,9 +44,9 @@ export class LLM extends BaseLLM {
43
44
  const command = new ConverseStreamCommand({
44
45
  modelId,
45
46
  messages: this.convertToBedrockFormat(messages),
46
- inferenceConfig: {
47
- maxTokens: 10000
48
- }
47
+ system: this.systemPrompt ? [{
48
+ text: this.systemPrompt
49
+ }] : undefined
49
50
  });
50
51
  return await this.bedrockClient.send(command);
51
52
  }
@@ -53,9 +54,9 @@ export class LLM extends BaseLLM {
53
54
  const command = new ConverseCommand({
54
55
  modelId,
55
56
  messages: this.convertToBedrockFormat(messages),
56
- inferenceConfig: {
57
- maxTokens: 10000
58
- }
57
+ system: this.systemPrompt ? [{
58
+ text: this.systemPrompt
59
+ }] : undefined
59
60
  });
60
61
  return await this.bedrockClient.send(command);
61
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.1.142-llm",
3
+ "version": "0.1.144-llm",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "recursive-copy": "^2.0.14",
45
45
  "rimraf": "^6.0.1",
46
46
  "wirejs-dom": "^1.0.42",
47
- "wirejs-resources": "^0.1.142-llm"
47
+ "wirejs-resources": "^0.1.144-llm"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@aws-amplify/backend": "^1.14.0",