agentnet 0.1.17 → 0.1.19
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/package.json +1 -1
- package/src/agent/executor.js +7 -1
- package/src/llm/gemini.js +2 -2
package/package.json
CHANGED
package/src/agent/executor.js
CHANGED
|
@@ -38,7 +38,6 @@ export function makeToolsAndHandoffsMap(llmType, toolsAndHandoffsMap, tools, han
|
|
|
38
38
|
if (!tools) {
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
41
|
try {
|
|
43
42
|
// Process tools
|
|
44
43
|
for (const tool of tools) {
|
|
@@ -46,6 +45,9 @@ export function makeToolsAndHandoffsMap(llmType, toolsAndHandoffsMap, tools, han
|
|
|
46
45
|
logger.warn('Skipping undefined tool');
|
|
47
46
|
continue;
|
|
48
47
|
}
|
|
48
|
+
if (toolsAndHandoffsMap[tool.name] !== undefined) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
49
51
|
|
|
50
52
|
if (!tool.schema) {
|
|
51
53
|
toolsAndHandoffsMap.tools.push(tool);
|
|
@@ -76,6 +78,10 @@ export function makeToolsAndHandoffsMap(llmType, toolsAndHandoffsMap, tools, han
|
|
|
76
78
|
if (llmType === 'openai') {
|
|
77
79
|
handoff.schema.type = 'function'
|
|
78
80
|
}
|
|
81
|
+
|
|
82
|
+
if (toolsAndHandoffsMap[handoff.name] !== undefined) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
79
85
|
|
|
80
86
|
// Add handoff schema to tools list
|
|
81
87
|
toolsAndHandoffsMap.tools.push(handoff.schema);
|
package/src/llm/gemini.js
CHANGED
|
@@ -42,7 +42,6 @@ class GeminiLLM extends BaseLLM {
|
|
|
42
42
|
*/
|
|
43
43
|
async callModel(llmClientConfig, context) {
|
|
44
44
|
const { client, toolsAndHandoffsMap, conversation } = context;
|
|
45
|
-
|
|
46
45
|
// conversation is always a Conversation object
|
|
47
46
|
const input = { ...llmClientConfig, contents: conversation.getRawConversation() };
|
|
48
47
|
|
|
@@ -61,6 +60,7 @@ class GeminiLLM extends BaseLLM {
|
|
|
61
60
|
});
|
|
62
61
|
|
|
63
62
|
try {
|
|
63
|
+
|
|
64
64
|
const res = await client.models.generateContent(input);
|
|
65
65
|
logger.debug('Gemini response', res)
|
|
66
66
|
logger.debug('Gemini response received', {
|
|
@@ -135,7 +135,7 @@ class GeminiLLM extends BaseLLM {
|
|
|
135
135
|
* @returns {Promise<string|null>} Text response or null if processing tool calls
|
|
136
136
|
*/
|
|
137
137
|
async onResponse(state, conversation, toolsAndHandoffsMap, response) {
|
|
138
|
-
logger.info('Gemini onResponse'
|
|
138
|
+
logger.info('Gemini onResponse');
|
|
139
139
|
|
|
140
140
|
if (response.text !== undefined) {
|
|
141
141
|
const modelResponse = {
|