wirejs-deploy-amplify-basic 0.1.148-llm → 0.1.149-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.
package/dist/services/llm.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare class LLM extends BaseLLM {
|
|
|
4
4
|
constructor(scope: Resource | string, id: string, options: {
|
|
5
5
|
models: string[];
|
|
6
6
|
systemPrompt?: string;
|
|
7
|
+
targetContextSize?: number;
|
|
7
8
|
});
|
|
8
9
|
private createBedrockInstructionMessage;
|
|
9
10
|
private convertToBedrockFormat;
|
|
@@ -11,5 +12,5 @@ export declare class LLM extends BaseLLM {
|
|
|
11
12
|
private invokeBedrock;
|
|
12
13
|
private streamBedrock;
|
|
13
14
|
private invokeModel;
|
|
14
|
-
continueConversation({ history, onChunk, timeoutSeconds, systemPrompt, }: ContinueConversationOptions): Promise<LLMMessage>;
|
|
15
|
+
continueConversation({ history, onChunk, timeoutSeconds, systemPrompt, models, }: ContinueConversationOptions): Promise<LLMMessage>;
|
|
15
16
|
}
|
package/dist/services/llm.js
CHANGED
|
@@ -131,7 +131,7 @@ export class LLM extends BaseLLM {
|
|
|
131
131
|
}
|
|
132
132
|
throw new Error("Exceeded max retries trying to invoke " + model);
|
|
133
133
|
}
|
|
134
|
-
async continueConversation({ history, onChunk, timeoutSeconds, systemPrompt, }) {
|
|
134
|
+
async continueConversation({ history, onChunk, timeoutSeconds, systemPrompt, models, }) {
|
|
135
135
|
const controller = new AbortController();
|
|
136
136
|
let timeoutId;
|
|
137
137
|
if (timeoutSeconds) {
|
|
@@ -142,7 +142,7 @@ export class LLM extends BaseLLM {
|
|
|
142
142
|
try {
|
|
143
143
|
// models are expected to be given in priority order. first one that doesn't
|
|
144
144
|
// throw a fit wins.
|
|
145
|
-
for (const model of this.models) {
|
|
145
|
+
for (const model of models ?? this.models) {
|
|
146
146
|
try {
|
|
147
147
|
const result = await this.invokeModel(model, (systemPrompt ?? this.systemPrompt) ?? '', history, onChunk, controller.signal);
|
|
148
148
|
if (!result)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wirejs-deploy-amplify-basic",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.149-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.44",
|
|
47
|
-
"wirejs-resources": "^0.1.
|
|
47
|
+
"wirejs-resources": "^0.1.149-llm"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@aws-amplify/backend": "^1.14.0",
|