Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/cacheSalt.ts
13383 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
// These values are used as input for computing sha256 hashes for caching.
7
// Bump them to regenerate new cache entries or when the cache object shape changes.
8
9
/**
10
* Used for all ChatML requests (all models).
11
*/
12
export const CHAT_ML_CACHE_SALT_PER_MODEL: Record<string, string> = {
13
'DEFAULT': '2024-07-04T07:37:00Z',
14
'copilot-nes-oct': '2026-02-10T12:14:18.526Z',
15
};
16
17
/**
18
* Used for all NES requests.
19
*/
20
export const OPENAI_FETCHER_CACHE_SALT: { getByUrl: (url: string) => string } = new class {
21
private readonly _cacheSaltByUrl: Record<string, string> = Object.freeze({
22
// Other endpoints
23
'DEFAULT': '2024-09-25T11:25:00Z',
24
});
25
26
getByUrl(url: string): string {
27
if (url in this._cacheSaltByUrl) {
28
return this._cacheSaltByUrl[url];
29
} else {
30
return this._cacheSaltByUrl['DEFAULT'];
31
}
32
}
33
};
34
35
/**
36
* Used for all Code Search requests.
37
*/
38
export const CODE_SEARCH_CACHE_SALT = '';
39
40
/**
41
* Used for all diagnostics providers.
42
*/
43
export const CACHING_DIAGNOSTICS_PROVIDER_CACHE_SALT = 4;
44
45
/**
46
* Used by the clang diagnostics provider.
47
*/
48
export const CLANG_DIAGNOSTICS_PROVIDER_CACHE_SALT = 5;
49
50
/**
51
* Used by the TS diagnostics provider.
52
*/
53
export const TS_SERVER_DIAGNOSTICS_PROVIDER_CACHE_SALT = 5;
54
55
/**
56
* Used by `isValidPythonFile`.
57
*/
58
export const PYTHON_VALID_SYNTAX_CACHE_SALT = 2;
59
60
/**
61
* Used by `canExecutePythonCodeWithoutErrors`.
62
*/
63
export const PYTHON_EXECUTES_WITHOUT_ERRORS = 2;
64
65
/**
66
* Used by `isValidNotebookCell`.
67
*/
68
export const NOTEBOOK_CELL_VALID_CACHE_SALT = 1;
69
70
71
/**
72
* Used for all Chunking Endpoint requests.
73
*/
74
export const CHUNKING_ENDPOINT_CACHE_SALT = '';
75
76