@lvx74/openrrouter-ai-agent 1.0.1 → 1.0.3

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": "@lvx74/openrrouter-ai-agent",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A powerful AI agent toolkit compatible with @openai/agents for building conversational AI with tool calling support using OpenRouter",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/Agent.js CHANGED
@@ -48,7 +48,7 @@ export class Agent extends EventEmitter {
48
48
  // Configurazioni aggiuntive
49
49
  this.maxIterations = options.maxIterations || 10
50
50
  this.temperature = options.temperature || 0.7
51
- this.debug = options.debug || true
51
+ this.debug = options.debug !== undefined ? options.debug : true
52
52
  this.verbose = options.verbose !== undefined ? options.verbose : true // Default attivo per mostrare thoughts
53
53
  }
54
54
 
@@ -189,14 +189,14 @@ export class Agent extends EventEmitter {
189
189
  toolCall.done = true;
190
190
  toolCall.result = result;
191
191
  toolCall.execution_time = Date.now() - startTime;
192
-
192
+
193
193
  const toolMessage = {
194
194
  role: 'tool',
195
195
  tool_call_id: toolCall.id,
196
196
  tool_calls: msg.tool_calls,
197
197
  name,
198
198
  content: typeof result === 'string' ? result : JSON.stringify(result)
199
-
199
+
200
200
  }
201
201
  this.messages.push(toolMessage)
202
202
 
package/src/cli.js CHANGED
@@ -13,7 +13,8 @@ export function createChatInterface(agent, options = {}) {
13
13
  prompt = 'šŸ’¬ Tu: ',
14
14
  welcomeMessage = 'šŸ¤– Assistant: Ciao! Come posso aiutarti oggi?',
15
15
  exitCommands = ['/exit', '/quit'],
16
- showHelp = true
16
+ showHelp = true,
17
+ assistantName = 'Assistant',
17
18
  } = options
18
19
 
19
20
  const rl = readline.createInterface({
@@ -95,7 +96,7 @@ export function createChatInterface(agent, options = {}) {
95
96
 
96
97
  try {
97
98
  const result = await agent.run(input)
98
- console.log(`\nšŸ¤– Assistant: ${result.content}`)
99
+ console.log(`\nšŸ¤– ${assistantName}: ${result.content}`)
99
100
  } catch (error) {
100
101
  console.error('\nāŒ Errore:', error.message)
101
102
  }