goblin-agents 3.1.0 → 3.1.1
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/lib/llm/aiAgent.js +4 -4
- package/package.json +1 -1
package/lib/llm/aiAgent.js
CHANGED
|
@@ -623,7 +623,7 @@ class AiAgent extends Elf {
|
|
|
623
623
|
return {context, model, reasoning};
|
|
624
624
|
}
|
|
625
625
|
|
|
626
|
-
async chat(contextId, question, userDesktopId) {
|
|
626
|
+
async chat(contextId, question, userDesktopId, disableTool = false) {
|
|
627
627
|
const logger = Logger.get(contextId, this);
|
|
628
628
|
|
|
629
629
|
await this._mutex.lock(this.id);
|
|
@@ -670,7 +670,7 @@ ${context}
|
|
|
670
670
|
messages,
|
|
671
671
|
options,
|
|
672
672
|
format: this.state.format?.toJS(),
|
|
673
|
-
tools: this.state.tools?.toJS(),
|
|
673
|
+
tools: disableTool ? undefined : this.state.tools?.toJS(),
|
|
674
674
|
};
|
|
675
675
|
|
|
676
676
|
const result = await this._provider.chat(chatCompletionRequest);
|
|
@@ -684,10 +684,10 @@ ${context}
|
|
|
684
684
|
),
|
|
685
685
|
question,
|
|
686
686
|
reasoning: result.message?.reasoning,
|
|
687
|
-
callTools: !!result.message.tool_calls?.length,
|
|
687
|
+
callTools: disableTool ? 'disabled' : !!result.message.tool_calls?.length,
|
|
688
688
|
});
|
|
689
689
|
|
|
690
|
-
if (this.state.toolServiceId && this.state.tools) {
|
|
690
|
+
if (this.state.toolServiceId && this.state.tools && !disableTool) {
|
|
691
691
|
const used = await this.callTools(
|
|
692
692
|
contextId,
|
|
693
693
|
result.message,
|