Interface PromptExecutionContext

Comprehensive execution context that drives dynamic prompt construction. This context is assembled by the GMI and contains all relevant information needed for intelligent contextual element selection and prompt adaptation. PromptExecutionContext

interface PromptExecutionContext {
    activePersona: IPersonaDefinition;
    workingMemory: IWorkingMemory;
    currentMood?: string;
    userSkillLevel?: string;
    taskHint?: string;
    taskComplexity?: string;
    language?: string;
    conversationSignals?: string[];
    customContext?: Record<string, unknown>;
    userPreferences?: Record<string, unknown>;
    interactionHistorySummary?: {
        successfulInteractionCount: number;
        problematicInteractionCount: number;
        commonTopics?: string[];
        lastInteractionTimestamp?: string;
    };
    sessionMetadata?: {
        sessionDurationSeconds: number;
        interactionCountInSession: number;
        userEngagementLevel?: "low" | "high" | "medium";
    };
}

Properties

activePersona: IPersonaDefinition

The currently active persona definition, guiding overall behavior and prompt structure.

workingMemory: IWorkingMemory

Access to the GMI's working memory for dynamic value retrieval (e.g., user preferences, GMI traits).

currentMood?: string

Current mood state of the GMI, which can influence tone and element selection.

userSkillLevel?: string

Assessed or declared user skill level (e.g., 'beginner', 'expert') relevant to the task.

taskHint?: string

Hint about the current task type (e.g., 'coding', 'writing', 'data_analysis').

taskComplexity?: string

Assessed complexity level of the current task (e.g., 'simple', 'complex').

language?: string

Target language for the response (BCP-47 code, e.g., 'en-US', 'fr-FR').

conversationSignals?: string[]

Signals detected in the conversation (e.g., 'user_confused', 'task_completed_successfully').

customContext?: Record<string, unknown>

Custom context flags for specialized prompting scenarios or A/B testing.

userPreferences?: Record<string, unknown>

User-specific preferences that affect prompting (e.g., verbosity, preferred formats).

interactionHistorySummary?: {
    successfulInteractionCount: number;
    problematicInteractionCount: number;
    commonTopics?: string[];
    lastInteractionTimestamp?: string;
}

Historical interaction patterns that inform adaptation (e.g., preferred response styles).

Type declaration

  • successfulInteractionCount: number
  • problematicInteractionCount: number
  • Optional commonTopics?: string[]
  • Optional lastInteractionTimestamp?: string
sessionMetadata?: {
    sessionDurationSeconds: number;
    interactionCountInSession: number;
    userEngagementLevel?: "low" | "high" | "medium";
}

Current session metadata (e.g., duration, number of turns).

Type declaration

  • sessionDurationSeconds: number
  • interactionCountInSession: number
  • Optional userEngagementLevel?: "low" | "high" | "medium"