UNPKG

magnitude-core

Version:
39 lines (38 loc) 1.38 kB
import { ModularMemoryContext } from "@/ai/baml_client"; import { Action } from "@/actions/types"; import { LLMClient, ModelUsage } from "@/ai/types"; import { ActionDefinition } from "@/actions"; import { Schema, z } from 'zod'; import { Image } from '@/memory/image'; import EventEmitter from "eventemitter3"; interface ModelHarnessOptions { llm: LLMClient; } export interface ModelHarnessEvents { 'tokensUsed': (usage: ModelUsage) => {}; } export declare class ModelHarness { /** * Strong reasoning agent for high level strategy and planning. */ readonly events: EventEmitter<ModelHarnessEvents>; private options; private collector; private cr; private baml; private logger; private prevTotalInputTokens; private prevTotalOutputTokens; constructor(options: { llm: LLMClient; } & Partial<ModelHarnessOptions>); reportUsage(): void; createPartialRecipe<T>(context: ModularMemoryContext, // Changed to ModularMemoryContext task: string, actionVocabulary: ActionDefinition<T>[]): Promise<{ reasoning: string; actions: Action[]; }>; extract<T extends Schema>(instructions: string, schema: T, screenshot: Image, domContent: string): Promise<z.infer<T>>; query<T extends Schema>(context: ModularMemoryContext, query: string, schema: T): Promise<z.infer<T>>; } export {};