mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Improve Function Call argument validation and typing (#2881)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
committed by
GitHub
parent
137ffec3f6
commit
4dab31f1c8
@@ -5,19 +5,20 @@
|
||||
*/
|
||||
|
||||
import { BaseTool, ToolResult } from './tools.js';
|
||||
import { FunctionDeclaration, Type } from '@google/genai';
|
||||
import * as fs from 'fs/promises';
|
||||
import * as path from 'path';
|
||||
import { homedir } from 'os';
|
||||
|
||||
const memoryToolSchemaData = {
|
||||
const memoryToolSchemaData: FunctionDeclaration = {
|
||||
name: 'save_memory',
|
||||
description:
|
||||
'Saves a specific piece of information or fact to your long-term memory. Use this when the user explicitly asks you to remember something, or when they state a clear, concise fact that seems important to retain for future interactions.',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
type: Type.OBJECT,
|
||||
properties: {
|
||||
fact: {
|
||||
type: 'string',
|
||||
type: Type.STRING,
|
||||
description:
|
||||
'The specific fact or piece of information to remember. Should be a clear, self-contained statement.',
|
||||
},
|
||||
@@ -98,7 +99,7 @@ function ensureNewlineSeparation(currentContent: string): string {
|
||||
}
|
||||
|
||||
export class MemoryTool extends BaseTool<SaveMemoryParams, ToolResult> {
|
||||
static readonly Name: string = memoryToolSchemaData.name;
|
||||
static readonly Name: string = memoryToolSchemaData.name!;
|
||||
constructor() {
|
||||
super(
|
||||
MemoryTool.Name,
|
||||
|
||||
Reference in New Issue
Block a user