@vscode/chat-lib 0.0.5-1 → 0.0.5-10

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.
Files changed (192) hide show
  1. package/dist/src/_internal/extension/byok/node/openAIEndpoint.d.ts +7 -2
  2. package/dist/src/_internal/extension/byok/node/openAIEndpoint.d.ts.map +1 -1
  3. package/dist/src/_internal/extension/byok/node/openAIEndpoint.js +16 -5
  4. package/dist/src/_internal/extension/byok/node/openAIEndpoint.js.map +1 -1
  5. package/dist/src/_internal/extension/common/constants.d.ts +1 -0
  6. package/dist/src/_internal/extension/common/constants.d.ts.map +1 -1
  7. package/dist/src/_internal/extension/common/constants.js.map +1 -1
  8. package/dist/src/_internal/extension/inlineEdits/common/jumpToCursorPosition.d.ts +2 -0
  9. package/dist/src/_internal/extension/inlineEdits/common/jumpToCursorPosition.d.ts.map +1 -0
  10. package/dist/src/_internal/extension/inlineEdits/common/jumpToCursorPosition.js +9 -0
  11. package/dist/src/_internal/extension/inlineEdits/common/jumpToCursorPosition.js.map +1 -0
  12. package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.d.ts +1 -0
  13. package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.d.ts.map +1 -1
  14. package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts.map +1 -1
  15. package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js +70 -9
  16. package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js.map +1 -1
  17. package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.d.ts.map +1 -1
  18. package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js +2 -0
  19. package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js.map +1 -1
  20. package/dist/src/_internal/extension/inlineEdits/node/nextEditResult.d.ts +4 -0
  21. package/dist/src/_internal/extension/inlineEdits/node/nextEditResult.d.ts.map +1 -1
  22. package/dist/src/_internal/extension/inlineEdits/node/nextEditResult.js.map +1 -1
  23. package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts.map +1 -1
  24. package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js +18 -6
  25. package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js.map +1 -1
  26. package/dist/src/_internal/extension/xtab/node/xtabEndpoint.d.ts.map +1 -1
  27. package/dist/src/_internal/extension/xtab/node/xtabEndpoint.js.map +1 -1
  28. package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts +2 -1
  29. package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts.map +1 -1
  30. package/dist/src/_internal/extension/xtab/node/xtabProvider.js +77 -33
  31. package/dist/src/_internal/extension/xtab/node/xtabProvider.js.map +1 -1
  32. package/dist/src/_internal/platform/authentication/common/copilotToken.d.ts +3 -1
  33. package/dist/src/_internal/platform/authentication/common/copilotToken.d.ts.map +1 -1
  34. package/dist/src/_internal/platform/authentication/common/copilotToken.js +3 -0
  35. package/dist/src/_internal/platform/authentication/common/copilotToken.js.map +1 -1
  36. package/dist/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.d.ts +1 -3
  37. package/dist/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.d.ts.map +1 -1
  38. package/dist/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.js +8 -14
  39. package/dist/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.js.map +1 -1
  40. package/dist/src/_internal/platform/authentication/node/copilotTokenManager.d.ts +25 -11
  41. package/dist/src/_internal/platform/authentication/node/copilotTokenManager.d.ts.map +1 -1
  42. package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js +71 -24
  43. package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js.map +1 -1
  44. package/dist/src/_internal/platform/chat/common/commonTypes.d.ts +6 -1
  45. package/dist/src/_internal/platform/chat/common/commonTypes.d.ts.map +1 -1
  46. package/dist/src/_internal/platform/chat/common/commonTypes.js +4 -0
  47. package/dist/src/_internal/platform/chat/common/commonTypes.js.map +1 -1
  48. package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +11 -5
  49. package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
  50. package/dist/src/_internal/platform/configuration/common/configurationService.js +15 -9
  51. package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
  52. package/dist/src/_internal/platform/editing/common/notebookDocumentSnapshot.d.ts +3 -3
  53. package/dist/src/_internal/platform/editing/common/notebookDocumentSnapshot.d.ts.map +1 -1
  54. package/dist/src/_internal/platform/editing/common/notebookDocumentSnapshot.js +11 -6
  55. package/dist/src/_internal/platform/editing/common/notebookDocumentSnapshot.js.map +1 -1
  56. package/dist/src/_internal/platform/editing/common/textDocumentSnapshot.d.ts +1 -1
  57. package/dist/src/_internal/platform/editing/common/textDocumentSnapshot.d.ts.map +1 -1
  58. package/dist/src/_internal/platform/editing/common/textDocumentSnapshot.js +1 -1
  59. package/dist/src/_internal/platform/editing/common/textDocumentSnapshot.js.map +1 -1
  60. package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts +6 -1
  61. package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts.map +1 -1
  62. package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js +28 -20
  63. package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js.map +1 -1
  64. package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts +9 -2
  65. package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts.map +1 -1
  66. package/dist/src/_internal/platform/endpoint/common/endpointProvider.js.map +1 -1
  67. package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.d.ts +30 -0
  68. package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.d.ts.map +1 -0
  69. package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.js +118 -0
  70. package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.js.map +1 -0
  71. package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts +3 -4
  72. package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts.map +1 -1
  73. package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js +41 -70
  74. package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js.map +1 -1
  75. package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts +9 -0
  76. package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts.map +1 -1
  77. package/dist/src/_internal/platform/endpoint/node/responsesApi.js +35 -30
  78. package/dist/src/_internal/platform/endpoint/node/responsesApi.js.map +1 -1
  79. package/dist/src/_internal/platform/github/common/githubAPI.d.ts +3 -1
  80. package/dist/src/_internal/platform/github/common/githubAPI.d.ts.map +1 -1
  81. package/dist/src/_internal/platform/github/common/githubAPI.js +15 -0
  82. package/dist/src/_internal/platform/github/common/githubAPI.js.map +1 -1
  83. package/dist/src/_internal/platform/github/common/githubService.d.ts +19 -0
  84. package/dist/src/_internal/platform/github/common/githubService.d.ts.map +1 -1
  85. package/dist/src/_internal/platform/github/common/githubService.js +13 -0
  86. package/dist/src/_internal/platform/github/common/githubService.js.map +1 -1
  87. package/dist/src/_internal/platform/inlineCompletions/common/api.d.ts +5 -0
  88. package/dist/src/_internal/platform/inlineCompletions/common/api.d.ts.map +1 -1
  89. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/nextCursorLinePrediction.d.ts +6 -0
  90. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/nextCursorLinePrediction.d.ts.map +1 -0
  91. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/nextCursorLinePrediction.js +14 -0
  92. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/nextCursorLinePrediction.js.map +1 -0
  93. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.d.ts +8 -0
  94. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.d.ts.map +1 -1
  95. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.js +26 -1
  96. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.js.map +1 -1
  97. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts +7 -1
  98. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts.map +1 -1
  99. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js +7 -1
  100. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js.map +1 -1
  101. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.d.ts +5 -1
  102. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.d.ts.map +1 -1
  103. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.js +45 -0
  104. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.js.map +1 -1
  105. package/dist/src/_internal/platform/languageServer/common/languageContextService.d.ts +12 -0
  106. package/dist/src/_internal/platform/languageServer/common/languageContextService.d.ts.map +1 -1
  107. package/dist/src/_internal/platform/languageServer/common/languageContextService.js.map +1 -1
  108. package/dist/src/_internal/platform/networking/common/fetcherService.d.ts +1 -0
  109. package/dist/src/_internal/platform/networking/common/fetcherService.d.ts.map +1 -1
  110. package/dist/src/_internal/platform/networking/common/fetcherService.js.map +1 -1
  111. package/dist/src/_internal/platform/networking/common/networking.d.ts +6 -1
  112. package/dist/src/_internal/platform/networking/common/networking.d.ts.map +1 -1
  113. package/dist/src/_internal/platform/networking/common/networking.js +2 -0
  114. package/dist/src/_internal/platform/networking/common/networking.js.map +1 -1
  115. package/dist/src/_internal/platform/networking/common/openai.d.ts +1 -0
  116. package/dist/src/_internal/platform/networking/common/openai.d.ts.map +1 -1
  117. package/dist/src/_internal/platform/networking/node/chatStream.d.ts.map +1 -1
  118. package/dist/src/_internal/platform/networking/node/chatStream.js +1 -0
  119. package/dist/src/_internal/platform/networking/node/chatStream.js.map +1 -1
  120. package/dist/src/_internal/platform/networking/node/stream.d.ts +2 -0
  121. package/dist/src/_internal/platform/networking/node/stream.d.ts.map +1 -1
  122. package/dist/src/_internal/platform/networking/node/stream.js +5 -4
  123. package/dist/src/_internal/platform/networking/node/stream.js.map +1 -1
  124. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.d.ts +5 -0
  125. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.d.ts.map +1 -1
  126. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.js.map +1 -1
  127. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.json.d.ts +1 -0
  128. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.json.d.ts.map +1 -1
  129. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.json.js +3 -0
  130. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.json.js.map +1 -1
  131. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.text.d.ts +1 -0
  132. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.text.d.ts.map +1 -1
  133. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.text.js +32 -1
  134. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.text.js.map +1 -1
  135. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.xml.d.ts +1 -0
  136. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.xml.d.ts.map +1 -1
  137. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.xml.js +24 -1
  138. package/dist/src/_internal/platform/notebook/common/alternativeContentProvider.xml.js.map +1 -1
  139. package/dist/src/_internal/platform/openai/node/fetch.js +2 -0
  140. package/dist/src/_internal/platform/openai/node/fetch.js.map +1 -1
  141. package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts +5 -42
  142. package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts.map +1 -1
  143. package/dist/src/_internal/platform/requestLogger/node/requestLogger.js +1 -40
  144. package/dist/src/_internal/platform/requestLogger/node/requestLogger.js.map +1 -1
  145. package/dist/src/_internal/util/common/crypto.d.ts +1 -0
  146. package/dist/src/_internal/util/common/crypto.d.ts.map +1 -1
  147. package/dist/src/_internal/util/common/crypto.js +10 -0
  148. package/dist/src/_internal/util/common/crypto.js.map +1 -1
  149. package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts +12 -0
  150. package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts.map +1 -1
  151. package/dist/src/_internal/util/common/test/shims/chatTypes.js +18 -2
  152. package/dist/src/_internal/util/common/test/shims/chatTypes.js.map +1 -1
  153. package/dist/src/_internal/util/common/test/shims/enums.d.ts +5 -0
  154. package/dist/src/_internal/util/common/test/shims/enums.d.ts.map +1 -1
  155. package/dist/src/_internal/util/common/test/shims/enums.js +7 -1
  156. package/dist/src/_internal/util/common/test/shims/enums.js.map +1 -1
  157. package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.d.ts.map +1 -1
  158. package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js +3 -1
  159. package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js.map +1 -1
  160. package/dist/src/_internal/vscodeTypes.d.ts +2 -0
  161. package/dist/src/_internal/vscodeTypes.d.ts.map +1 -1
  162. package/dist/src/_internal/vscodeTypes.js +4 -2
  163. package/dist/src/_internal/vscodeTypes.js.map +1 -1
  164. package/dist/src/main.d.ts.map +1 -1
  165. package/dist/src/main.js +2 -2
  166. package/dist/src/main.js.map +1 -1
  167. package/dist/src/package.json +231 -87
  168. package/package.json +3 -3
  169. package/dist/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.d.ts +0 -16
  170. package/dist/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.d.ts.map +0 -1
  171. package/dist/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.js +0 -147
  172. package/dist/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.js.map +0 -1
  173. package/dist/src/_internal/platform/nesFetch/common/completionsAPI.d.ts +0 -69
  174. package/dist/src/_internal/platform/nesFetch/common/completionsAPI.d.ts.map +0 -1
  175. package/dist/src/_internal/platform/nesFetch/common/completionsAPI.js +0 -23
  176. package/dist/src/_internal/platform/nesFetch/common/completionsAPI.js.map +0 -1
  177. package/dist/src/_internal/platform/nesFetch/common/completionsFetchService.d.ts +0 -80
  178. package/dist/src/_internal/platform/nesFetch/common/completionsFetchService.d.ts.map +0 -1
  179. package/dist/src/_internal/platform/nesFetch/common/completionsFetchService.js +0 -77
  180. package/dist/src/_internal/platform/nesFetch/common/completionsFetchService.js.map +0 -1
  181. package/dist/src/_internal/platform/nesFetch/common/responseStream.d.ts +0 -26
  182. package/dist/src/_internal/platform/nesFetch/common/responseStream.d.ts.map +0 -1
  183. package/dist/src/_internal/platform/nesFetch/common/responseStream.js +0 -125
  184. package/dist/src/_internal/platform/nesFetch/common/responseStream.js.map +0 -1
  185. package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.d.ts +0 -27
  186. package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.d.ts.map +0 -1
  187. package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.js +0 -222
  188. package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.js.map +0 -1
  189. package/dist/src/_internal/platform/nesFetch/node/streamTransformer.d.ts +0 -10
  190. package/dist/src/_internal/platform/nesFetch/node/streamTransformer.d.ts.map +0 -1
  191. package/dist/src/_internal/platform/nesFetch/node/streamTransformer.js +0 -86
  192. package/dist/src/_internal/platform/nesFetch/node/streamTransformer.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/chat-lib",
3
- "version": "0.0.5-1",
3
+ "version": "0.0.5-10",
4
4
  "description": "Chat and inline editing SDK extracted from VS Code Copilot Chat",
5
5
  "main": "dist/src/main.js",
6
6
  "types": "dist/src/main.d.ts",
@@ -15,11 +15,11 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@microsoft/tiktokenizer": "^1.0.10",
18
- "@vscode/copilot-api": "^0.1.12",
18
+ "@vscode/copilot-api": "^0.1.13",
19
19
  "@vscode/l10n": "^0.0.18",
20
20
  "@vscode/prompt-tsx": "^0.4.0-alpha.5",
21
21
  "jsonc-parser": "^3.3.1",
22
- "openai": "^5.11.0",
22
+ "openai": "^6.7.0",
23
23
  "web-tree-sitter": "^0.23.0",
24
24
  "yaml": "^2.8.0"
25
25
  },
@@ -1,16 +0,0 @@
1
- import { StatelessNextEditDocument } from '../../../platform/inlineEdits/common/statelessNextEditProvider';
2
- import { LineEdit } from '../../../util/vs/editor/common/core/edits/lineEdit';
3
- import { StringEdit } from '../../../util/vs/editor/common/core/edits/stringEdit';
4
- export declare function editWouldDeleteWhatWasJustInserted(activeDocument: StatelessNextEditDocument, lineEdit: LineEdit): boolean;
5
- /**
6
- * Represents information loss/gain (4-grams) via an edit.
7
- */
8
- export declare class InformationDelta {
9
- readonly inserted: Set<string>;
10
- readonly deleted: Set<string>;
11
- constructor(inserted?: Set<string>, deleted?: Set<string>);
12
- combine(other: InformationDelta): InformationDelta;
13
- isUndoneBy(other: InformationDelta): boolean;
14
- }
15
- export declare function getInformationDelta(source: string, edit: StringEdit): InformationDelta;
16
- //# sourceMappingURL=ghNearbyNesProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ghNearbyNesProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAC;AAKlF,wBAAgB,kCAAkC,CAAC,cAAc,EAAE,yBAAyB,EAAE,QAAQ,EAAE,QAAQ,WAkB/G;AAQD;;GAEG;AACH,qBAAa,gBAAgB;aAGX,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC;aACrB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC;gBADpB,QAAQ,GAAE,GAAG,CAAC,MAAM,CAAqB,EACzC,OAAO,GAAE,GAAG,CAAC,MAAM,CAAqB;IAGzD,OAAO,CAAC,KAAK,EAAE,gBAAgB;IAI/B,UAAU,CAAC,KAAK,EAAE,gBAAgB;CAiBlC;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,gBAAgB,CAuCtF"}
@@ -1,147 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the MIT License. See License.txt in the project root for license information.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.InformationDelta = void 0;
8
- exports.editWouldDeleteWhatWasJustInserted = editWouldDeleteWhatWasJustInserted;
9
- exports.getInformationDelta = getInformationDelta;
10
- const N_GRAM_UNDO_RATIO_TO_FILTER_OUT = 0.7;
11
- function editWouldDeleteWhatWasJustInserted(activeDocument, lineEdit) {
12
- let edit = lineEdit.toEdit(activeDocument.documentAfterEdits);
13
- // ! important: reduce it to the minimal set of changes
14
- edit = edit.normalizeOnSource(activeDocument.documentAfterEdits.value);
15
- if (!editIsDeletion(edit)) {
16
- return false;
17
- }
18
- // We are deleting something. Is it what was just inserted?
19
- for (let i = activeDocument.recentEdits.edits.length - 1; i >= 0; i--) {
20
- const recentEdit = activeDocument.recentEdits.edits[i];
21
- const rebaseResult = edit.tryRebase(recentEdit);
22
- if (!rebaseResult) {
23
- // the edit we want to do cannot be rebased, which indicates that it would interfere with a recent edit
24
- return true;
25
- }
26
- edit = rebaseResult;
27
- }
28
- return false;
29
- }
30
- function editIsDeletion(edit) {
31
- const deletedChars = edit.replacements.reduce((acc, singleEdit) => acc + singleEdit.replaceRange.length, 0);
32
- const insertedChars = edit.replacements.reduce((acc, singleEdit) => acc + singleEdit.newText.length, 0);
33
- return insertedChars === 0 && deletedChars > 0;
34
- }
35
- /**
36
- * Represents information loss/gain (4-grams) via an edit.
37
- */
38
- class InformationDelta {
39
- constructor(inserted = new Set(), deleted = new Set()) {
40
- this.inserted = inserted;
41
- this.deleted = deleted;
42
- }
43
- combine(other) {
44
- return new InformationDelta(setUnion(this.inserted, other.inserted), setUnion(this.deleted, other.deleted));
45
- }
46
- isUndoneBy(other) {
47
- const otherReallyNewInsertions = setMinus(other.inserted, other.deleted);
48
- const otherReallyDeleted = setMinus(other.deleted, other.inserted);
49
- const otherReallyDeletesMyInserts = setIntersectionCount(otherReallyDeleted, this.inserted);
50
- const otherReallyInsertsMyDeletes = setIntersectionCount(otherReallyNewInsertions, this.deleted);
51
- if (otherReallyDeleted.size > 6 && otherReallyDeletesMyInserts / otherReallyDeleted.size > N_GRAM_UNDO_RATIO_TO_FILTER_OUT) {
52
- return true;
53
- }
54
- if (otherReallyNewInsertions.size > 6 && otherReallyInsertsMyDeletes / otherReallyNewInsertions.size > N_GRAM_UNDO_RATIO_TO_FILTER_OUT) {
55
- return true;
56
- }
57
- return false;
58
- }
59
- }
60
- exports.InformationDelta = InformationDelta;
61
- function getInformationDelta(source, edit) {
62
- const inserted = new Set();
63
- const deleted = new Set();
64
- const tryAddDeleted = (deletedRange) => {
65
- if (!deletedRange) {
66
- return;
67
- }
68
- const deletedText = source.substring(deletedRange.start, deletedRange.endExclusive);
69
- for (let line of deletedText.split(/\r\n|\r|\n/)) {
70
- line = line.trim();
71
- for (const piece of to4grams(line)) {
72
- deleted.add(piece);
73
- }
74
- }
75
- };
76
- const tryAddInserted = (insertedText) => {
77
- for (let line of insertedText.split(/\r\n|\r|\n/)) {
78
- line = line.trim();
79
- for (const piece of to4grams(line)) {
80
- inserted.add(piece);
81
- }
82
- }
83
- };
84
- for (const e of edit.replacements) {
85
- const e1 = e.removeCommonPrefix(source).removeCommonSuffix(source);
86
- const e2 = e.removeCommonSuffix(source).removeCommonPrefix(source);
87
- if (e1.isEmpty) {
88
- continue;
89
- }
90
- tryAddDeleted(e1.replaceRange);
91
- tryAddDeleted(e2.replaceRange);
92
- tryAddDeleted(e1.replaceRange.intersect(e2.replaceRange));
93
- // tryAddInserted(e1.newText);
94
- // tryAddInserted(e2.newText);
95
- // e1 might have a suffix overlap with the prefix of e1
96
- tryAddInserted(trimOverlap(e1.newText, e2.newText));
97
- }
98
- return new InformationDelta(inserted, deleted);
99
- }
100
- function trimOverlap(stringToEliminateEnd, stringToEliminateStart) {
101
- const length = Math.min(stringToEliminateEnd.length, stringToEliminateStart.length);
102
- for (let trimLength = 0; trimLength < length; trimLength++) {
103
- const str1 = stringToEliminateEnd.slice(0, stringToEliminateEnd.length - trimLength);
104
- const str2 = stringToEliminateStart.slice(trimLength);
105
- if (str1 === str2) {
106
- return str1;
107
- }
108
- }
109
- return '';
110
- }
111
- function to4grams(text) {
112
- const result = [];
113
- for (let i = 4; i < text.length; i++) {
114
- const ngram = text.slice(i - 4, i);
115
- result.push(ngram);
116
- }
117
- return result;
118
- }
119
- function setUnion(a, b) {
120
- const result = new Set();
121
- for (const el of a) {
122
- result.add(el);
123
- }
124
- for (const el of b) {
125
- result.add(el);
126
- }
127
- return result;
128
- }
129
- function setMinus(a, b) {
130
- const result = new Set();
131
- for (const el of a) {
132
- if (!b.has(el)) {
133
- result.add(el);
134
- }
135
- }
136
- return result;
137
- }
138
- function setIntersectionCount(a, b) {
139
- let result = 0;
140
- for (const el of a) {
141
- if (b.has(el)) {
142
- result++;
143
- }
144
- }
145
- return result;
146
- }
147
- //# sourceMappingURL=ghNearbyNesProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ghNearbyNesProvider.js","sourceRoot":"","sources":["../../../../../../src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAShG,gFAkBC;AAyCD,kDAuCC;AApGD,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAE5C,SAAgB,kCAAkC,CAAC,cAAyC,EAAE,QAAkB;IAC/G,IAAI,IAAI,G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Ac;IAC/C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,CAAc,EAAE,CAAc;IAC/C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAChB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,oBAAoB,CAAC,CAAc,EAAE,CAAc;IAC3D,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YACf,MAAM,EAAE,CAAC;QACV,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}
@@ -1,69 +0,0 @@
1
- /**
2
- * Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).
3
- *
4
- * Based (updated 31.10.2024) on https://platform.openai.com/docs/api-reference/completions/object
5
- * (! except `Choice#finish_reason` can be a null during streaming)
6
- * (! omits `id`, `model`, and `created` for performance)
7
- */
8
- export interface Completion {
9
- /** The list of completion choices the model generated for the input prompt. */
10
- choices: Completion.Choice[];
11
- /** This fingerprint represents the backend configuration that the model runs with. */
12
- system_fingerprint: string;
13
- /** The object type, which is always "text_completion". */
14
- object: string;
15
- /** Usage statistics for the completion request. */
16
- usage: Completion.Usage | undefined;
17
- }
18
- export declare namespace Completion {
19
- interface Choice {
20
- /** The index of the choice. */
21
- index: number;
22
- /** The reason the model stopped generating tokens. */
23
- finish_reason: FinishReason | null;
24
- /** The log probabilities of the tokens. */
25
- logprobs?: LogProbs | null;
26
- /** The generated text. */
27
- text: string | undefined;
28
- }
29
- /**
30
- * The reason the model stopped generating tokens.
31
- */
32
- enum FinishReason {
33
- /** If the model hit a natural stop point or a provided stop sequence. */
34
- Stop = "stop",
35
- /** If the maximum number of tokens specified in the request was reached. */
36
- Length = "length",
37
- /** If content was omitted due to a flag from our content filters. */
38
- ContentFilter = "content_filter"
39
- }
40
- type LogProbs = {
41
- /** The list of tokens generated by the model. */
42
- tokens: string[];
43
- /** The log probabilities of the tokens. */
44
- token_logprobs: number[];
45
- /** The text offsets of the tokens. */
46
- text_offset: number[];
47
- /** The top log probabilities of the tokens. */
48
- top_logprobs: Record<string, number>[];
49
- };
50
- interface Usage {
51
- /** Number of tokens in the generated completion. */
52
- completion_tokens: number;
53
- /** Number of tokens in the prompt. */
54
- prompt_tokens: number;
55
- /** Total number of tokens used in the request (prompt + completion). */
56
- total_tokens: number;
57
- /** Breakdown of tokens used in a completion. */
58
- completion_tokens_details: TokensDetails;
59
- /** Breakdown of tokens used in the prompt. */
60
- prompt_tokens_details: TokensDetails;
61
- }
62
- interface TokensDetails {
63
- /** Audio input tokens present in the prompt. */
64
- audio_tokens: number;
65
- /** Tokens generated by the model for reasoning. */
66
- reasoning_tokens: number;
67
- }
68
- }
69
- //# sourceMappingURL=completionsAPI.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"completionsAPI.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/completionsAPI.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IAC1B,+EAA+E;IAC/E,OAAO,EAAE,UAAU,CAAC,MAAM,EAAE,CAA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"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the MIT License. See License.txt in the project root for license information.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Completion = void 0;
8
- var Completion;
9
- (function (Completion) {
10
- /**
11
- * The reason the model stopped generating tokens.
12
- */
13
- let FinishReason;
14
- (function (FinishReason) {
15
- /** If the model hit a natural stop point or a provided stop sequence. */
16
- FinishReason["Stop"] = "stop";
17
- /** If the maximum number of tokens specified in the request was reached. */
18
- FinishReason["Length"] = "length";
19
- /** If content was omitted due to a flag from our content filters. */
20
- FinishReason["ContentFilter"] = "content_filter";
21
- })(FinishReason = Completion.FinishReason || (Completion.FinishReason = {}));
22
- })(Completion || (exports.Completion = Completion = {}));
23
- //# sourceMappingURL=completionsAPI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"completionsAPI.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/completionsAPI.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAoBhG,IAAiB,UAAU,CAsD1B;AAtDD,WAAiB,UAAU;IAY1B;;OAEG;IACH,IAAY,YAOX;IAPD,WAAY,YAAY;QACvB,yEAAyE;QACzE,6BAAa,CAAA;QACb,4EAA4E;QAC5E,iCAAiB,CAAA;QACjB,qEAAqE;QACrE,gDAAgC,CAAA;IACjC,CAAC,EAPW,YAAY,GAAZ,uBAAY,KAAZ,uBAAY,QAOvB;AAgCF,CAAC,EAtDgB,UAAU,0BAAV,UAAU,QAsD1B"}
@@ -1,80 +0,0 @@
1
- import type { ChatErrorDetails } from 'vscode';
2
- import { Result } from '../../../util/common/result';
3
- import { CancellationToken } from '../../../util/vs/base/common/cancellation';
4
- import { ResponseStream } from './responseStream';
5
- interface BaseCompletionsParams {
6
- prompt: string;
7
- stop?: string[];
8
- top_p?: number;
9
- best_of?: number;
10
- max_tokens?: number;
11
- temperature?: number;
12
- presence_penalty?: number;
13
- frequency_penalty?: number;
14
- model?: string;
15
- logprobs?: number;
16
- n?: number;
17
- stream: true;
18
- }
19
- interface CodexV2Params {
20
- suffix?: string;
21
- extra?: {
22
- [key: string]: any;
23
- };
24
- code_annotations?: boolean;
25
- }
26
- export interface ModelParams extends BaseCompletionsParams, CodexV2Params {
27
- }
28
- export type FetchOptions = {
29
- requestId: string;
30
- headers: {
31
- [name: string]: string;
32
- };
33
- body: any;
34
- };
35
- export type CompletionsFetchFailure = {
36
- kind: 'cancelled';
37
- } | {
38
- kind: 'model_overloaded';
39
- } | {
40
- kind: 'model_error';
41
- } | {
42
- kind: 'not-registered';
43
- } | {
44
- kind: 'not-configured';
45
- } | {
46
- kind: 'quota-exceeded';
47
- } | {
48
- kind: 'context-window-exceeded';
49
- /** Message we get in response body. */
50
- message: string;
51
- } | {
52
- kind: 'invalid-api-key';
53
- /** Message we get in response body. */
54
- message: string;
55
- } | {
56
- kind: 'exceeded-rate-limit';
57
- /** Message we get in response body. */
58
- message: string;
59
- } | {
60
- kind: 'not-200-status';
61
- status: number;
62
- statusText: string;
63
- };
64
- export type CompletionsFetchErrorType = 'stop_content_filter' | 'stop_length' | 'unknown';
65
- export declare class CompletionsFetchError extends Error {
66
- readonly type: CompletionsFetchErrorType;
67
- readonly requestId: string;
68
- constructor(type: CompletionsFetchErrorType, requestId: string, message: string);
69
- }
70
- export declare const ICompletionsFetchService: import("../../../util/common/services").ServiceIdentifier<ICompletionsFetchService>;
71
- /**
72
- * OpenAI has completions and _chat_ completions endpoints. This's (non-chat) completions endpoint fetcher.
73
- */
74
- export interface ICompletionsFetchService {
75
- readonly _serviceBrand: undefined;
76
- fetch(url: string, secretKey: string, params: ModelParams, requestId: string, ct: CancellationToken, headerOverrides?: Record<string, string>): Promise<Result<ResponseStream, CompletionsFetchFailure>>;
77
- }
78
- export declare function getErrorDetailsFromFetchError(requestId: string, error: CompletionsFetchFailure): ChatErrorDetails;
79
- export {};
80
- //# sourceMappingURL=completionsFetchService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"completionsFetchService.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/completionsFetchService.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,UAAU,qBAAqB;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACb;AAED,UAAU,aAAa;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,WAAY,SAAQ,qBAAqB,EAAE,aAAa;CAAI;AAE7E,MAAM,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACpC,IAAI,EAA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,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC,CAAC;CACzM;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,GAAG,gBAAgB,CAuBjH"}
@@ -1,77 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the MIT License. See License.txt in the project root for license information.
5
- *--------------------------------------------------------------------------------------------*/
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || (function () {
23
- var ownKeys = function(o) {
24
- ownKeys = Object.getOwnPropertyNames || function (o) {
25
- var ar = [];
26
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
- return ar;
28
- };
29
- return ownKeys(o);
30
- };
31
- return function (mod) {
32
- if (mod && mod.__esModule) return mod;
33
- var result = {};
34
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
- __setModuleDefault(result, mod);
36
- return result;
37
- };
38
- })();
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.ICompletionsFetchService = exports.CompletionsFetchError = void 0;
41
- exports.getErrorDetailsFromFetchError = getErrorDetailsFromFetchError;
42
- const l10n = __importStar(require("@vscode/l10n"));
43
- const services_1 = require("../../../util/common/services");
44
- class CompletionsFetchError extends Error {
45
- constructor(type, requestId, message) {
46
- super(message);
47
- this.type = type;
48
- this.requestId = requestId;
49
- }
50
- }
51
- exports.CompletionsFetchError = CompletionsFetchError;
52
- exports.ICompletionsFetchService = (0, services_1.createServiceIdentifier)('ICompletionsFetchService');
53
- function getErrorDetailsFromFetchError(requestId, error) {
54
- switch (error.kind) {
55
- case 'cancelled':
56
- return { message: 'Cancelled' };
57
- case 'exceeded-rate-limit':
58
- return {
59
- message: l10n.t(`Sorry, your request was rate-limited. Please wait and try again.`),
60
- responseIsFiltered: true,
61
- };
62
- case 'quota-exceeded':
63
- return {
64
- message: l10n.t(`You've reached your monthly chat messages limit. [Upgrade to Copilot Pro]({0}) (30-day Free Trial) or wait for your limit to reset.`, 'https://aka.ms/github-copilot-upgrade-plan'),
65
- };
66
- case 'model_overloaded':
67
- case 'model_error':
68
- case 'not-registered':
69
- case 'not-200-status':
70
- case 'context-window-exceeded':
71
- case 'invalid-api-key':
72
- case 'not-configured':
73
- default:
74
- return { message: l10n.t(`Sorry, your request failed. Please try again. Request id: {0}`, requestId) };
75
- }
76
- }
77
- //# sourceMappingURL=completionsFetchService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"completionsFetchService.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/completionsFetchService.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FhG,sEAuBC;AAhHD,mDAAqC;AAGrC,4DAAwE;AAiExE,MAAa,qBAAsB,SAAQ,KAAK;IAC/C,YACU,IAA+B,EAC/B,SAAiB,EAC1B,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAJN,SAAI,GAAJ,IAAI,CAA2B;QAC/B,cAAS,GAAT,SAAS,CAAQ;IAI3B,CAAC;CACD;AARD,sDAQC;AAEY,QAAA,wBAAwB,GAAG,IAAA,kCAAuB,EAA2B,0BAA0B,CAAC,CAAC;AAWtH,SAAgB,6BAA6B,CAAC,SAAiB,EAAE,KAA8B;IAC9F,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,WAAW;YACf,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;QACjC,KAAK,qBAAqB;YACzB,OAAO;gBACN,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,kEAAkE,CAAC;gBACnF,kBAAkB,EAAE,IAAI;aACxB,CAAC;QACH,KAAK,gBAAgB;YACpB,OAAO;gBACN,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,qIAAqI,EAAE,4CAA4C,CAAC;aACpM,CAAC;QACH,KAAK,kBAAkB,CAAC;QACxB,KAAK,aAAa,CAAC;QACnB,KAAK,gBAAgB,CAAC;QACtB,KAAK,gBAAgB,CAAC;QACtB,KAAK,yBAAyB,CAAC;QAC/B,KAAK,iBAAiB,CAAC;QACvB,KAAK,gBAAgB,CAAC;QACtB;YACC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,+DAA+D,EAAE,SAAS,CAAC,EAAE,CAAC;IACzG,CAAC;AACF,CAAC"}
@@ -1,26 +0,0 @@
1
- import { Result } from '../../../util/common/result';
2
- import { AsyncIterableObject } from '../../../util/vs/base/common/async';
3
- import { Completion } from './completionsAPI';
4
- export declare class ResponseStream {
5
- /**
6
- * A promise that resolves to the array of completions that were emitted by the stream.
7
- *
8
- * (it's expected to not throw)
9
- */
10
- readonly aggregatedStream: Promise<Result<Completion[], Error>>;
11
- /**
12
- * A completion that aggregates completions stream.
13
- *
14
- * (it's expected to not throw)
15
- */
16
- readonly response: Promise<Result<Completion, Error>>;
17
- /**
18
- * The stream of completions that were emitted by the response.
19
- *
20
- * @throws {Error} if the response stream throws an error.
21
- */
22
- readonly stream: AsyncIterableObject<Completion>;
23
- constructor(stream: AsyncIterable<Completion>);
24
- private static aggregateCompletionsStream;
25
- }
26
- //# sourceMappingURL=responseStream.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"responseStream.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/responseStream.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAmB,MAAM,oCAAoC,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,cAAc;IAC1B;;;;OAIG;IACH,SAAgB,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvE;;;;OAIG;IACH,SAAgB,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7D;;;;OAIG;IACH,SAAgB,MAAM,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;gBAE5C,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC;IAqC7C,OAAO,CAAC,MAAM,CAAC,0BAA0B;CAgFzC"}
@@ -1,125 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the MIT License. See License.txt in the project root for license information.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ResponseStream = void 0;
8
- const result_1 = require("../../../util/common/result");
9
- const async_1 = require("../../../util/vs/base/common/async");
10
- const objects_1 = require("../../../util/vs/base/common/objects");
11
- const types_1 = require("../../../util/vs/base/common/types");
12
- class ResponseStream {
13
- constructor(stream) {
14
- const tokensDeferredPromise = new async_1.DeferredPromise();
15
- this.aggregatedStream = tokensDeferredPromise.p;
16
- this.response = this.aggregatedStream.then((completions) => {
17
- if (completions.isError()) {
18
- return completions;
19
- }
20
- try {
21
- return result_1.Result.ok(ResponseStream.aggregateCompletionsStream(completions.val));
22
- }
23
- catch (err) {
24
- return result_1.Result.error(err);
25
- }
26
- });
27
- this.stream = new async_1.AsyncIterableObject(async (emitter) => {
28
- const completions = [];
29
- let error;
30
- try {
31
- for await (const completion of stream) {
32
- completions.push(completion);
33
- emitter.emitOne(completion);
34
- }
35
- }
36
- catch (e) {
37
- if (e instanceof Error) {
38
- error = e;
39
- }
40
- else {
41
- error = new Error((0, objects_1.safeStringify)(e));
42
- }
43
- emitter.reject(e);
44
- }
45
- finally {
46
- tokensDeferredPromise.complete(error ? result_1.Result.error(error) : result_1.Result.ok(completions));
47
- }
48
- });
49
- }
50
- static aggregateCompletionsStream(stream) {
51
- let text = '';
52
- let finishReason = null;
53
- let aggregatedLogsProbs = null;
54
- let aggregatedUsage = undefined;
55
- for (const completion of stream) {
56
- const choice = completion.choices[0]; // TODO@ulugbekna: we only support choice.index=0
57
- text += choice.text ?? '';
58
- if (choice.logprobs) {
59
- if (aggregatedLogsProbs === null) {
60
- aggregatedLogsProbs = {
61
- tokens: [...choice.logprobs.tokens],
62
- token_logprobs: [...choice.logprobs.token_logprobs],
63
- text_offset: [...choice.logprobs.text_offset],
64
- top_logprobs: [...choice.logprobs.top_logprobs],
65
- };
66
- }
67
- else {
68
- aggregatedLogsProbs.tokens.push(...choice.logprobs.tokens);
69
- aggregatedLogsProbs.token_logprobs.push(...choice.logprobs.token_logprobs);
70
- aggregatedLogsProbs.text_offset.push(...choice.logprobs.text_offset);
71
- aggregatedLogsProbs.top_logprobs.push(...choice.logprobs.top_logprobs);
72
- }
73
- }
74
- if (completion.usage) {
75
- if (aggregatedUsage === undefined) {
76
- aggregatedUsage = {
77
- completion_tokens: completion.usage.completion_tokens,
78
- prompt_tokens: completion.usage.prompt_tokens,
79
- total_tokens: completion.usage.total_tokens,
80
- completion_tokens_details: {
81
- audio_tokens: completion.usage.completion_tokens_details.audio_tokens,
82
- reasoning_tokens: completion.usage.completion_tokens_details.reasoning_tokens,
83
- },
84
- prompt_tokens_details: {
85
- audio_tokens: completion.usage.prompt_tokens_details.audio_tokens,
86
- reasoning_tokens: completion.usage.prompt_tokens_details.reasoning_tokens,
87
- }
88
- };
89
- }
90
- else {
91
- aggregatedUsage.completion_tokens += completion.usage.completion_tokens;
92
- aggregatedUsage.prompt_tokens += completion.usage.prompt_tokens;
93
- aggregatedUsage.total_tokens += completion.usage.total_tokens;
94
- aggregatedUsage.completion_tokens_details.audio_tokens += completion.usage.completion_tokens_details.audio_tokens;
95
- aggregatedUsage.completion_tokens_details.reasoning_tokens += completion.usage.completion_tokens_details.reasoning_tokens;
96
- aggregatedUsage.prompt_tokens_details.audio_tokens += completion.usage.prompt_tokens_details.audio_tokens;
97
- aggregatedUsage.prompt_tokens_details.reasoning_tokens += completion.usage.prompt_tokens_details.reasoning_tokens;
98
- }
99
- }
100
- if (choice.finish_reason) {
101
- (0, types_1.assertType)(finishReason === null, 'cannot already have finishReason if just seeing choice.finish_reason');
102
- finishReason = choice.finish_reason;
103
- }
104
- }
105
- if (stream.length === 0) {
106
- throw new Error(`Response is empty!`);
107
- }
108
- const completion = stream[0];
109
- const choice = {
110
- index: 0,
111
- finish_reason: finishReason,
112
- logprobs: aggregatedLogsProbs,
113
- text,
114
- };
115
- const aggregatedCompletion = {
116
- choices: [choice],
117
- system_fingerprint: completion.system_fingerprint,
118
- object: completion.object,
119
- usage: aggregatedUsage,
120
- };
121
- return aggregatedCompletion;
122
- }
123
- }
124
- exports.ResponseStream = ResponseStream;
125
- //# sourceMappingURL=responseStream.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"responseStream.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/responseStream.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,wDAAqD;AACrD,8DAA0F;AAC1F,kEAAqE;AACrE,8DAAgE;AAGhE,MAAa,cAAc;IAsB1B,YAAY,MAAiC;QAC5C,MAAM,qBAA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