Skip to content

Commit 0bf8aae

Browse files
authored
Merge pull request #155 from forcedotcom/phale/token-limits
fix: add output token limit parameter to callLLM
2 parents 3b9adf6 + cb5de6d commit 0bf8aae

File tree

3 files changed

+56
-41
lines changed

3 files changed

+56
-41
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
"@types/istanbul-lib-coverage": "^2.0.6",
1717
"@types/istanbul-lib-report": "^3.0.3",
1818
"@types/jest": "^29.5.14",
19-
"@types/node": "^20.17.10",
19+
"@types/node": "^20.17.11",
2020
"@types/vscode": "^1.96.0",
2121
"@typescript-eslint/eslint-plugin": "^7.18.0",
2222
"@typescript-eslint/parser": "^7.18.0",
23-
"commitlint": "^19.6.0",
23+
"commitlint": "^19.6.1",
2424
"cz-conventional-changelog": "^3.3.0",
2525
"eslint": "^8.57.1",
2626
"eslint-config-prettier": "^9.0.0",
@@ -29,7 +29,7 @@
2929
"eslint-plugin-prettier": "^5.2.1",
3030
"husky": "^9.1.7",
3131
"jest": "^29.7.0",
32-
"lint-staged": "^15.2.11",
32+
"lint-staged": "^15.3.0",
3333
"mocha": "^10.8.2",
3434
"prettier": "^3.4.2",
3535
"shx": "^0.3.4",

src/types/llmService/LLMService.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
* Licensed under the BSD 3-Clause license.
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
7+
8+
/**
9+
* Interface representing a service for calling a Large Language Model (LLM).
10+
*/
711
export interface LLMServiceInterface {
8-
callLLM(engineeredPrompt: string, promptId?: string): Promise<string>;
12+
/**
13+
* Calls the LLM with the provided engineered prompt, prompt ID, and input token limit.
14+
* @param engineeredPrompt - The prompt that has been engineered for the LLM.
15+
* @param promptId - The ID of the prompt (optional).
16+
* @param outputTokenLimit - The limit on the number of output tokens (optional).
17+
* @returns A promise that resolves to the LLM's response as a string.
18+
*/
19+
callLLM(
20+
engineeredPrompt: string,
21+
promptId?: string,
22+
outputTokenLimit?: number
23+
): Promise<string>;
924
}

yarn.lock

+37-37
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,14 @@
303303
resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz"
304304
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
305305

306-
"@commitlint/cli@^19.6.0":
307-
version "19.6.0"
308-
resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-19.6.0.tgz#98e7fc8501cc38b6eef4b7f61e19b15f3c53700e"
309-
integrity sha512-v17BgGD9w5KnthaKxXnEg6KLq6DYiAxyiN44TpiRtqyW8NSq+Kx99mkEG8Qo6uu6cI5eMzMojW2muJxjmPnF8w==
306+
"@commitlint/cli@^19.6.1":
307+
version "19.6.1"
308+
resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-19.6.1.tgz#24edd26595d911cc6b680cdfbb1fb083bfd5f73d"
309+
integrity sha512-8hcyA6ZoHwWXC76BoC8qVOSr8xHy00LZhZpauiD0iO0VYbVhMnED0da85lTfIULxl7Lj4c6vZgF0Wu/ed1+jlQ==
310310
dependencies:
311311
"@commitlint/format" "^19.5.0"
312312
"@commitlint/lint" "^19.6.0"
313-
"@commitlint/load" "^19.5.0"
313+
"@commitlint/load" "^19.6.1"
314314
"@commitlint/read" "^19.5.0"
315315
"@commitlint/types" "^19.5.0"
316316
tinyexec "^0.3.0"
@@ -375,18 +375,18 @@
375375
"@commitlint/rules" "^19.6.0"
376376
"@commitlint/types" "^19.5.0"
377377

378-
"@commitlint/load@>6.1.1", "@commitlint/load@^19.5.0":
379-
version "19.5.0"
380-
resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-19.5.0.tgz#67f90a294894d1f99b930b6152bed2df44a81794"
381-
integrity sha512-INOUhkL/qaKqwcTUvCE8iIUf5XHsEPCLY9looJ/ipzi7jtGhgmtH7OOFiNvwYgH7mA8osUWOUDV8t4E2HAi4xA==
378+
"@commitlint/load@>6.1.1", "@commitlint/load@^19.6.1":
379+
version "19.6.1"
380+
resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-19.6.1.tgz#5fae8843a6048a2d3d1cc16da0af8ee532fa9db4"
381+
integrity sha512-kE4mRKWWNju2QpsCWt428XBvUH55OET2N4QKQ0bF85qS/XbsRGG1MiTByDNlEVpEPceMkDr46LNH95DtRwcsfA==
382382
dependencies:
383383
"@commitlint/config-validator" "^19.5.0"
384384
"@commitlint/execute-rule" "^19.5.0"
385385
"@commitlint/resolve-extends" "^19.5.0"
386386
"@commitlint/types" "^19.5.0"
387387
chalk "^5.3.0"
388388
cosmiconfig "^9.0.0"
389-
cosmiconfig-typescript-loader "^5.0.0"
389+
cosmiconfig-typescript-loader "^6.1.0"
390390
lodash.isplainobject "^4.0.6"
391391
lodash.merge "^4.6.2"
392392
lodash.uniq "^4.5.0"
@@ -922,10 +922,10 @@
922922
expect "^29.0.0"
923923
pretty-format "^29.0.0"
924924

925-
"@types/node@*", "@types/node@^20.17.10":
926-
version "20.17.10"
927-
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.10.tgz#3f7166190aece19a0d1d364d75c8b0b5778c1e18"
928-
integrity sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==
925+
"@types/node@*", "@types/node@^20.17.11":
926+
version "20.17.11"
927+
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.11.tgz#2c05215fc37316b1596df7fbdba52151eaf83c50"
928+
integrity sha512-Ept5glCK35R8yeyIeYlRIZtX6SLRyqMhOFTgj5SOkMpLTdw3SEHI9fHx60xaUZ+V1aJxQJODE+7/j5ocZydYTg==
929929
dependencies:
930930
undici-types "~6.19.2"
931931

@@ -1415,10 +1415,10 @@ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1:
14151415
ansi-styles "^4.1.0"
14161416
supports-color "^7.1.0"
14171417

1418-
chalk@^5.3.0, chalk@~5.3.0:
1419-
version "5.3.0"
1420-
resolved "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz"
1421-
integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==
1418+
chalk@^5.3.0, chalk@~5.4.1:
1419+
version "5.4.1"
1420+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8"
1421+
integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==
14221422

14231423
char-regex@^1.0.2:
14241424
version "1.0.2"
@@ -1579,12 +1579,12 @@ commitizen@^4.0.3:
15791579
strip-bom "4.0.0"
15801580
strip-json-comments "3.1.1"
15811581

1582-
commitlint@^19.6.0:
1583-
version "19.6.0"
1584-
resolved "https://registry.yarnpkg.com/commitlint/-/commitlint-19.6.0.tgz#175e488bfb1353980d934139ed4c6f6d15a67be2"
1585-
integrity sha512-0gOMRBSpnCw3Su0rfVeDqCe4ck/fkhGGC9UxVDeSyyCemFXs4U3BDuwMWvYcw4qsEAkPuDjQNoU8KWyPtHBq/w==
1582+
commitlint@^19.6.1:
1583+
version "19.6.1"
1584+
resolved "https://registry.yarnpkg.com/commitlint/-/commitlint-19.6.1.tgz#8fbfc2ee8cd62172360923679287841b536ee271"
1585+
integrity sha512-tU4or+Y2fDXepCZ44o8guEB9uwrRp4if4VupGH1CR+bsVS2zX6Gia4dndA7UPx8cWWw1tvRRJu5keA7RqfXf3w==
15861586
dependencies:
1587-
"@commitlint/cli" "^19.6.0"
1587+
"@commitlint/cli" "^19.6.1"
15881588
"@commitlint/types" "^19.5.0"
15891589

15901590
compare-func@^2.0.0:
@@ -1639,12 +1639,12 @@ core-util-is@~1.0.0:
16391639
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
16401640
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
16411641

1642-
cosmiconfig-typescript-loader@^5.0.0:
1643-
version "5.0.0"
1644-
resolved "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-5.0.0.tgz"
1645-
integrity sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==
1642+
cosmiconfig-typescript-loader@^6.1.0:
1643+
version "6.1.0"
1644+
resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-6.1.0.tgz#7f644503e1c2bff90aed2d29a637008f279646bb"
1645+
integrity sha512-tJ1w35ZRUiM5FeTzT7DtYWAFFv37ZLqSRkGi2oeCK1gPhvaWjkAtfXvLmvE1pRfxxp9aQo6ba/Pvg1dKj05D4g==
16461646
dependencies:
1647-
jiti "^1.19.1"
1647+
jiti "^2.4.1"
16481648

16491649
cosmiconfig@^9.0.0:
16501650
version "9.0.0"
@@ -3090,10 +3090,10 @@ jest@^29.7.0:
30903090
import-local "^3.0.2"
30913091
jest-cli "^29.7.0"
30923092

3093-
jiti@^1.19.1:
3094-
version "1.21.0"
3095-
resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz"
3096-
integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==
3093+
jiti@^2.4.1:
3094+
version "2.4.2"
3095+
resolved "https://registry.yarnpkg.com/jiti/-/jiti-2.4.2.tgz#d19b7732ebb6116b06e2038da74a55366faef560"
3096+
integrity sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==
30973097

30983098
js-tokens@^4.0.0:
30993099
version "4.0.0"
@@ -3204,12 +3204,12 @@ lines-and-columns@^1.1.6:
32043204
resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz"
32053205
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
32063206

3207-
lint-staged@^15.2.11:
3208-
version "15.2.11"
3209-
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.11.tgz#e88440982f4a4c1d55a9a7a839259ec3806bd81b"
3210-
integrity sha512-Ev6ivCTYRTGs9ychvpVw35m/bcNDuBN+mnTeObCL5h+boS5WzBEC6LHI4I9F/++sZm1m+J2LEiy0gxL/R9TBqQ==
3207+
lint-staged@^15.3.0:
3208+
version "15.3.0"
3209+
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.3.0.tgz#32a0b3f2f2b8825950bd3b9fb093e045353bdfa3"
3210+
integrity sha512-vHFahytLoF2enJklgtOtCtIjZrKD/LoxlaUusd5nh7dWv/dkKQJY74ndFSzxCdv7g0ueGg1ORgTSt4Y9LPZn9A==
32113211
dependencies:
3212-
chalk "~5.3.0"
3212+
chalk "~5.4.1"
32133213
commander "~12.1.0"
32143214
debug "~4.4.0"
32153215
execa "~8.0.1"

0 commit comments

Comments
 (0)