@mate-academy/llm-gateway 6.1.0 → 6.2.0
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/LLMService.constants.d.ts +291 -1
- package/dist/LLMService.constants.js +2 -1
- package/dist/LLMService.constants.js.map +1 -1
- package/dist/LLMService.typedefs.d.ts +9 -0
- package/dist/LLMService.typedefs.js.map +1 -1
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.d.ts +8 -7
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js +217 -31
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js.map +1 -1
- package/dist/providers/LLMAPI/LLMAPI.constants.d.ts +292 -3
- package/dist/providers/LLMAPI/LLMAPI.constants.js +2 -2
- package/dist/providers/LLMAPI/LLMAPI.constants.js.map +1 -1
- package/dist/providers/LLMAPI/LLMAPI.entity.d.ts +6 -0
- package/dist/providers/LLMAPI/LLMAPI.entity.js +49 -0
- package/dist/providers/LLMAPI/LLMAPI.entity.js.map +1 -0
- package/dist/providers/LLMAPI/index.d.ts +1 -0
- package/dist/providers/LLMAPI/index.js +1 -0
- package/dist/providers/LLMAPI/index.js.map +1 -1
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.d.ts +34 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js +497 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js.map +1 -0
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.d.ts +3 -1
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.js +18 -2
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.js.map +1 -1
- package/dist/providers/LLMAPI/services/index.d.ts +1 -0
- package/dist/providers/LLMAPI/services/index.js +1 -0
- package/dist/providers/LLMAPI/services/index.js.map +1 -1
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.d.ts +9 -7
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.js +209 -40
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.js.map +1 -1
- package/dist/services/LLMAssistanceService.abstract.d.ts +8 -6
- package/dist/services/LLMAssistanceService.abstract.js +20 -0
- package/dist/services/LLMAssistanceService.abstract.js.map +1 -1
- package/dist/services/chatState/CompletionsChatState.d.ts +19 -0
- package/dist/services/chatState/CompletionsChatState.js +80 -0
- package/dist/services/chatState/CompletionsChatState.js.map +1 -0
- package/dist/services/chatState/index.d.ts +1 -0
- package/dist/services/chatState/index.js +6 -0
- package/dist/services/chatState/index.js.map +1 -0
- package/dist/services/fileStorage/FileStorageToolExecutor.d.ts +15 -0
- package/dist/services/fileStorage/FileStorageToolExecutor.js +172 -0
- package/dist/services/fileStorage/FileStorageToolExecutor.js.map +1 -0
- package/dist/services/fileStorage/InMemoryFileStorage.d.ts +20 -0
- package/dist/services/fileStorage/InMemoryFileStorage.js +67 -0
- package/dist/services/fileStorage/InMemoryFileStorage.js.map +1 -0
- package/dist/services/fileStorage/fileStorageTools.d.ts +26 -0
- package/dist/services/fileStorage/fileStorageTools.js +67 -0
- package/dist/services/fileStorage/fileStorageTools.js.map +1 -0
- package/dist/services/fileStorage/index.d.ts +4 -0
- package/dist/services/fileStorage/index.js +11 -0
- package/dist/services/fileStorage/index.js.map +1 -0
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/index.js +1 -0
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/tools/LLMTool.d.ts +10 -0
- package/dist/utilities/tools/LLMTool.js +10 -0
- package/dist/utilities/tools/LLMTool.js.map +1 -0
- package/dist/utilities/tools/index.d.ts +1 -0
- package/dist/utilities/tools/index.js +6 -0
- package/dist/utilities/tools/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -1805,7 +1805,296 @@ export declare const LLM_SERVICE_MODELS: {
|
|
|
1805
1805
|
};
|
|
1806
1806
|
};
|
|
1807
1807
|
};
|
|
1808
|
-
readonly assistance:
|
|
1808
|
+
readonly assistance: {
|
|
1809
|
+
readonly "gpt-4.1": {
|
|
1810
|
+
readonly name: import("./providers").LLMAPIModelNames.GPT_4_1;
|
|
1811
|
+
readonly limits: {
|
|
1812
|
+
readonly maxInputTokens: 1047576;
|
|
1813
|
+
readonly maxOutputTokens: 32768;
|
|
1814
|
+
};
|
|
1815
|
+
readonly config: {
|
|
1816
|
+
readonly temperature: 0.2;
|
|
1817
|
+
};
|
|
1818
|
+
readonly pricing: {
|
|
1819
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1820
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1821
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1822
|
+
readonly getPriceForAudioInput: () => number;
|
|
1823
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1824
|
+
readonly currency: "USD";
|
|
1825
|
+
};
|
|
1826
|
+
readonly capabilities: {
|
|
1827
|
+
readonly vision: true;
|
|
1828
|
+
};
|
|
1829
|
+
};
|
|
1830
|
+
readonly "gpt-4.1-mini": {
|
|
1831
|
+
readonly name: import("./providers").LLMAPIModelNames.GPT_4_1_MINI;
|
|
1832
|
+
readonly limits: {
|
|
1833
|
+
readonly maxInputTokens: 1047576;
|
|
1834
|
+
readonly maxOutputTokens: 32768;
|
|
1835
|
+
};
|
|
1836
|
+
readonly config: {
|
|
1837
|
+
readonly temperature: 0.2;
|
|
1838
|
+
};
|
|
1839
|
+
readonly pricing: {
|
|
1840
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1841
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1842
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1843
|
+
readonly getPriceForAudioInput: () => number;
|
|
1844
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1845
|
+
readonly currency: "USD";
|
|
1846
|
+
};
|
|
1847
|
+
readonly capabilities: {
|
|
1848
|
+
readonly vision: true;
|
|
1849
|
+
};
|
|
1850
|
+
};
|
|
1851
|
+
readonly "gpt-5": {
|
|
1852
|
+
readonly name: import("./providers").LLMAPIModelNames.GPT_5;
|
|
1853
|
+
readonly limits: {
|
|
1854
|
+
readonly maxInputTokens: 400000;
|
|
1855
|
+
readonly maxOutputTokens: 128000;
|
|
1856
|
+
};
|
|
1857
|
+
readonly config: {
|
|
1858
|
+
readonly temperature: 0.2;
|
|
1859
|
+
};
|
|
1860
|
+
readonly pricing: {
|
|
1861
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1862
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1863
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1864
|
+
readonly getPriceForAudioInput: () => number;
|
|
1865
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1866
|
+
readonly currency: "USD";
|
|
1867
|
+
};
|
|
1868
|
+
readonly capabilities: {
|
|
1869
|
+
readonly vision: true;
|
|
1870
|
+
};
|
|
1871
|
+
};
|
|
1872
|
+
readonly "gpt-5.1": {
|
|
1873
|
+
readonly name: import("./providers").LLMAPIModelNames.GPT_5_1;
|
|
1874
|
+
readonly limits: {
|
|
1875
|
+
readonly maxInputTokens: 400000;
|
|
1876
|
+
readonly maxOutputTokens: 128000;
|
|
1877
|
+
};
|
|
1878
|
+
readonly config: {
|
|
1879
|
+
readonly temperature: 0.2;
|
|
1880
|
+
};
|
|
1881
|
+
readonly pricing: {
|
|
1882
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1883
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1884
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1885
|
+
readonly getPriceForAudioInput: () => number;
|
|
1886
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1887
|
+
readonly currency: "USD";
|
|
1888
|
+
};
|
|
1889
|
+
readonly capabilities: {
|
|
1890
|
+
readonly vision: true;
|
|
1891
|
+
};
|
|
1892
|
+
};
|
|
1893
|
+
readonly "gpt-5-mini": {
|
|
1894
|
+
readonly name: import("./providers").LLMAPIModelNames.GPT_5_MINI;
|
|
1895
|
+
readonly limits: {
|
|
1896
|
+
readonly maxInputTokens: 400000;
|
|
1897
|
+
readonly maxOutputTokens: 128000;
|
|
1898
|
+
};
|
|
1899
|
+
readonly config: {
|
|
1900
|
+
readonly temperature: 0.2;
|
|
1901
|
+
};
|
|
1902
|
+
readonly pricing: {
|
|
1903
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1904
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1905
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1906
|
+
readonly getPriceForAudioInput: () => number;
|
|
1907
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1908
|
+
readonly currency: "USD";
|
|
1909
|
+
};
|
|
1910
|
+
readonly capabilities: {
|
|
1911
|
+
readonly vision: true;
|
|
1912
|
+
};
|
|
1913
|
+
};
|
|
1914
|
+
readonly "gpt-5-nano": {
|
|
1915
|
+
readonly name: import("./providers").LLMAPIModelNames.GPT_5_NANO;
|
|
1916
|
+
readonly limits: {
|
|
1917
|
+
readonly maxInputTokens: 400000;
|
|
1918
|
+
readonly maxOutputTokens: 128000;
|
|
1919
|
+
};
|
|
1920
|
+
readonly config: {
|
|
1921
|
+
readonly temperature: 0.2;
|
|
1922
|
+
};
|
|
1923
|
+
readonly pricing: {
|
|
1924
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1925
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1926
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1927
|
+
readonly getPriceForAudioInput: () => number;
|
|
1928
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1929
|
+
readonly currency: "USD";
|
|
1930
|
+
};
|
|
1931
|
+
readonly capabilities: {
|
|
1932
|
+
readonly vision: true;
|
|
1933
|
+
};
|
|
1934
|
+
};
|
|
1935
|
+
readonly "gemini-2.5-flash": {
|
|
1936
|
+
readonly name: import("./providers").LLMAPIModelNames.GEMINI_2_5_FLASH;
|
|
1937
|
+
readonly limits: {
|
|
1938
|
+
readonly maxInputTokens: 1048576;
|
|
1939
|
+
readonly maxOutputTokens: 65536;
|
|
1940
|
+
};
|
|
1941
|
+
readonly config: {
|
|
1942
|
+
readonly temperature: 0.2;
|
|
1943
|
+
};
|
|
1944
|
+
readonly pricing: {
|
|
1945
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1946
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1947
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1948
|
+
readonly getPriceForAudioInput: () => number;
|
|
1949
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1950
|
+
readonly currency: "USD";
|
|
1951
|
+
};
|
|
1952
|
+
readonly capabilities: {
|
|
1953
|
+
readonly vision: true;
|
|
1954
|
+
};
|
|
1955
|
+
};
|
|
1956
|
+
readonly "gemini-2.5-pro": {
|
|
1957
|
+
readonly name: import("./providers").LLMAPIModelNames.GEMINI_2_5_PRO;
|
|
1958
|
+
readonly limits: {
|
|
1959
|
+
readonly maxInputTokens: 1048576;
|
|
1960
|
+
readonly maxOutputTokens: 65536;
|
|
1961
|
+
};
|
|
1962
|
+
readonly config: {
|
|
1963
|
+
readonly temperature: 0.2;
|
|
1964
|
+
};
|
|
1965
|
+
readonly pricing: {
|
|
1966
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1967
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1968
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1969
|
+
readonly getPriceForAudioInput: () => number;
|
|
1970
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1971
|
+
readonly currency: "USD";
|
|
1972
|
+
};
|
|
1973
|
+
readonly capabilities: {
|
|
1974
|
+
readonly vision: true;
|
|
1975
|
+
};
|
|
1976
|
+
};
|
|
1977
|
+
readonly "minimax-m2.5": {
|
|
1978
|
+
readonly name: import("./providers").LLMAPIModelNames.MINIMAX_M2_5;
|
|
1979
|
+
readonly limits: {
|
|
1980
|
+
readonly maxInputTokens: 196000;
|
|
1981
|
+
readonly maxOutputTokens: 16000;
|
|
1982
|
+
};
|
|
1983
|
+
readonly config: {
|
|
1984
|
+
readonly temperature: 0.2;
|
|
1985
|
+
};
|
|
1986
|
+
readonly pricing: {
|
|
1987
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1988
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1989
|
+
readonly getPriceForAudioInput: () => number;
|
|
1990
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1991
|
+
readonly currency: "USD";
|
|
1992
|
+
};
|
|
1993
|
+
readonly capabilities: {
|
|
1994
|
+
readonly vision: false;
|
|
1995
|
+
};
|
|
1996
|
+
};
|
|
1997
|
+
readonly "qwen-plus": {
|
|
1998
|
+
readonly name: import("./providers").LLMAPIModelNames.QWEN_PLUS;
|
|
1999
|
+
readonly limits: {
|
|
2000
|
+
readonly maxInputTokens: 128000;
|
|
2001
|
+
readonly maxOutputTokens: 16000;
|
|
2002
|
+
};
|
|
2003
|
+
readonly config: {
|
|
2004
|
+
readonly temperature: 0.2;
|
|
2005
|
+
};
|
|
2006
|
+
readonly pricing: {
|
|
2007
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
2008
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
2009
|
+
readonly getPriceForAudioInput: () => number;
|
|
2010
|
+
readonly getPriceForAudioOutput: () => number;
|
|
2011
|
+
readonly currency: "USD";
|
|
2012
|
+
};
|
|
2013
|
+
readonly capabilities: {
|
|
2014
|
+
readonly vision: false;
|
|
2015
|
+
};
|
|
2016
|
+
};
|
|
2017
|
+
readonly "qwen-vl-plus": {
|
|
2018
|
+
readonly name: import("./providers").LLMAPIModelNames.QWEN_VL_PLUS;
|
|
2019
|
+
readonly limits: {
|
|
2020
|
+
readonly maxInputTokens: 128000;
|
|
2021
|
+
readonly maxOutputTokens: 16000;
|
|
2022
|
+
};
|
|
2023
|
+
readonly config: {
|
|
2024
|
+
readonly temperature: 0.2;
|
|
2025
|
+
};
|
|
2026
|
+
readonly pricing: {
|
|
2027
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
2028
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
2029
|
+
readonly getPriceForAudioInput: () => number;
|
|
2030
|
+
readonly getPriceForAudioOutput: () => number;
|
|
2031
|
+
readonly currency: "USD";
|
|
2032
|
+
};
|
|
2033
|
+
readonly capabilities: {
|
|
2034
|
+
readonly vision: true;
|
|
2035
|
+
};
|
|
2036
|
+
};
|
|
2037
|
+
readonly "kimi-k2.5": {
|
|
2038
|
+
readonly name: import("./providers").LLMAPIModelNames.KIMI_K2_5;
|
|
2039
|
+
readonly limits: {
|
|
2040
|
+
readonly maxInputTokens: 128000;
|
|
2041
|
+
readonly maxOutputTokens: 16000;
|
|
2042
|
+
};
|
|
2043
|
+
readonly config: {
|
|
2044
|
+
readonly temperature: 0.2;
|
|
2045
|
+
};
|
|
2046
|
+
readonly pricing: {
|
|
2047
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
2048
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
2049
|
+
readonly getPriceForAudioInput: () => number;
|
|
2050
|
+
readonly getPriceForAudioOutput: () => number;
|
|
2051
|
+
readonly currency: "USD";
|
|
2052
|
+
};
|
|
2053
|
+
readonly capabilities: {
|
|
2054
|
+
readonly vision: false;
|
|
2055
|
+
};
|
|
2056
|
+
};
|
|
2057
|
+
readonly "qwen-flash": {
|
|
2058
|
+
readonly name: import("./providers").LLMAPIModelNames.QWEN_FLASH;
|
|
2059
|
+
readonly limits: {
|
|
2060
|
+
readonly maxInputTokens: 128000;
|
|
2061
|
+
readonly maxOutputTokens: 16000;
|
|
2062
|
+
};
|
|
2063
|
+
readonly config: {
|
|
2064
|
+
readonly temperature: 0.2;
|
|
2065
|
+
};
|
|
2066
|
+
readonly pricing: {
|
|
2067
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
2068
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
2069
|
+
readonly getPriceForAudioInput: () => number;
|
|
2070
|
+
readonly getPriceForAudioOutput: () => number;
|
|
2071
|
+
readonly currency: "USD";
|
|
2072
|
+
};
|
|
2073
|
+
readonly capabilities: {
|
|
2074
|
+
readonly vision: false;
|
|
2075
|
+
};
|
|
2076
|
+
};
|
|
2077
|
+
readonly "deepseek-v3.2": {
|
|
2078
|
+
readonly name: import("./providers").LLMAPIModelNames.DEEPSEEK_V3_2;
|
|
2079
|
+
readonly limits: {
|
|
2080
|
+
readonly maxInputTokens: 128000;
|
|
2081
|
+
readonly maxOutputTokens: 16000;
|
|
2082
|
+
};
|
|
2083
|
+
readonly config: {
|
|
2084
|
+
readonly temperature: 0.2;
|
|
2085
|
+
};
|
|
2086
|
+
readonly pricing: {
|
|
2087
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
2088
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
2089
|
+
readonly getPriceForAudioInput: () => number;
|
|
2090
|
+
readonly getPriceForAudioOutput: () => number;
|
|
2091
|
+
readonly currency: "USD";
|
|
2092
|
+
};
|
|
2093
|
+
readonly capabilities: {
|
|
2094
|
+
readonly vision: false;
|
|
2095
|
+
};
|
|
2096
|
+
};
|
|
2097
|
+
};
|
|
1809
2098
|
readonly text_to_speech: Partial<import("./LLMService.typedefs").LLMProviderAvailableModels<LLMProviders.LLMAPI>>;
|
|
1810
2099
|
readonly speech_to_text: Partial<import("./LLMService.typedefs").LLMProviderAvailableModels<LLMProviders.LLMAPI>>;
|
|
1811
2100
|
};
|
|
@@ -1817,3 +2106,4 @@ export declare const APPROXIMATE_TOKENS_COUNT_IN_IMAGE = 1000;
|
|
|
1817
2106
|
*/
|
|
1818
2107
|
export declare const MAX_CACHED_INSTANCES = 10;
|
|
1819
2108
|
export declare const ALL_IMAGE_MIME_TYPES: readonly [LLMUploadFileMimeTypes.IMAGE_PNG, LLMUploadFileMimeTypes.IMAGE_JPEG, LLMUploadFileMimeTypes.IMAGE_JPG, LLMUploadFileMimeTypes.IMAGE_GIF, LLMUploadFileMimeTypes.IMAGE_WEBP, LLMUploadFileMimeTypes.IMAGE_SVG_XML, LLMUploadFileMimeTypes.IMAGE_BMP];
|
|
2109
|
+
export declare const DEFAULT_MAX_TOOL_ITERATIONS = 10;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALL_IMAGE_MIME_TYPES = exports.MAX_CACHED_INSTANCES = exports.APPROXIMATE_TOKENS_COUNT_IN_IMAGE = exports.LLM_SERVICE_MODELS = exports.LLM_SERVICE_FACTORIES = void 0;
|
|
3
|
+
exports.DEFAULT_MAX_TOOL_ITERATIONS = exports.ALL_IMAGE_MIME_TYPES = exports.MAX_CACHED_INSTANCES = exports.APPROXIMATE_TOKENS_COUNT_IN_IMAGE = exports.LLM_SERVICE_MODELS = exports.LLM_SERVICE_FACTORIES = void 0;
|
|
4
4
|
const LLMService_typedefs_1 = require("./LLMService.typedefs");
|
|
5
5
|
const providers_1 = require("./providers");
|
|
6
6
|
const GoogleGenerativeAI_constants_1 = require("./providers/GoogleGenerativeAI/GoogleGenerativeAI.constants");
|
|
@@ -31,4 +31,5 @@ exports.ALL_IMAGE_MIME_TYPES = [
|
|
|
31
31
|
LLMService_typedefs_1.LLMUploadFileMimeTypes.IMAGE_SVG_XML,
|
|
32
32
|
LLMService_typedefs_1.LLMUploadFileMimeTypes.IMAGE_BMP,
|
|
33
33
|
];
|
|
34
|
+
exports.DEFAULT_MAX_TOOL_ITERATIONS = 10;
|
|
34
35
|
//# sourceMappingURL=LLMService.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LLMService.constants.js","sourceRoot":"","sources":["../src/LLMService.constants.ts"],"names":[],"mappings":";;;AAAA,+DAK+B;AAC/B,2CAA2G;AAC3G,8GAA+F;AAC/F,0EAAqE;AACrE,0EAAoE;AAGvD,QAAA,qBAAqB,GAAG;IACnC,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,IAAI,gCAAoB,EAAE;IACjD,CAAC,kCAAY,CAAC,kBAAkB,CAAC,EAAE,IAAI,4CAAgC,EAAE;IACzE,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,IAAI,gCAAoB,EAAE;CAGlD,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,iCAAc;IACrC,CAAC,kCAAY,CAAC,kBAAkB,CAAC,EAAE,+CAAgB;IACnD,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,gCAAa;CAGrC,CAAC;AAEW,QAAA,iCAAiC,GAAG,IAAI,CAAC;AAEtD;;;GAGG;AACU,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAE1B,QAAA,oBAAoB,GAAG;IAClC,4CAAsB,CAAC,SAAS;IAChC,4CAAsB,CAAC,UAAU;IACjC,4CAAsB,CAAC,SAAS;IAChC,4CAAsB,CAAC,SAAS;IAChC,4CAAsB,CAAC,UAAU;IACjC,4CAAsB,CAAC,aAAa;IACpC,4CAAsB,CAAC,SAAS;CACoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"LLMService.constants.js","sourceRoot":"","sources":["../src/LLMService.constants.ts"],"names":[],"mappings":";;;AAAA,+DAK+B;AAC/B,2CAA2G;AAC3G,8GAA+F;AAC/F,0EAAqE;AACrE,0EAAoE;AAGvD,QAAA,qBAAqB,GAAG;IACnC,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,IAAI,gCAAoB,EAAE;IACjD,CAAC,kCAAY,CAAC,kBAAkB,CAAC,EAAE,IAAI,4CAAgC,EAAE;IACzE,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,IAAI,gCAAoB,EAAE;CAGlD,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,iCAAc;IACrC,CAAC,kCAAY,CAAC,kBAAkB,CAAC,EAAE,+CAAgB;IACnD,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,gCAAa;CAGrC,CAAC;AAEW,QAAA,iCAAiC,GAAG,IAAI,CAAC;AAEtD;;;GAGG;AACU,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAE1B,QAAA,oBAAoB,GAAG;IAClC,4CAAsB,CAAC,SAAS;IAChC,4CAAsB,CAAC,UAAU;IACjC,4CAAsB,CAAC,SAAS;IAChC,4CAAsB,CAAC,SAAS;IAChC,4CAAsB,CAAC,UAAU;IACjC,4CAAsB,CAAC,aAAa;IACpC,4CAAsB,CAAC,SAAS;CACoB,CAAC;AAE1C,QAAA,2BAA2B,GAAG,EAAE,CAAC"}
|
|
@@ -4,6 +4,7 @@ import type { LLMAPIClient, LLMAPIClientOptions, LLMAPIModelNames, LLMAPIModelCo
|
|
|
4
4
|
import type { LLMCompletionService, LLMAssistanceService, LLMSpeechToTextService, LLMTextToSpeechService } from './services';
|
|
5
5
|
import type { LLMLoggerInterface } from './utilities/logger';
|
|
6
6
|
import type { LLMReporterInterface } from './utilities/reporter';
|
|
7
|
+
import type { LLMSchemaInterface, InferSchema } from './utilities/schema';
|
|
7
8
|
/**
|
|
8
9
|
* Enum of supported LLM providers.
|
|
9
10
|
*/
|
|
@@ -366,6 +367,8 @@ export type LLMAssistanceOptions<Provider extends LLMProviders, Reporter extends
|
|
|
366
367
|
message: LLMAssistanceMessage;
|
|
367
368
|
chatId: string;
|
|
368
369
|
storageId?: string;
|
|
370
|
+
tools?: LLMToolDefinition[];
|
|
371
|
+
maxToolIterations?: number;
|
|
369
372
|
};
|
|
370
373
|
/**
|
|
371
374
|
* Result type for assistance requests.
|
|
@@ -373,6 +376,12 @@ export type LLMAssistanceOptions<Provider extends LLMProviders, Reporter extends
|
|
|
373
376
|
export type LLMAssistanceResult = LLMRequestResult<{
|
|
374
377
|
text: string;
|
|
375
378
|
}>;
|
|
379
|
+
export interface LLMToolDefinition<Schema extends LLMSchemaInterface = LLMSchemaInterface> {
|
|
380
|
+
name: string;
|
|
381
|
+
description: string;
|
|
382
|
+
parameters: Schema;
|
|
383
|
+
execute: (args: InferSchema<Schema>) => Promise<string> | string;
|
|
384
|
+
}
|
|
376
385
|
/**
|
|
377
386
|
* Function type for counting tokens in messages for a specific provider's model.
|
|
378
387
|
* @template Provider - The LLM provider type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LLMService.typedefs.js","sourceRoot":"","sources":["../src/LLMService.typedefs.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LLMService.typedefs.js","sourceRoot":"","sources":["../src/LLMService.typedefs.ts"],"names":[],"mappings":";;;AAiCA;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yDAAyC,CAAA;IACzC,iCAAiB,CAAA;AACnB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAoBD;;GAEG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,wCAAyB,CAAA;IACzB,8CAA+B,CAAA;IAC/B,8CAA+B,CAAA;AACjC,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAoKD;;GAEG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,mCAAuB,CAAA;AACzB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED;;GAEG;AACH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,gDAAuB,CAAA;IACvB,kDAAyB,CAAA;AAC3B,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC;AA4HD;;GAEG;AACH,IAAY,sBAeX;AAfD,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;IACvB,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,yDAA+B,CAAA;IAC/B,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,oDAA0B,CAAA;IAC1B,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;AACzB,CAAC,EAfW,sBAAsB,sCAAtB,sBAAsB,QAejC"}
|
package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type LLMAssistanceOptions, type LLMAssistanceResult, type LLMAssistance
|
|
|
3
3
|
import { type LLMLoggerInterface } from '../../../utilities/logger';
|
|
4
4
|
import { type LLMReporterInterface } from '../../../utilities/reporter';
|
|
5
5
|
import { LLMAssistanceService } from '../../../services';
|
|
6
|
-
import { type LLMSchemaInterface
|
|
6
|
+
import { type LLMSchemaInterface } from '../../../utilities/schema';
|
|
7
7
|
export declare class GoogleGenerativeAIAssistanceService<Reporter extends LLMReporterInterface<any> | undefined> extends LLMAssistanceService<LLMProviders.GoogleGenerativeAI, Reporter> {
|
|
8
8
|
private cachedContent;
|
|
9
9
|
private chatSessions;
|
|
@@ -19,12 +19,13 @@ export declare class GoogleGenerativeAIAssistanceService<Reporter extends LLMRep
|
|
|
19
19
|
deleteFileStorage(fileStorageId: string): Promise<void>;
|
|
20
20
|
createChat(options: LLMCreateChatOptions<LLMProviders.GoogleGenerativeAI, Reporter>): Promise<LLMCreateChatResult>;
|
|
21
21
|
deleteChat(chatId: string): Promise<void>;
|
|
22
|
-
assistInChat<S extends LLMSchemaInterface>(options: LLMAssistanceOptions<LLMProviders.GoogleGenerativeAI, Reporter> & {
|
|
23
|
-
schema: S;
|
|
24
|
-
}): Promise<LLMStructuredResult<InferSchema<S>>>;
|
|
25
|
-
assistInChat(options: LLMAssistanceOptions<LLMProviders.GoogleGenerativeAI, Reporter>): Promise<LLMAssistanceResult>;
|
|
26
22
|
private getStorageFileParts;
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
protected assistInChatText(options: LLMAssistanceOptions<LLMProviders.GoogleGenerativeAI, Reporter>): Promise<LLMAssistanceResult>;
|
|
24
|
+
protected assistInChatStructured(options: LLMAssistanceOptions<LLMProviders.GoogleGenerativeAI, Reporter> & {
|
|
25
|
+
schema: LLMSchemaInterface;
|
|
26
|
+
}): Promise<LLMStructuredResult>;
|
|
27
|
+
private convertCustomToolsToGoogle;
|
|
28
|
+
private executeGoogleToolLoop;
|
|
29
|
+
private executeGoogleFunctionCalls;
|
|
29
30
|
countTokens(messages: LLMAssistanceMessage[], model: LLMModel<LLMProviders.GoogleGenerativeAI>): Promise<number>;
|
|
30
31
|
}
|