Created
May 13, 2026 20:20
-
-
Save pazteddy/b297ed90a31e3d314494d36e257efa67 to your computer and use it in GitHub Desktop.
Verifica límite ANTES de ejecutar para el caso tool_use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (this.toolCallsLastTurn + toolUseBlocks.length > MAX_TOOL_CALLS) { | |
| console.warn( | |
| `Límite de ${MAX_TOOL_CALLS} tool calls alcanzado en este turno` | |
| ); | |
| const limitMessage = | |
| `He alcanzado el límite de ${MAX_TOOL_CALLS} llamadas a herramientas por turno. ` + | |
| `Para completar esta tarea, intenta dividirla en preguntas más específicas.`; | |
| this.messages.push({ | |
| role: "assistant", | |
| content: limitMessage, | |
| }); | |
| return { | |
| text: limitMessage, | |
| toolsUsed, | |
| inputTokens: inputTokensThisTurn, | |
| outputTokens: outputTokensThisTurn, | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment