@alfresco/adf-content-services
Version:
Alfresco ADF content services
53 lines (52 loc) • 2.23 kB
TypeScript
import { AiAnswerEntry, KnowledgeRetrievalConfigEntry, QuestionModel, QuestionRequest, SearchAiApi } from '@alfresco/js-api';
import { Observable } from 'rxjs';
import { SelectionState } from '@alfresco/adf-extensions';
import { TranslateService } from '@ngx-translate/core';
import { SearchAiInputState } from '../models/search-ai-input-state';
import { AlfrescoApiService } from '../../services';
import * as i0 from "@angular/core";
export declare class SearchAiService {
private apiService;
private translateService;
private toggleSearchAiInput;
private _searchAiApi;
get searchAiApi(): SearchAiApi;
toggleSearchAiInput$: Observable<SearchAiInputState>;
constructor(apiService: AlfrescoApiService, translateService: TranslateService);
/**
* Update the state of the search AI input.
*
* @param state The new state of the search AI input.
*/
updateSearchAiInputState(state: SearchAiInputState): void;
/**
* Ask a question to the AI.
*
* @param question The question to ask.
* @returns QuestionModel object containing information about questions.
*/
ask(question: QuestionRequest): Observable<QuestionModel>;
/**
* Get an answer to specific question.
*
* @param questionId The ID of the question to get an answer for.
* @returns AiAnswerEntry object containing the answer.
*/
getAnswer(questionId: string): Observable<AiAnswerEntry>;
/**
* Get the knowledge retrieval configuration.
*
* @returns KnowledgeRetrievalConfigEntry object containing the configuration.
*/
getConfig(): Observable<KnowledgeRetrievalConfigEntry>;
/**
* Check if using of search is possible (if all conditions are met).
*
* @param selectedNodesState information about selected nodes.
* @param maxSelectedNodes max number of selected nodes. Default 100.
* @returns string with error if any condition is not met, empty string otherwise.
*/
checkSearchAvailability(selectedNodesState: SelectionState, maxSelectedNodes?: number): string;
static ɵfac: i0.ɵɵFactoryDeclaration<SearchAiService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<SearchAiService>;
}