cactus-react-native 1.2.1 → 1.5.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/README.md +765 -33
- package/android/CMakeLists.txt +4 -3
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusFileSystem.kt +20 -1
- package/android/src/main/jniLibs/arm64-v8a/libcactus.a +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_util.a +0 -0
- package/cpp/HybridCactus.cpp +231 -19
- package/cpp/HybridCactus.hpp +25 -3
- package/cpp/HybridCactusIndex.cpp +325 -0
- package/cpp/HybridCactusIndex.hpp +43 -0
- package/cpp/HybridCactusUtil.cpp +3 -3
- package/cpp/HybridCactusUtil.hpp +2 -1
- package/cpp/cactus_ffi.h +107 -2
- package/cpp/cactus_util.h +1 -1
- package/ios/HybridCactusFileSystem.swift +23 -2
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus.h +2 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_ffi.h +107 -2
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_telemetry.h +656 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/{ffi_utils.h → cactus_utils.h} +145 -18
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/engine.h +135 -7
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/gemma_tools.h +549 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +193 -26
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +54 -195
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel_utils.h +399 -140
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus.h +2 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_ffi.h +107 -2
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_telemetry.h +656 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/{ffi_utils.h → cactus_utils.h} +145 -18
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/engine.h +135 -7
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/gemma_tools.h +549 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +193 -26
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +54 -195
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel_utils.h +399 -140
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/_CodeSignature/CodeResources +1 -1
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus_util.xcframework/Info.plist +4 -4
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/cactus_util.h +1 -1
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/database.h +27 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Info.plist +0 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/cactus_util +0 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/cactus_util.h +1 -1
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/database.h +27 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Info.plist +0 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/_CodeSignature/CodeResources +3 -3
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/cactus_util +0 -0
- package/lib/module/api/Database.js +12 -95
- package/lib/module/api/Database.js.map +1 -1
- package/lib/module/classes/CactusIndex.js +45 -0
- package/lib/module/classes/CactusIndex.js.map +1 -0
- package/lib/module/classes/CactusLM.js +65 -17
- package/lib/module/classes/CactusLM.js.map +1 -1
- package/lib/module/classes/CactusSTT.js +104 -17
- package/lib/module/classes/CactusSTT.js.map +1 -1
- package/lib/module/config/CactusConfig.js +2 -0
- package/lib/module/config/CactusConfig.js.map +1 -1
- package/lib/module/constants/packageVersion.js +1 -1
- package/lib/module/hooks/useCactusIndex.js +175 -0
- package/lib/module/hooks/useCactusIndex.js.map +1 -0
- package/lib/module/hooks/useCactusLM.js +68 -7
- package/lib/module/hooks/useCactusLM.js.map +1 -1
- package/lib/module/hooks/useCactusSTT.js +102 -6
- package/lib/module/hooks/useCactusSTT.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/models.js +336 -0
- package/lib/module/models.js.map +1 -0
- package/lib/module/native/Cactus.js +61 -13
- package/lib/module/native/Cactus.js.map +1 -1
- package/lib/module/native/CactusFileSystem.js +3 -0
- package/lib/module/native/CactusFileSystem.js.map +1 -1
- package/lib/module/native/CactusIndex.js +32 -0
- package/lib/module/native/CactusIndex.js.map +1 -0
- package/lib/module/native/CactusUtil.js +16 -3
- package/lib/module/native/CactusUtil.js.map +1 -1
- package/lib/module/native/index.js +1 -0
- package/lib/module/native/index.js.map +1 -1
- package/lib/module/specs/CactusIndex.nitro.js +4 -0
- package/lib/module/specs/CactusIndex.nitro.js.map +1 -0
- package/lib/module/telemetry/Telemetry.js +3 -1
- package/lib/module/telemetry/Telemetry.js.map +1 -1
- package/lib/module/types/CactusIndex.js +2 -0
- package/lib/module/types/{CactusModel.js.map → CactusIndex.js.map} +1 -1
- package/lib/module/types/CactusLM.js +2 -0
- package/lib/module/types/CactusSTT.js +2 -0
- package/lib/module/types/common.js +2 -0
- package/lib/module/types/{CactusSTTModel.js.map → common.js.map} +1 -1
- package/lib/typescript/src/api/Database.d.ts +4 -7
- package/lib/typescript/src/api/Database.d.ts.map +1 -1
- package/lib/typescript/src/classes/CactusIndex.d.ts +15 -0
- package/lib/typescript/src/classes/CactusIndex.d.ts.map +1 -0
- package/lib/typescript/src/classes/CactusLM.d.ts +12 -5
- package/lib/typescript/src/classes/CactusLM.d.ts.map +1 -1
- package/lib/typescript/src/classes/CactusSTT.d.ts +15 -5
- package/lib/typescript/src/classes/CactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/config/CactusConfig.d.ts +1 -0
- package/lib/typescript/src/config/CactusConfig.d.ts.map +1 -1
- package/lib/typescript/src/constants/packageVersion.d.ts +1 -1
- package/lib/typescript/src/hooks/useCactusIndex.d.ts +14 -0
- package/lib/typescript/src/hooks/useCactusIndex.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCactusLM.d.ts +6 -4
- package/lib/typescript/src/hooks/useCactusLM.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCactusSTT.d.ts +13 -5
- package/lib/typescript/src/hooks/useCactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +6 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/models.d.ts +6 -0
- package/lib/typescript/src/models.d.ts.map +1 -0
- package/lib/typescript/src/native/Cactus.d.ts +10 -3
- package/lib/typescript/src/native/Cactus.d.ts.map +1 -1
- package/lib/typescript/src/native/CactusFileSystem.d.ts +1 -0
- package/lib/typescript/src/native/CactusFileSystem.d.ts.map +1 -1
- package/lib/typescript/src/native/CactusIndex.d.ts +12 -0
- package/lib/typescript/src/native/CactusIndex.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusUtil.d.ts.map +1 -1
- package/lib/typescript/src/native/index.d.ts +1 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/Cactus.nitro.d.ts +9 -2
- package/lib/typescript/src/specs/Cactus.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts +1 -0
- package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/CactusIndex.nitro.d.ts +24 -0
- package/lib/typescript/src/specs/CactusIndex.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts +1 -1
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusIndex.d.ts +34 -0
- package/lib/typescript/src/types/CactusIndex.d.ts.map +1 -0
- package/lib/typescript/src/types/CactusLM.d.ts +19 -0
- package/lib/typescript/src/types/CactusLM.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusSTT.d.ts +21 -1
- package/lib/typescript/src/types/CactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/types/common.d.ts +28 -0
- package/lib/typescript/src/types/common.d.ts.map +1 -0
- package/nitro.json +3 -0
- package/nitrogen/generated/android/c++/JDeviceInfo.hpp +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.cpp +1 -1
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.cpp +1 -1
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.cpp +17 -1
- package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.hpp +2 -1
- package/nitrogen/generated/android/c++/JHybridCactusImageSpec.cpp +1 -1
- package/nitrogen/generated/android/c++/JHybridCactusImageSpec.hpp +1 -1
- package/nitrogen/generated/android/cactus+autolinking.cmake +2 -1
- package/nitrogen/generated/android/cactus+autolinking.gradle +1 -1
- package/nitrogen/generated/android/cactusOnLoad.cpp +11 -1
- package/nitrogen/generated/android/cactusOnLoad.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/DeviceInfo.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/Func_void_double.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusCryptoSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusDeviceInfoSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusFileSystemSpec.kt +5 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusImageSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/cactusOnLoad.kt +1 -1
- package/nitrogen/generated/ios/Cactus+autolinking.rb +1 -1
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.hpp +1 -1
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/CactusAutolinking.mm +11 -1
- package/nitrogen/generated/ios/CactusAutolinking.swift +1 -1
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.hpp +9 -1
- package/nitrogen/generated/ios/c++/HybridCactusImageSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridCactusImageSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/swift/DeviceInfo.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_DeviceInfo.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_double.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec_cxx.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec_cxx.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec_cxx.swift +20 -1
- package/nitrogen/generated/ios/swift/HybridCactusImageSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCactusImageSpec_cxx.swift +1 -1
- package/nitrogen/generated/shared/c++/CactusIndexGetResult.hpp +84 -0
- package/nitrogen/generated/shared/c++/CactusIndexQueryResult.hpp +79 -0
- package/nitrogen/generated/shared/c++/DeviceInfo.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.cpp +2 -1
- package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridCactusImageSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCactusImageSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCactusIndexSpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridCactusIndexSpec.hpp +76 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.cpp +8 -1
- package/nitrogen/generated/shared/c++/HybridCactusSpec.hpp +11 -3
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.hpp +2 -2
- package/package.json +2 -2
- package/src/api/Database.ts +14 -135
- package/src/classes/CactusIndex.ts +58 -0
- package/src/classes/CactusLM.ts +87 -19
- package/src/classes/CactusSTT.ts +134 -20
- package/src/config/CactusConfig.ts +3 -0
- package/src/constants/packageVersion.ts +1 -1
- package/src/hooks/useCactusIndex.ts +195 -0
- package/src/hooks/useCactusLM.ts +88 -8
- package/src/hooks/useCactusSTT.ts +119 -7
- package/src/index.tsx +22 -2
- package/src/models.ts +344 -0
- package/src/native/Cactus.ts +95 -13
- package/src/native/CactusFileSystem.ts +4 -0
- package/src/native/CactusIndex.ts +54 -0
- package/src/native/CactusUtil.ts +19 -3
- package/src/native/index.ts +1 -0
- package/src/specs/Cactus.nitro.ts +18 -2
- package/src/specs/CactusFileSystem.nitro.ts +2 -0
- package/src/specs/CactusIndex.nitro.ts +31 -0
- package/src/specs/CactusUtil.nitro.ts +1 -1
- package/src/telemetry/Telemetry.ts +1 -1
- package/src/types/CactusIndex.ts +40 -0
- package/src/types/CactusLM.ts +24 -0
- package/src/types/CactusSTT.ts +27 -1
- package/src/types/common.ts +28 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_util.so +0 -0
- package/lib/module/types/CactusModel.js +0 -2
- package/lib/module/types/CactusSTTModel.js +0 -2
- package/lib/typescript/src/types/CactusModel.d.ts +0 -13
- package/lib/typescript/src/types/CactusModel.d.ts.map +0 -1
- package/lib/typescript/src/types/CactusSTTModel.d.ts +0 -8
- package/lib/typescript/src/types/CactusSTTModel.d.ts.map +0 -1
- package/src/types/CactusModel.ts +0 -15
- package/src/types/CactusSTTModel.ts +0 -10
|
@@ -110,7 +110,7 @@ export class Telemetry {
|
|
|
110
110
|
try {
|
|
111
111
|
this.deviceId =
|
|
112
112
|
(await CactusUtil.getDeviceId()) ??
|
|
113
|
-
(await Database.registerDevice(deviceInfo));
|
|
113
|
+
(await Database.registerDevice({ deviceData: deviceInfo }));
|
|
114
114
|
} catch (error) {
|
|
115
115
|
console.log(error);
|
|
116
116
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface CactusIndexParams {
|
|
2
|
+
name: string;
|
|
3
|
+
embeddingDim: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface CactusIndexAddParams {
|
|
7
|
+
ids: number[];
|
|
8
|
+
documents: string[];
|
|
9
|
+
embeddings: number[][];
|
|
10
|
+
metadatas?: string[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CactusIndexGetParams {
|
|
14
|
+
ids: number[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface CactusIndexGetResult {
|
|
18
|
+
documents: string[];
|
|
19
|
+
metadatas: string[];
|
|
20
|
+
embeddings: number[][];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface IndexQueryOptions {
|
|
24
|
+
topK?: number;
|
|
25
|
+
scoreThreshold?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface CactusIndexQueryParams {
|
|
29
|
+
embeddings: number[][];
|
|
30
|
+
options?: IndexQueryOptions;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface CactusIndexQueryResult {
|
|
34
|
+
ids: number[][];
|
|
35
|
+
scores: number[][];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CactusIndexDeleteParams {
|
|
39
|
+
ids: number[];
|
|
40
|
+
}
|
package/src/types/CactusLM.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { type ModelOptions } from './common';
|
|
2
|
+
|
|
1
3
|
export interface CactusLMParams {
|
|
2
4
|
model?: string;
|
|
3
5
|
contextSize?: number;
|
|
4
6
|
corpusDir?: string;
|
|
7
|
+
options?: ModelOptions;
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
export interface CactusLMDownloadParams {
|
|
@@ -20,6 +23,7 @@ export interface CompleteOptions {
|
|
|
20
23
|
topK?: number;
|
|
21
24
|
maxTokens?: number;
|
|
22
25
|
stopSequences?: string[];
|
|
26
|
+
forceTools?: boolean;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
export interface Tool {
|
|
@@ -60,8 +64,28 @@ export interface CactusLMCompleteResult {
|
|
|
60
64
|
totalTokens: number;
|
|
61
65
|
}
|
|
62
66
|
|
|
67
|
+
export interface CactusLMTokenizeParams {
|
|
68
|
+
text: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface CactusLMTokenizeResult {
|
|
72
|
+
tokens: number[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface CactusLMScoreWindowParams {
|
|
76
|
+
tokens: number[];
|
|
77
|
+
start: number;
|
|
78
|
+
end: number;
|
|
79
|
+
context: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface CactusLMScoreWindowResult {
|
|
83
|
+
score: number;
|
|
84
|
+
}
|
|
85
|
+
|
|
63
86
|
export interface CactusLMEmbedParams {
|
|
64
87
|
text: string;
|
|
88
|
+
normalize?: boolean;
|
|
65
89
|
}
|
|
66
90
|
|
|
67
91
|
export interface CactusLMEmbedResult {
|
package/src/types/CactusSTT.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { type ModelOptions } from './common';
|
|
2
|
+
|
|
1
3
|
export interface CactusSTTParams {
|
|
2
4
|
model?: string;
|
|
3
5
|
contextSize?: number;
|
|
6
|
+
options?: ModelOptions;
|
|
4
7
|
}
|
|
5
8
|
|
|
6
9
|
export interface CactusSTTDownloadParams {
|
|
@@ -16,7 +19,7 @@ export interface TranscribeOptions {
|
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
export interface CactusSTTTranscribeParams {
|
|
19
|
-
|
|
22
|
+
audio: string | number[];
|
|
20
23
|
prompt?: string;
|
|
21
24
|
options?: TranscribeOptions;
|
|
22
25
|
onToken?: (token: string) => void;
|
|
@@ -40,3 +43,26 @@ export interface CactusSTTAudioEmbedParams {
|
|
|
40
43
|
export interface CactusSTTAudioEmbedResult {
|
|
41
44
|
embedding: number[];
|
|
42
45
|
}
|
|
46
|
+
|
|
47
|
+
export interface CactusSTTStreamTranscribeInsertParams {
|
|
48
|
+
audio: number[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface StreamTranscribeProcessOptions {
|
|
52
|
+
confirmationThreshold?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface CactusSTTStreamTranscribeProcessParams {
|
|
56
|
+
options?: StreamTranscribeProcessOptions;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface CactusSTTStreamTranscribeProcessResult {
|
|
60
|
+
success: boolean;
|
|
61
|
+
confirmed: string;
|
|
62
|
+
pending: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface CactusSTTStreamTranscribeFinalizeResult {
|
|
66
|
+
success: boolean;
|
|
67
|
+
confirmed: string;
|
|
68
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface CactusModel {
|
|
2
|
+
completion: boolean;
|
|
3
|
+
tools: boolean;
|
|
4
|
+
vision: boolean;
|
|
5
|
+
embed: boolean;
|
|
6
|
+
speech: boolean;
|
|
7
|
+
quantization: {
|
|
8
|
+
int4: {
|
|
9
|
+
sizeMb: number;
|
|
10
|
+
url: string;
|
|
11
|
+
pro?: {
|
|
12
|
+
apple: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
int8: {
|
|
16
|
+
sizeMb: number;
|
|
17
|
+
url: string;
|
|
18
|
+
pro?: {
|
|
19
|
+
apple: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ModelOptions {
|
|
26
|
+
quantization?: 'int4' | 'int8';
|
|
27
|
+
pro?: boolean;
|
|
28
|
+
}
|
|
Binary file
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface CactusModel {
|
|
2
|
-
name: string;
|
|
3
|
-
slug: string;
|
|
4
|
-
quantization: number;
|
|
5
|
-
sizeMb: number;
|
|
6
|
-
downloadUrl: string;
|
|
7
|
-
supportsToolCalling: boolean;
|
|
8
|
-
supportsVision: boolean;
|
|
9
|
-
supportsCompletion: boolean;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
isDownloaded: boolean;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=CactusModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusModel.d.ts","sourceRoot":"","sources":["../../../../src/types/CactusModel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAE1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,IAAI,CAAC;IAGhB,YAAY,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusSTTModel.d.ts","sourceRoot":"","sources":["../../../../src/types/CactusSTTModel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAE7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAGhB,YAAY,EAAE,OAAO,CAAC;CACvB"}
|
package/src/types/CactusModel.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface CactusModel {
|
|
2
|
-
// API
|
|
3
|
-
name: string;
|
|
4
|
-
slug: string;
|
|
5
|
-
quantization: number;
|
|
6
|
-
sizeMb: number;
|
|
7
|
-
downloadUrl: string;
|
|
8
|
-
supportsToolCalling: boolean;
|
|
9
|
-
supportsVision: boolean;
|
|
10
|
-
supportsCompletion: boolean;
|
|
11
|
-
createdAt: Date;
|
|
12
|
-
|
|
13
|
-
// Local
|
|
14
|
-
isDownloaded: boolean;
|
|
15
|
-
}
|