UNPKG

koishi-plugin-chatluna-plugin-common

Version:
79 lines (78 loc) 2.8 kB
import { StructuredTool, Tool } from '@langchain/core/tools'; import { Context } from 'koishi'; import { ChatLunaPlugin } from 'koishi-plugin-chatluna/services/chat'; import { Config } from '..'; import z from 'zod'; import { ChatLunaToolRunnable } from 'koishi-plugin-chatluna/llm-core/platform/types'; export declare function apply(ctx: Context, config: Config, plugin: ChatLunaPlugin): Promise<void>; export declare class ThinkTool extends StructuredTool { name: string; description: string; schema: z.ZodObject<{ thought: z.ZodString; nextThoughtNeeded: z.ZodBoolean; thoughtNumber: z.ZodNumber; totalThoughts: z.ZodNumber; isRevision: z.ZodOptional<z.ZodBoolean>; revisesThought: z.ZodOptional<z.ZodNumber>; branchFromThought: z.ZodOptional<z.ZodNumber>; branchId: z.ZodOptional<z.ZodString>; needsMoreThoughts: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { thought?: string; nextThoughtNeeded?: boolean; thoughtNumber?: number; totalThoughts?: number; isRevision?: boolean; revisesThought?: number; branchFromThought?: number; branchId?: string; needsMoreThoughts?: boolean; }, { thought?: string; nextThoughtNeeded?: boolean; thoughtNumber?: number; totalThoughts?: number; isRevision?: boolean; revisesThought?: number; branchFromThought?: number; branchId?: string; needsMoreThoughts?: boolean; }>; constructor(); /** @ignore */ _call(input: z.infer<typeof this.schema>): Promise<string>; private validateThoughtData; private formatThought; processThought(input: unknown): string; } export declare class BuiltQuestionTool extends StructuredTool { name: string; description: string; schema: z.ZodObject<{ question: z.ZodString; options: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { options?: string[]; question?: string; }, { options?: string[]; question?: string; }>; constructor(); _call(input: z.infer<typeof this.schema>, _: any, config: ChatLunaToolRunnable): Promise<string>; } export declare class BuiltUserConfirmTool extends Tool { name: string; description: string; constructor(); _call(input: string, _: any, config: ChatLunaToolRunnable): Promise<string>; } export declare class BuiltUserToastTool extends Tool { private ctx; name: string; description: string; constructor(ctx: Context); /** @ignore */ _call(input: string, _: any, config: ChatLunaToolRunnable): Promise<"Message sent successfully. " | "An error occurred while sending your message. Please try again.">; }