agentnet 0.1.6 → 0.1.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentnet",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "description": "Agent library used by Smartness",
6
6
  "main": "src/index.js",
package/src/llm/gemini.js CHANGED
@@ -70,6 +70,7 @@ class GeminiLLM extends BaseLLM {
70
70
  responseType: res.response?.candidates ? 'candidates' : 'unknown',
71
71
  hasContent: !!res.response?.candidates?.[0]?.content
72
72
  });
73
+
73
74
  return res;
74
75
  } catch (error) {
75
76
  console.log(error)
@@ -150,7 +151,7 @@ class GeminiLLM extends BaseLLM {
150
151
  */
151
152
  async onResponse(state, conversation, toolsAndHandoffsMap, response) {
152
153
  // Handle simple text response
153
- if (response.text !== undefined) {
154
+ if (response.text !== undefined && (response.functionCalls === undefined || response.functionCalls.length === 0) ) {
154
155
  logger.debug('Gemini response contains text, returning directly');
155
156
 
156
157
  if (conversation instanceof Conversation) {
package/src/llm/gpt.js CHANGED
@@ -157,7 +157,7 @@ class OpenAILLM extends BaseLLM {
157
157
  * @returns {Promise<string|null>} Text response or null if processing tool calls
158
158
  */
159
159
  async onResponse(state, conversation, toolsAndHandoffsMap, response) {
160
- if (response.output_text !== undefined && response.output_text.length > 0) {
160
+ if (response.output_text !== undefined && response.output_text.length > 0 ) {
161
161
  logger.debug('OpenAI response contains text, returning directly');
162
162
 
163
163
  // Add model response to conversation if using Conversation object