smoltalk 0.0.12 → 0.0.13
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/dist/clients/baseClient.js +3 -2
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -26,9 +26,10 @@ export class BaseClient {
|
|
|
26
26
|
for (const [toolName, count] of Object.entries(toolCallCounts)) {
|
|
27
27
|
if (count >= this.config.toolLoopDetection.maxConsecutive &&
|
|
28
28
|
!this.config.toolLoopDetection.excludeTools.includes(toolName)) {
|
|
29
|
+
const intervention = this.config.toolLoopDetection.intervention || "remove-tool";
|
|
29
30
|
const logger = getLogger();
|
|
30
|
-
logger.warn(`Tool loop detected for tool "${toolName}" called ${count} times. Intervention: ${
|
|
31
|
-
switch (
|
|
31
|
+
logger.warn(`Tool loop detected for tool "${toolName}" called ${count} times. Intervention: ${intervention}`);
|
|
32
|
+
switch (intervention) {
|
|
32
33
|
case "remove-tool":
|
|
33
34
|
const newTools = promptConfig.tools?.filter((t) => t.name !== toolName);
|
|
34
35
|
const newPromptConfig = {
|
package/dist/types.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export type SmolConfig = {
|
|
|
38
38
|
export type ToolLoopDetection = {
|
|
39
39
|
enabled: boolean;
|
|
40
40
|
maxConsecutive: number;
|
|
41
|
-
intervention
|
|
41
|
+
intervention?: "remove-tool" | "remove-all-tools" | "throw-error" | "halt-execution";
|
|
42
42
|
excludeTools: string[];
|
|
43
43
|
};
|
|
44
44
|
export type BaseClientConfig = SmolConfig & {};
|