@mate-academy/llm-gateway 6.1.0 → 6.2.1
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 +12 -7
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js +232 -64
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js.map +1 -1
- package/dist/providers/LLMAPI/LLMAPI.constants.d.ts +293 -4
- package/dist/providers/LLMAPI/LLMAPI.constants.js +3 -3
- 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 +48 -0
- package/dist/providers/LLMAPI/LLMAPI.entity.js.map +1 -0
- package/dist/providers/LLMAPI/LLMAPI.typedefs.js.map +1 -1
- 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 +37 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js +500 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js.map +1 -0
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.d.ts +2 -1
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.js +23 -13
- 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/LLMAPI/utilities/LLMAPIJsonFixer.js +2 -4
- package/dist/providers/LLMAPI/utilities/LLMAPIJsonFixer.js.map +1 -1
- package/dist/providers/LLMAPI/utilities/index.d.ts +2 -0
- package/dist/providers/LLMAPI/utilities/index.js +5 -1
- package/dist/providers/LLMAPI/utilities/index.js.map +1 -1
- package/dist/providers/LLMAPI/utilities/parseXmlToolCalls.d.ts +7 -0
- package/dist/providers/LLMAPI/utilities/parseXmlToolCalls.js +35 -0
- package/dist/providers/LLMAPI/utilities/parseXmlToolCalls.js.map +1 -0
- package/dist/providers/LLMAPI/utilities/stripThinkingTags.d.ts +1 -0
- package/dist/providers/LLMAPI/utilities/stripThinkingTags.js +7 -0
- package/dist/providers/LLMAPI/utilities/stripThinkingTags.js.map +1 -0
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.d.ts +12 -7
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.js +180 -67
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.js.map +1 -1
- package/dist/providers/OpenAICompatible/OpenAICompatibleCompletion.service.d.ts +2 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleCompletion.service.js +60 -76
- package/dist/providers/OpenAICompatible/OpenAICompatibleCompletion.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 +68 -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
|
@@ -1638,10 +1638,300 @@ export declare const LLM_SERVICE_MODELS: {
|
|
|
1638
1638
|
readonly getPriceForAudioOutput: () => number;
|
|
1639
1639
|
readonly currency: "USD";
|
|
1640
1640
|
};
|
|
1641
|
+
readonly capabilities: {
|
|
1642
|
+
readonly vision: false;
|
|
1643
|
+
};
|
|
1644
|
+
};
|
|
1645
|
+
readonly "gemini-2.5-flash": {
|
|
1646
|
+
readonly name: import("./providers").LLMAPIModelNames.GEMINI_2_5_FLASH;
|
|
1647
|
+
readonly limits: {
|
|
1648
|
+
readonly maxInputTokens: 1048576;
|
|
1649
|
+
readonly maxOutputTokens: 65536;
|
|
1650
|
+
};
|
|
1651
|
+
readonly config: {
|
|
1652
|
+
readonly temperature: 0.2;
|
|
1653
|
+
};
|
|
1654
|
+
readonly pricing: {
|
|
1655
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1656
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1657
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1658
|
+
readonly getPriceForAudioInput: () => number;
|
|
1659
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1660
|
+
readonly currency: "USD";
|
|
1661
|
+
};
|
|
1641
1662
|
readonly capabilities: {
|
|
1642
1663
|
readonly vision: true;
|
|
1643
1664
|
};
|
|
1644
1665
|
};
|
|
1666
|
+
readonly "gemini-2.5-pro": {
|
|
1667
|
+
readonly name: import("./providers").LLMAPIModelNames.GEMINI_2_5_PRO;
|
|
1668
|
+
readonly limits: {
|
|
1669
|
+
readonly maxInputTokens: 1048576;
|
|
1670
|
+
readonly maxOutputTokens: 65536;
|
|
1671
|
+
};
|
|
1672
|
+
readonly config: {
|
|
1673
|
+
readonly temperature: 0.2;
|
|
1674
|
+
};
|
|
1675
|
+
readonly pricing: {
|
|
1676
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1677
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1678
|
+
readonly getPriceForCachedTextInput: (tokens: number) => number;
|
|
1679
|
+
readonly getPriceForAudioInput: () => number;
|
|
1680
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1681
|
+
readonly currency: "USD";
|
|
1682
|
+
};
|
|
1683
|
+
readonly capabilities: {
|
|
1684
|
+
readonly vision: true;
|
|
1685
|
+
};
|
|
1686
|
+
};
|
|
1687
|
+
readonly "minimax-m2.5": {
|
|
1688
|
+
readonly name: import("./providers").LLMAPIModelNames.MINIMAX_M2_5;
|
|
1689
|
+
readonly limits: {
|
|
1690
|
+
readonly maxInputTokens: 196000;
|
|
1691
|
+
readonly maxOutputTokens: 16000;
|
|
1692
|
+
};
|
|
1693
|
+
readonly config: {
|
|
1694
|
+
readonly temperature: 0.2;
|
|
1695
|
+
};
|
|
1696
|
+
readonly pricing: {
|
|
1697
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1698
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1699
|
+
readonly getPriceForAudioInput: () => number;
|
|
1700
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1701
|
+
readonly currency: "USD";
|
|
1702
|
+
};
|
|
1703
|
+
readonly capabilities: {
|
|
1704
|
+
readonly vision: false;
|
|
1705
|
+
};
|
|
1706
|
+
};
|
|
1707
|
+
readonly "qwen-plus": {
|
|
1708
|
+
readonly name: import("./providers").LLMAPIModelNames.QWEN_PLUS;
|
|
1709
|
+
readonly limits: {
|
|
1710
|
+
readonly maxInputTokens: 128000;
|
|
1711
|
+
readonly maxOutputTokens: 16000;
|
|
1712
|
+
};
|
|
1713
|
+
readonly config: {
|
|
1714
|
+
readonly temperature: 0.2;
|
|
1715
|
+
};
|
|
1716
|
+
readonly pricing: {
|
|
1717
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1718
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1719
|
+
readonly getPriceForAudioInput: () => number;
|
|
1720
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1721
|
+
readonly currency: "USD";
|
|
1722
|
+
};
|
|
1723
|
+
readonly capabilities: {
|
|
1724
|
+
readonly vision: false;
|
|
1725
|
+
};
|
|
1726
|
+
};
|
|
1727
|
+
readonly "qwen-vl-plus": {
|
|
1728
|
+
readonly name: import("./providers").LLMAPIModelNames.QWEN_VL_PLUS;
|
|
1729
|
+
readonly limits: {
|
|
1730
|
+
readonly maxInputTokens: 128000;
|
|
1731
|
+
readonly maxOutputTokens: 16000;
|
|
1732
|
+
};
|
|
1733
|
+
readonly config: {
|
|
1734
|
+
readonly temperature: 0.2;
|
|
1735
|
+
};
|
|
1736
|
+
readonly pricing: {
|
|
1737
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1738
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1739
|
+
readonly getPriceForAudioInput: () => number;
|
|
1740
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1741
|
+
readonly currency: "USD";
|
|
1742
|
+
};
|
|
1743
|
+
readonly capabilities: {
|
|
1744
|
+
readonly vision: true;
|
|
1745
|
+
};
|
|
1746
|
+
};
|
|
1747
|
+
readonly "kimi-k2.5": {
|
|
1748
|
+
readonly name: import("./providers").LLMAPIModelNames.KIMI_K2_5;
|
|
1749
|
+
readonly limits: {
|
|
1750
|
+
readonly maxInputTokens: 128000;
|
|
1751
|
+
readonly maxOutputTokens: 16000;
|
|
1752
|
+
};
|
|
1753
|
+
readonly config: {
|
|
1754
|
+
readonly temperature: 0.2;
|
|
1755
|
+
};
|
|
1756
|
+
readonly pricing: {
|
|
1757
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1758
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1759
|
+
readonly getPriceForAudioInput: () => number;
|
|
1760
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1761
|
+
readonly currency: "USD";
|
|
1762
|
+
};
|
|
1763
|
+
readonly capabilities: {
|
|
1764
|
+
readonly vision: false;
|
|
1765
|
+
};
|
|
1766
|
+
};
|
|
1767
|
+
readonly "qwen-flash": {
|
|
1768
|
+
readonly name: import("./providers").LLMAPIModelNames.QWEN_FLASH;
|
|
1769
|
+
readonly limits: {
|
|
1770
|
+
readonly maxInputTokens: 128000;
|
|
1771
|
+
readonly maxOutputTokens: 16000;
|
|
1772
|
+
};
|
|
1773
|
+
readonly config: {
|
|
1774
|
+
readonly temperature: 0.2;
|
|
1775
|
+
};
|
|
1776
|
+
readonly pricing: {
|
|
1777
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1778
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1779
|
+
readonly getPriceForAudioInput: () => number;
|
|
1780
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1781
|
+
readonly currency: "USD";
|
|
1782
|
+
};
|
|
1783
|
+
readonly capabilities: {
|
|
1784
|
+
readonly vision: false;
|
|
1785
|
+
};
|
|
1786
|
+
};
|
|
1787
|
+
readonly "deepseek-v3.2": {
|
|
1788
|
+
readonly name: import("./providers").LLMAPIModelNames.DEEPSEEK_V3_2;
|
|
1789
|
+
readonly limits: {
|
|
1790
|
+
readonly maxInputTokens: 128000;
|
|
1791
|
+
readonly maxOutputTokens: 16000;
|
|
1792
|
+
};
|
|
1793
|
+
readonly config: {
|
|
1794
|
+
readonly temperature: 0.2;
|
|
1795
|
+
};
|
|
1796
|
+
readonly pricing: {
|
|
1797
|
+
readonly getPriceForTextInput: (tokens: number) => number;
|
|
1798
|
+
readonly getPriceForTextOutput: (tokens: number) => number;
|
|
1799
|
+
readonly getPriceForAudioInput: () => number;
|
|
1800
|
+
readonly getPriceForAudioOutput: () => number;
|
|
1801
|
+
readonly currency: "USD";
|
|
1802
|
+
};
|
|
1803
|
+
readonly capabilities: {
|
|
1804
|
+
readonly vision: false;
|
|
1805
|
+
};
|
|
1806
|
+
};
|
|
1807
|
+
};
|
|
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: false;
|
|
1933
|
+
};
|
|
1934
|
+
};
|
|
1645
1935
|
readonly "gemini-2.5-flash": {
|
|
1646
1936
|
readonly name: import("./providers").LLMAPIModelNames.GEMINI_2_5_FLASH;
|
|
1647
1937
|
readonly limits: {
|
|
@@ -1805,7 +2095,6 @@ export declare const LLM_SERVICE_MODELS: {
|
|
|
1805
2095
|
};
|
|
1806
2096
|
};
|
|
1807
2097
|
};
|
|
1808
|
-
readonly assistance: Partial<import("./LLMService.typedefs").LLMProviderAvailableModels<LLMProviders.LLMAPI>>;
|
|
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,17 @@ 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 prepareChatMessage;
|
|
28
|
+
private sendStructuredFollowUp;
|
|
29
|
+
private extractUsageFromResponse;
|
|
30
|
+
private combineUsage;
|
|
31
|
+
private convertCustomToolsToGoogle;
|
|
32
|
+
private executeGoogleToolLoop;
|
|
33
|
+
private executeGoogleFunctionCalls;
|
|
29
34
|
countTokens(messages: LLMAssistanceMessage[], model: LLMModel<LLMProviders.GoogleGenerativeAI>): Promise<number>;
|
|
30
35
|
}
|