Options
All
  • Public
  • Public/Protected
  • All
Menu

Class for copilot base service

Hierarchy

  • CopilotService

Index

Constructors

  • Create instance of CXoneAuth

    @example
    const copilotService = new CopilotService();

    Returns CopilotService

Properties

AGENT_COPILOT_AGENT_ASSIST_HUB_CONFIG: string = ...
AGENT_COPILOT_BASE_URI: string = '/agentcopilotapi/v1/'
AGENT_COPILOT_BASE_URI_V2: string = '/agentcopilotapi/v2/'
AGENT_COPILOT_EMAIL_APIS: { GENERATE_EMAIL: string; GET_DRAFT_EMAIL: string; GET_LAST_GENERATED_TOPICS: string } = ...

Type declaration

  • GENERATE_EMAIL: string
  • GET_DRAFT_EMAIL: string
  • GET_LAST_GENERATED_TOPICS: string
AGENT_COPILOT_ENABLEMENT_FOR_CONTACT: string = ...
AGENT_COPILOT_FINAL_SUMMARY: string = ...
AGENT_COPILOT_GET_ADAPTIVE_CARD_SCHEMA: string = ...
AGENT_COPILOT_GET_ALL_ADAPTIVE_CARDS_SCHEMAS: string = ...
AGENT_COPILOT_HEALTH_CHECK: string = ...
AGENT_COPILOT_SEARCH: string = ...
aahConfigStore: {} = {}

Type declaration

auth: CXoneAuth
logger: Logger = ...
utilService: HttpUtilService = ...
validationUtilService: ValidationUtils = ...

Methods

  • addAdaptiveCardSchemaToIndexDB(copilotReduxSlice: CcfCopilotData): Promise<void>
  • Used to put copilot redux slice data into indexdb

    example
    copilotService.setCopilotIndexDb(copilotReduxSlice);
    

    Parameters

    • copilotReduxSlice: CcfCopilotData

    Returns Promise<void>

  • basePayload(): { agentId: string; contactId: any; idToken: string; tenantId: string }
  • example

    commonPayload()

    Returns { agentId: string; contactId: any; idToken: string; tenantId: string }

    payload

    • agentId: string
    • contactId: any
    • idToken: string
    • tenantId: string
  • Used to get AAH config for the contactIds from redis cache

    example
    copilotService.fetchAgentAssistConfigFromCache(['12321']);
    

    Parameters

    • contactIds: string[]

      list of contact Id

    Returns Promise<AgentAssistConfig>

  • fetchCopilotAdaptiveCardSchema(cardType: string, mediaType: string): Promise<unknown>
  • Used to get the copilot adaptive card schema by cardType

    example
    copilotService.fetchCopilotAdaptiveCardSchema("sentimentAndReason", "Voice");
    

    Parameters

    • cardType: string

      type of adaptive card

    • mediaType: string

      type of media channel

    Returns Promise<unknown>

  • fetchCopilotAllAdaptiveCardSchemas(): Promise<unknown>
  • Used to get the copilot adaptive card schema by cardType

    example
    copilotService.fetchCopilotAllAdaptiveCardSchemas();
    

    Returns Promise<unknown>

  • generateEmail(contactId: string, emailIdentifier: string, topics: { content: string; topicId: string }[]): Promise<string>
  • Used to get the draft email by contactId and uniqueEmailId

    example
    copilotService.generateEmail('12321', 'uniqueEmailId', [{topicId: '123', content: 'topicName'}]);
    

    Parameters

    • contactId: string

      contact Id

    • emailIdentifier: string

      unique email Id

    • topics: { content: string; topicId: string }[]

      list of topics

    Returns Promise<string>

  • generateFinalSummary(contactId: string): Promise<unknown>
  • Used to get the copilot info by search text

    example
    copilotService.generateFinalSummary("some_connectionId");
    

    Parameters

    • contactId: string

    Returns Promise<unknown>

  • getAgentAssistConfig(contactId: string, isObjectFlag?: boolean): any
  • Used to get AAH config for the contactId

    example
    copilotService.getAgentAssistConfig('12321',false);
    

    Parameters

    • contactId: string

      contact Id

    • isObjectFlag: boolean = false

      if the value fetched is object or not

    Returns any

  • getAgentFirstName(): any
  • Used to get first name of agent logged in

    example
    copilotService.getAgentFirstName();
    

    Returns any

  • example

    getBaseHttpRequest()

    Parameters

    • payload: any

      additional payload

    Returns HttpRequestInit

    basic http request for ACP backend

  • getBaseUrlForAcp(): string
  • example

    getBaseHttpRequest()

    Returns string

    base url for ACP backend

  • getCopilotIndexDb(): Promise<CcfCopilotData>
  • Used to get copilot data by the agentId into indexdb

    example
    copilotService.getCopilotIndexDb();
    

    Returns Promise<CcfCopilotData>

  • getDraftEmail(contactId: string, uniqueEmailId: string): Promise<unknown>
  • Used to get the draft email by contactId and uniqueEmailId

    example
    copilotService.getDraftEmail('12321', 'uniqueEmailId');
    

    Parameters

    • contactId: string

      contact Id

    • uniqueEmailId: string

      unique email Id

    Returns Promise<unknown>

  • getLastGeneratedTopics(contactId: string): Promise<unknown>
  • Used to get the last generated list of topics for the contact id

    example
    copilotService.getLastGeneratedTopics('12321');
    

    Parameters

    • contactId: string

      contact Id

    Returns Promise<unknown>

  • getLsDataByAgentId(): any
  • Used to get local storage data by the agentId

    example
    copilotService.getLsDataByAgentId();
    

    Returns any

  • healthCheck(contactId: string): Promise<unknown>
  • Used to get the copilot health

    example
    copilotService.healthCheck('1234');
    

    Parameters

    • contactId: string

      contact Id of current active contact

    Returns Promise<unknown>

  • removeCaseIdFromCopilotIndexDb(caseId: string): Promise<void>
  • Used to remove caseId record from copilot indexdb data

    example
    copilotService.removeCaseIdFromCopilotIndexDb('1695828916775981777');
    

    Parameters

    • caseId: string

    Returns Promise<void>

  • Used to get AAH config for the contactId

    example
    copilotService.retriveAgentAssistConfig('12321');
    

    Parameters

    • contactId: string

      contact Id

    Returns Promise<AgentAssistConfig>

  • Used to get the copilot info by search text

    example
    copilotService.search("test",'1234');
    

    Parameters

    • searchText: string

      Agent search query

    • activeContactId: string

      contactId/caseId

    Returns Promise<AgentCopilotSearchRequest>

  • Used to set AAH config of contactId in localStorage

    example
    copilotService.setAgentAssistConfig('123123', {ContactId : '123123',});
    

    Parameters

    • contactId: string

      contact Id for which AAH config needs to be stored

    • aahConfig: AgentAssistConfig

      AAH config for contactId

    Returns void

  • setCopilotIndexDb(updatedReduxSlice: CcfCopilotData): Promise<void>
  • Used to put copilot data by the agentId into indexdb

    example
    copilotService.setCopilotIndexDb();
    

    Parameters

    • updatedReduxSlice: CcfCopilotData

    Returns Promise<void>

  • Used to set essential copilot data

    example
    copilotService.setLsDataByAgentId("123", { sentimentAndReason: [] });
    

    Parameters

    • contactId: string

      contact id to fetch the data from

    • elementToAdd: AgentCopilotCacheElement

      element to add to the local storage

    Returns void

  • storeAgentAssistConfig(contactId: string): Promise<any>
  • Used to store AAH config for the contactId in browser memory by pulling from redis cache, if not already available

    example
    copilotService.storeAgentAssistConfig('12321');
    

    Parameters

    • contactId: string

      contact Id

    Returns Promise<any>

Generated using TypeDoc