import { EnumLike, z } from "zod"; import { CortexStep, NextFunction, StepCommand } from "./cortexStep"; import { ChatMessageRoleEnum } from "./languageModels"; /** * externalDialog is used to create dialog that is said by the Open Soul, generally used for textual interactions. The opitonal `extraInstructions` parameter is used to provide additional instructions to the Open Soul. * For example, you might add "Keep responses to 1-2 sentences at most." or `${entityName} should say a critical comment, and not ask questions.` * * @param [extraInstructions] These are instructions that help guide the response of the Open Soul. * @param [verb] - The verb that is used to describe the action of the Open Soul. For example, "said" or "yelloed", defaults to "said" * * When used in a CortexStep#next command, the typed #value will be a string */ export declare const externalDialog: (extraInstructions?: string, verb?: string) => () => { command: ({ entityName: name }: CortexStep) => string; commandRole: ChatMessageRoleEnum; streamProcessor: ({ entityName }: CortexStep, stream: AsyncIterable) => Promise>; process: (step: CortexStep, response: string) => { value: string; memories: { role: ChatMessageRoleEnum; content: string; }[]; }; }; /** * spokenDialog is used to create dialog that is spoken outloud by the Open Soul. It includes verbal tickets, * ellipsis, etc to make the dialog more realistic when spoken. * The optional `extraInstructions` parameter is used to provide additional instructions to the Open Soul. * For example, you might add "Speak with a sense of urgency." or `${entityName} should speak in a calm and soothing tone.` * * @param [extraInstructions] These are instructions that help guide the response of the Open Soul. * @param [verb] - The verb that is used to describe the action of the Open Soul. For example, "said" or "whispered", defaults to "said" * * When used in a CortexStep#next command, the typed #value will be a string */ export declare const spokenDialog: (extraInstructions?: string, verb?: string) => () => { command: ({ entityName: name }: CortexStep) => string; streamProcessor: ({ entityName }: CortexStep, stream: AsyncIterable) => Promise>; commandRole: ChatMessageRoleEnum; process: (step: CortexStep, response: string) => { value: string; memories: { role: ChatMessageRoleEnum; content: string; }[]; }; }; /** * internalMonologue is used to create an internal thought process that is thought by the Open Soul. The optional `extraInstructions` parameter is used to provide additional instructions to the Open Soul. * For example, you might add "Keep thoughts to 1-2 sentences at most." or `${entityName} notes the user's response on the topic of climate change.` or "What strongly felt emotions does Samantha have about the last message?" * * @param [extraInstructions] These are instructions that help guide the response of the Open Soul. * @param [verb] - The verb that is used to describe the action of the Open Soul. For example, "thought" or "pondered", defaults to "thought" * * When used in a CortexStep#next command, the typed #value will be a string */ export declare const internalMonologue: (extraInstructions?: string, verb?: string) => () => { command: ({ entityName: name }: CortexStep) => string; streamProcessor: ({ entityName }: CortexStep, stream: AsyncIterable) => Promise>; process: (step: CortexStep, response: string) => { value: string; memories: { role: ChatMessageRoleEnum; content: string; }[]; }; }; /** * decision is used to pick from a set of choices. The `description` parameter is used to describe the decision to be made and the `choices` parameter provides the set of choices to pick from. * * Example: * decision("is samantha still angry enough to scream?", ["yes", "no"]) * * Example: * decision("What color should the car be?", ["red", "blue", "green", "yellow"]) * * @param description - This is a description of the decision to be made. * @param choices - These are the choices to pick from. * * When used in a CortexStep#next command, the typed #value will the value of one of the choices submitted. */ export declare const decision: (description: string, choices: EnumLike | string[]) => () => { name: string; description: string; parameters: z.ZodObject<{ decision: z.ZodNativeEnum; }, "strip", z.ZodTypeAny, { decision: string | number; }, { decision: string | number; }>; process: (step: CortexStep, response: z.output; }, "strip", z.ZodTypeAny, { decision: string | number; }, { decision: string | number; }>>) => { value: string | number; memories: { role: ChatMessageRoleEnum; content: string; }[]; }; }; /** * brainstorm is used to generate new ideas. The `description` parameter is used to describe the brainstorming session. * * Example: * brainstorm("What are some potential features for our new product?") * * @param description - This is a description of the idea to think through. * * When used in a CortexStep#next command, the typed #value will be a string[] */ export declare const brainstorm: (description: string) => ({ entityName }: CortexStep) => { name: string; description: string; command: string; parameters: z.ZodObject<{ new_ideas: z.ZodArray; }, "strip", z.ZodTypeAny, { new_ideas: string[]; }, { new_ideas: string[]; }>; process: (step: CortexStep, response: z.output; }, "strip", z.ZodTypeAny, { new_ideas: string[]; }, { new_ideas: string[]; }>>) => { value: string[]; memories: { role: ChatMessageRoleEnum; content: string; }[]; }; }; /** * @deprecated since version 0.1.3, will be removed in version 0.2.0. Use questionMemory instead. */ export declare const queryMemory: (query: string) => () => { name: string; description: string; parameters: z.ZodObject<{ answer: z.ZodString; }, "strip", z.ZodTypeAny, { answer: string; }, { answer: string; }>; command: string; process: (_step: CortexStep, response: z.infer>) => { value: string; memories: { role: ChatMessageRoleEnum; content: string; }[]; }; }; /** * questionMemory is used to retrieve a detailed answer from memory based on a given question. * Unlike mentalQuery, which is designed to determine the truth value (true/false) of a statement, * questionMemory aims to provide a comprehensive response. * * @param question - The question to answer from memory */ export declare const questionMemory: (question: string) => () => { name: string; description: string; parameters: z.ZodObject<{ answer: z.ZodString; }, "strip", z.ZodTypeAny, { answer: string; }, { answer: string; }>; command: string; process: (_step: CortexStep, response: z.infer>) => { value: string; memories: { role: ChatMessageRoleEnum; content: string; }[]; }; }; /** * mentalQuery is used to model the mind of an entity and make a decision based on a question. The `question` parameter should be a true or false statement. * * Example: * mentalQuery("The meeting is today.") * * @param statement - A true or false statement that the entity evaluates. * * When used in a CortexStep#next or #compute command, the typed #value will be the boolean result of the decision process, reflecting the entity's belief. * This cognitive function makes two calls to the underlying LanguageProcessor: one to think through */ export declare const mentalQuery: (statement: string) => () => { command: ({ entityName: name }: CortexStep) => string; process: (step: CortexStep, response: string) => Promise<{ value: boolean; memories: { content: string; role: ChatMessageRoleEnum; }[]; }>; }; /** * `instruction` is used for instructions that do not use function calling. * Instead, these instructions are inserted directly into the dialog. * However, they are removed when the answer is returned. */ export declare const instruction: (command: StepCommand) => NextFunction; /** * @deprecated will be removed in 0.2.0, use instruction instead. */ export declare const stringCommand: (command: StepCommand) => NextFunction;