@lvx74/openrrouter-ai-agent 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Tool.js +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvx74/openrrouter-ai-agent",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
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/Tool.js CHANGED
@@ -71,12 +71,13 @@ export class Tool {
71
71
  /**
72
72
  * Esegue il tool con gli argomenti forniti
73
73
  */
74
- async execute(args) {
74
+ async execute(args, session) {
75
75
  // Validazione con schema Zod se disponibile
76
76
  if (this.schema) {
77
77
  try {
78
78
  const validatedArgs = this.schema.parse(args)
79
- return await this.handler(validatedArgs)
79
+
80
+ return await this.handler(validatedArgs, session)
80
81
  } catch (error) {
81
82
  throw new Error(`Validation error: ${error.message}`)
82
83
  }
@@ -88,7 +89,7 @@ export class Tool {
88
89
  /**
89
90
  * Alias per compatibilità con @openai/agents
90
91
  */
91
- async run(args) {
92
- return await this.execute(args)
92
+ async run(args, session) {
93
+ return await this.execute(args, session)
93
94
  }
94
95
  }