Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
Add tool choice type
Akarshan6b86baaa2f16
diff --git a/core/src/browser/extensions/engines/AIEngine.ts b/core/src/browser/extensions/engines/AIEngine.tsindex 90d78a97a..2d75dea8f 100644--- a/core/src/browser/extensions/engines/AIEngine.ts+++ b/core/src/browser/extensions/engines/AIEngine.ts@@ -38,10 +38,22 @@ export interface ToolCallOptions {tools?: Tool[];}+// A specific tool choice to force the model to call+export interface ToolCallSpec {+ type: 'function';+ function: {+ name: string;+ };+}++// tool_choice may be one of several modes or a specific call+export type ToolChoice = 'none' | 'auto' | 'required' | ToolCallSpec;+export interface chatCompletionRequest {model: string; // Model ID, though for local it might be implicit via sessionInfomessages: chatCompletionRequestMessage[];tools?: Tool[];+ tool_choice?: ToolChoice;// Core sampling parameterstemperature?: number | nulldynatemp_range?: number | null