Resolver for Skip AI interactions Handles conversations with Skip, learning cycles, and related operations. Skip is an AI agent that can analyze data, answer questions, and learn from interactions.

Deprecated

AskSkipResolver and related are not in use anymore, the

See

SkipProxyAgent is used instead

Constructors

Properties

__lastRefreshTime: number = 0
__refreshInProgress: Promise<SkipEntityInfo[]> = null
__skipEntitiesCache$: BehaviorSubject<SkipEntityInfo[]> = ...
_defaultNewChatName: string = 'New Chat'

Default name for new conversations

_maxHistoricalMessages: number = 30

Maximum number of historical messages to include in a conversation context

Methods

  • Builds or retrieves Skip entities from cache Uses caching with request deduplication to avoid expensive rebuilding of entity information Multiple concurrent calls will share the same refresh operation

    Parameters

    • dataSource: ConnectionPool

      Database connection

    • forceRefresh: boolean = false

      Whether to force a refresh regardless of cache state

    • refreshIntervalMinutes: number = 15

      Minutes before cache expires

    Returns Promise<SkipEntityInfo[]>

    Array of entity information

  • Loads the conversations that have been updated or added since the last learning cycle These are used to train Skip and improve its understanding

    Parameters

    • lastLearningCycleDate: Date

      The date of the last learning cycle

    • dataSource: ConnectionPool

      Database connection

    • contextUser: UserInfo

      User context for the request

    Returns Promise<SkipConversation[]>

    Array of conversations that are new or have been updated since the last cycle

  • Packages up queries from the metadata based on their status Used to provide Skip with information about available queries

    Parameters

    • status: "Pending" | "In-Review" | "Approved" | "Rejected" | "Obsolete" = 'Approved'

      The status of queries to include

    Returns SkipQueryInfo[]

    Array of query information objects

  • Creates a conversation detail entry for an AI message Stores the AI response in the conversation history

    Parameters

    • apiResponse: SkipAPIResponse

      The response from the Skip API

    • conversationID: string

      ID of the conversation

    • user: UserInfo

      User context for the operation

    • userPayload: UserPayload

    Returns Promise<string>

    ID of the created conversation detail, or empty string if creation failed

  • Executes an analysis query with Skip This is the primary entry point for general Skip conversations

    Parameters

    • UserQuestion: string

      The question or message from the user

    • ConversationId: string

      ID of an existing conversation, or empty for a new conversation

    • dataSource: AppContext

      Database connection

    • pubSub: PubSubEngine

      Publisher/subscriber for events

    • Optional DataContextId: string

      Optional ID of a data context to use

    • Optional ForceEntityRefresh: boolean

      Whether to force a refresh of entity metadata

    • Optional StartTime: Date

    Returns Promise<AskSkipResultType>

    Result of the Skip interaction

  • Handles a chat interaction with Skip about a specific data record Allows users to ask questions about a particular entity record

    Parameters

    • UserQuestion: string

      The question or message from the user

    • ConversationId: string

      ID of an existing conversation, or empty for a new conversation

    • EntityName: string

      The name of the entity the record belongs to

    • compositeKey: CompositeKeyInputType

      The primary key values that identify the specific record

    • __namedParameters: AppContext
    • pubSub: PubSubEngine

      Publisher/subscriber for events

    Returns Promise<AskSkipResultType>

    Result of the Skip interaction

  • Finishes a successful conversation and notifies the user Creates necessary records, artifacts, and notifications

    Parameters

    Returns Promise<{
        AIMessageConversationDetailID: string;
    }>

    The ID of the AI message conversation detail

  • Gets the date of the last complete learning cycle for the Skip agent Used to determine which data to include in the next learning cycle

    Parameters

    • agentID: string

      ID of the Skip agent

    • user: UserInfo

      User context for the query

    Returns Promise<Date>

    Date of the last complete learning cycle, or epoch if none exists

  • Handles the analysis complete phase of the Skip chat process Finalizes the conversation and creates necessary artifacts

    Parameters

    Returns Promise<AskSkipResultType>

    Result of the Skip interaction

  • Handles the data request phase of the Skip chat process Processes data requests from Skip and loads requested data

    Parameters

    • apiRequest: SkipAPIRequest

      The original request sent to Skip

    • apiResponse: SkipAPIDataRequestResponse

      The data request response from Skip

    • UserQuestion: string

      The original user question

    • user: UserInfo

      User information

    • dataSource: ConnectionPool

      Database connection

    • ConversationId: string

      ID of the conversation

    • userPayload: UserPayload

      User payload from context

    • pubSub: PubSubEngine

      Publisher/subscriber for events

    • convoEntity: ConversationEntity

      Conversation entity

    • convoDetailEntity: ConversationDetailEntity

      Conversation detail entity for the user message

    • dataContext: DataContext

      Data context associated with the conversation

    • dataContextEntity: DataContextEntity

      Data context entity

    • conversationDetailCount: number

      Tracking count to prevent infinite loops

    • startTime: Date

    Returns Promise<AskSkipResultType>

    Result of the Skip interaction

  • Handles the main Skip chat request processing flow Routes the request through the different phases based on the Skip API response

    Parameters

    • input: SkipAPIRequest

      Skip API request to send

    • UserQuestion: string

      The question or message from the user

    • user: UserInfo

      User information

    • dataSource: ConnectionPool

      Database connection

    • ConversationId: string

      ID of the conversation

    • userPayload: UserPayload

      User payload from context

    • pubSub: PubSubEngine

      Publisher/subscriber for events

    • md: Metadata

      Metadata instance

    • convoEntity: ConversationEntity

      Conversation entity

    • convoDetailEntity: ConversationDetailEntity

      Conversation detail entity for the user message

    • dataContext: DataContext

      Data context associated with the conversation

    • dataContextEntity: DataContextEntity

      Data context entity

    • conversationDetailCount: number

      Tracking count to prevent infinite loops

    • startTime: Date

    Returns Promise<AskSkipResultType>

    Result of the Skip interaction

  • Loads conversation details from the database and transforms them into Skip message format Used to provide Skip with conversation history for context

    Parameters

    • dataSource: ConnectionPool

      Database connection

    • ConversationId: string

      ID of the conversation to load details for

    • Optional maxHistoricalMessages: number

      Maximum number of historical messages to include

    • Optional roleFilter: string

    Returns Promise<SkipMessage[]>

    Array of messages in Skip format

  • Maps database role values to Skip API role format Converts role names from database format to the format expected by Skip API

    Parameters

    • role: string

      Database role value

    Returns "user" | "system"

    Skip API role value ('user' or 'system')

  • Packs entity rows for inclusion in Skip requests Provides sample data based on entity configuration

    Parameters

    • e: EntityInfo

      Entity information

    • dataSource: ConnectionPool

      Database connection

    Returns Promise<any[]>

    Array of entity rows based on packing configuration

  • Publishes a status update message to the user based on the Skip API response Provides feedback about what phase of processing is happening

    Parameters

    • apiResponse: SkipAPIResponse

      The response from the Skip API

    • userPayload: UserPayload

      User payload from context

    • conversationID: string

      ID of the conversation

    • pubSub: PubSubEngine

      Publisher/subscriber for events

    Returns Promise<void>

  • Re-attaches the current session to receive status updates for a processing conversation This is needed after page reloads to resume receiving push notifications

    Parameters

    Returns Promise<ReattachConversationResponse>

  • Builds the base Skip API request with common fields and data Creates the foundation for both chat and learning cycle requests

    Parameters

    • contextUser: UserInfo

      The user making the request

    • dataSource: ConnectionPool

      The data source to use

    • includeEntities: boolean

      Whether to include entities in the request

    • includeQueries: boolean

      Whether to include queries in the request

    • includeNotes: boolean

      Whether to include agent notes in the request

    • filterUserNotesToContextUser: boolean
    • includeRequests: boolean

      Whether to include agent requests in the request

    • forceEntitiesRefresh: boolean = false

      Whether to force refresh of entities

    • includeCallBackKeyAndAccessToken: boolean = false

      Whether to include a callback key and access token

    • additionalTokenInfo: any = {}

      Additional info to include in the access token

    Returns Promise<BaseSkipRequest>

    Base request data that can be used by specific request builders

  • Builds up an array of artifacts associated with a conversation Artifacts are content or documents generated during conversations

    Parameters

    • contextUser: UserInfo

      User context for the query

    • dataSource: ConnectionPool

      Database connection

    • conversationId: string

      ID of the conversation

    Returns Promise<SkipAPIArtifact[]>

    Array of artifacts associated with the conversation

  • Builds the chat API request for Skip Creates a request specific to a chat interaction

    Parameters

    • messages: SkipMessage[]

      Array of messages in the conversation

    • conversationId: string

      ID of the conversation

    • dataContext: DataContext

      Data context associated with the conversation

    • requestPhase: SkipRequestPhase

      The phase of the request (initial, clarifying, etc.)

    • includeEntities: boolean

      Whether to include entities in the request

    • includeQueries: boolean

      Whether to include queries in the request

    • includeNotes: boolean

      Whether to include agent notes in the request

    • includeRequests: boolean

      Whether to include agent requests in the request

    • contextUser: UserInfo

      User context for the request

    • dataSource: ConnectionPool

      Database connection

    • forceEntitiesRefresh: boolean = false

      Whether to force refresh of entities

    • includeCallBackKeyAndAccessToken: boolean = false

      Whether to include a callback key and access token

    Returns Promise<SkipAPIRequest>

    Complete chat request object

  • Builds the learning API request for Skip Creates a request specific to the learning cycle operation

    Parameters

    • learningCycleId: string

      ID of the current learning cycle

    • lastLearningCycleDate: Date

      Date of the last completed learning cycle

    • includeEntities: boolean

      Whether to include entities in the request

    • includeQueries: boolean

      Whether to include queries in the request

    • includeNotes: boolean

      Whether to include agent notes in the request

    • includeRequests: boolean

      Whether to include agent requests in the request

    • dataSource: ConnectionPool

      Database connection

    • contextUser: UserInfo

      User context for the request

    • forceEntitiesRefresh: boolean = false

      Whether to force refresh of entities

    • includeCallBackKeyAndAccessToken: boolean = false

      Whether to include a callback key and access token

    Returns Promise<SkipAPILearningCycleRequest>

    Complete learning cycle request object

  • Gets the ID of an agent note type by its name Falls back to a default note type if the specified one is not found

    Parameters

    • name: string

      Name of the agent note type

    • defaultNoteType: string = 'AI'

      Default note type to use if the specified one is not found

    Returns string

    ID of the agent note type