Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

Fixup tool type definition

Akarshan6d5251d1c67c
diff --git a/core/src/browser/extensions/engines/AIEngine.ts b/core/src/browser/extensions/engines/AIEngine.ts
index c3288d241..90d78a97a 100644
--- a/core/src/browser/extensions/engines/AIEngine.ts
+++ b/core/src/browser/extensions/engines/AIEngine.ts
@@ -23,25 +23,25 @@ export interface InputAudio {
}
export interface ToolFunction {
- name: string; // Required: a-z, A-Z, 0-9, _, - (max length: 64)
- description?: string; // Optional
- parameters?: Record<string, unknown>; // Optional: JSON Schema object
- strict?: boolean | null; // Optional: defaults to false
- type: 'function'
+ name: string; // Required: a-z, A-Z, 0-9, _, -, max length 64
+ description?: string;
+ parameters?: Record<string, unknown>; // JSON Schema object
+ strict?: boolean | null; // Defaults to false
}
-export interface ToolCall {
+export interface Tool {
+ type: 'function'; // Currently, only 'function' is supported
function: ToolFunction;
}
-export interface ToolDefinition {
- tools?: ToolCall[];
+export interface ToolCallOptions {
+ tools?: Tool[];
}
export interface chatCompletionRequest {
model: string; // Model ID, though for local it might be implicit via sessionInfo
messages: chatCompletionRequestMessage[];
- tools?: ToolFunction[];
+ tools?: Tool[];
// Core sampling parameters
temperature?: number | null
dynatemp_range?: number | null