illuma-agents 1.0.6 → 1.0.8
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/cjs/events.cjs +34 -10
- package/dist/cjs/events.cjs.map +1 -1
- package/dist/cjs/llm/google/index.cjs +78 -9
- package/dist/cjs/llm/google/index.cjs.map +1 -1
- package/dist/cjs/llm/google/utils/common.cjs +185 -28
- package/dist/cjs/llm/google/utils/common.cjs.map +1 -1
- package/dist/cjs/messages/format.cjs +9 -1
- package/dist/cjs/messages/format.cjs.map +1 -1
- package/dist/cjs/tools/ToolNode.cjs +154 -55
- package/dist/cjs/tools/ToolNode.cjs.map +1 -1
- package/dist/esm/events.mjs +34 -10
- package/dist/esm/events.mjs.map +1 -1
- package/dist/esm/llm/google/index.mjs +79 -10
- package/dist/esm/llm/google/index.mjs.map +1 -1
- package/dist/esm/llm/google/utils/common.mjs +184 -30
- package/dist/esm/llm/google/utils/common.mjs.map +1 -1
- package/dist/esm/messages/format.mjs +9 -1
- package/dist/esm/messages/format.mjs.map +1 -1
- package/dist/esm/tools/ToolNode.mjs +155 -56
- package/dist/esm/tools/ToolNode.mjs.map +1 -1
- package/dist/types/events.d.ts +3 -1
- package/dist/types/llm/google/index.d.ts +10 -0
- package/dist/types/llm/google/types.d.ts +11 -1
- package/dist/types/llm/google/utils/common.d.ts +17 -2
- package/dist/types/messages/format.d.ts +7 -1
- package/dist/types/tools/ToolNode.d.ts +9 -1
- package/dist/types/types/stream.d.ts +1 -1
- package/dist/types/types/tools.d.ts +1 -1
- package/package.json +3 -3
- package/src/events.ts +37 -15
- package/src/llm/google/data/gettysburg10.wav +0 -0
- package/src/llm/google/data/hotdog.jpg +0 -0
- package/src/llm/google/index.ts +129 -14
- package/src/llm/google/llm.spec.ts +932 -0
- package/src/llm/google/types.ts +56 -43
- package/src/llm/google/utils/common.ts +873 -660
- package/src/messages/ensureThinkingBlock.test.ts +75 -0
- package/src/messages/format.ts +9 -1
- package/src/tools/ToolNode.ts +195 -64
- package/src/types/stream.ts +1 -1
- package/src/types/tools.ts +80 -80
package/src/llm/google/types.ts
CHANGED
|
@@ -1,43 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CodeExecutionTool,
|
|
3
|
-
FunctionDeclarationsTool as GoogleGenerativeAIFunctionDeclarationsTool,
|
|
4
|
-
GoogleSearchRetrievalTool,
|
|
5
|
-
} from '@google/generative-ai';
|
|
6
|
-
import { BindToolsInput } from '@langchain/core/language_models/chat_models';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
import {
|
|
2
|
+
CodeExecutionTool,
|
|
3
|
+
FunctionDeclarationsTool as GoogleGenerativeAIFunctionDeclarationsTool,
|
|
4
|
+
GoogleSearchRetrievalTool,
|
|
5
|
+
} from '@google/generative-ai';
|
|
6
|
+
import { BindToolsInput } from '@langchain/core/language_models/chat_models';
|
|
7
|
+
|
|
8
|
+
/** New GoogleSearch tool for Gemini 2.0+ models */
|
|
9
|
+
export interface GoogleSearchTool {
|
|
10
|
+
googleSearch: Record<string, never>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type GoogleGenerativeAIToolType =
|
|
14
|
+
| BindToolsInput
|
|
15
|
+
| GoogleGenerativeAIFunctionDeclarationsTool
|
|
16
|
+
| CodeExecutionTool
|
|
17
|
+
| GoogleSearchRetrievalTool
|
|
18
|
+
| GoogleSearchTool;
|
|
19
|
+
|
|
20
|
+
/** Enum for content modality types */
|
|
21
|
+
enum Modality {
|
|
22
|
+
MODALITY_UNSPECIFIED = 'MODALITY_UNSPECIFIED',
|
|
23
|
+
TEXT = 'TEXT',
|
|
24
|
+
IMAGE = 'IMAGE',
|
|
25
|
+
VIDEO = 'VIDEO',
|
|
26
|
+
AUDIO = 'AUDIO',
|
|
27
|
+
DOCUMENT = 'DOCUMENT',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Interface for modality token count */
|
|
31
|
+
interface ModalityTokenCount {
|
|
32
|
+
modality: Modality;
|
|
33
|
+
tokenCount: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Interface for input token details with cache and tier tracking */
|
|
37
|
+
export interface InputTokenDetails {
|
|
38
|
+
cache_read?: number;
|
|
39
|
+
over_200k?: number;
|
|
40
|
+
cache_read_over_200k?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Main interface for Gemini API usage metadata */
|
|
44
|
+
export interface GeminiApiUsageMetadata {
|
|
45
|
+
promptTokenCount?: number;
|
|
46
|
+
totalTokenCount?: number;
|
|
47
|
+
thoughtsTokenCount?: number;
|
|
48
|
+
candidatesTokenCount?: number;
|
|
49
|
+
toolUsePromptTokenCount?: number;
|
|
50
|
+
cachedContentTokenCount?: number;
|
|
51
|
+
promptTokensDetails: ModalityTokenCount[];
|
|
52
|
+
candidatesTokensDetails?: ModalityTokenCount[];
|
|
53
|
+
cacheTokensDetails?: ModalityTokenCount[];
|
|
54
|
+
toolUsePromptTokensDetails?: ModalityTokenCount[];
|
|
55
|
+
trafficType?: string;
|
|
56
|
+
}
|