File

platform-components-ng/projects/platform-components-lib/src/lib/components/collection/service/ai.service.ts

Index

Methods

Constructor

constructor(http: HttpClient)
Parameters :
Name Type Optional
http HttpClient No

Methods

aiRequestContentType
aiRequestContentType()

Ai request content type

Returns : string

string

Async cancelAllContentModelDetection
cancelAllContentModelDetection()

Cancels the polling for content model detection status for all current polling keys or a specific document.

Returns : Promise<void>

A Promise representing the completion of the cancellation process.

deleteServiceProvider
deleteServiceProvider(config: AIServiceProviderResponse)

Deletes a service provider.

Parameters :
Name Type Optional
config AIServiceProviderResponse No
Returns : Observable<any>

Observable - an observable that emits the response from the server

detectContentModel
detectContentModel(detectContentModels: AiDetectContentModelRequest[])

Sends a request to detect the content model(s) for the provided documents.

Parameters :
Name Type Optional Description
detectContentModels AiDetectContentModelRequest[] No
  • An array of AiDetectContentModelRequest objects representing the documents to analyze.
Returns : Observable<Record<string, string>>

An Observable containing the server's response with detected content models.

getDefaultServiceProvider
getDefaultServiceProvider()
Returns : Observable<any>
getPageFragments
getPageFragments(url: string)

Retrieves the page fragments for a given asset ID and page number.

Parameters :
Name Type Optional Description
url string No

url.

Returns : Observable<any>

An Observable that emits the page fragments.

getPagePreview
getPagePreview(previewRequest: any)

Retrieves the page preview for a given asset ID.

Parameters :
Name Type Optional Description
previewRequest any No

Preview Request.

An Observable that emits the page preview data.

initTransformation
initTransformation(transformationModels: AiTransformationModelRequest[])

Initializes transformation models by sending them to the backend API.

Parameters :
Name Type Optional Description
transformationModels AiTransformationModelRequest[] No
  • An array of AiTransformationModelRequest objects to be initialized.
Returns : Observable<Record<string, string>>

An Observable representing the HTTP POST request to initialize the transformation models.

keepAlive
keepAlive(sessionId: string)

Sends a keep-alive request to the AI service.

Parameters :
Name Type Optional Description
sessionId string No
  • The session ID.
Returns : Observable<any>

An Observable that emits the response from the server

loadMoreResults
loadMoreResults(next_page: string)

Loads more results from the specified next page.

Parameters :
Name Type Optional Description
next_page string No

The URL of the next page.

Returns : Observable<any>

An Observable of type AiQuarkyResponse.

pollDetectContentModelStatus
pollDetectContentModelStatus(detectTasks: string[])

Polls the statuses of content model detection tasks.

Sends a POST request to the backend to retrieve the current statuses of the specified detection tasks.

Parameters :
Name Type Optional Description
detectTasks string[] No
  • An array of task IDs representing the detection tasks to check the status for.
Returns : Observable<AiDocumentStatusResponse>

An Observable<AiDocumentStatusResponse> containing the response from the backend with the statuses of the requested tasks.

pollDetectContentModelStatusWithPolling
pollDetectContentModelStatusWithPolling(detectTasks: string[])

Polls the statuses of content model detection tasks and emits updates via an Observable.

Parameters :
Name Type Optional Description
detectTasks string[] No
  • An array of task IDs representing the detection tasks to check the status for.
Returns : Observable<AiDocumentStatusResponse>

Observable - Emits each polling response until all tasks are complete.

Async quarky
quarky(content: string, command: string, contentType, requestType: string)
Parameters :
Name Type Optional Default value
content string No
command string No
contentType No this.aiRequestContentType()
requestType string No ""
registerServiceProvider
registerServiceProvider(config: AIServiceProviderRequestBody)

Registers a service provider with the given configuration.

Parameters :
Name Type Optional
config AIServiceProviderRequestBody No
Returns : Observable<any>

Observable - An observable that emits the response from the API call.

stopPolling
stopPolling()

Stops the polling process by completing the stopPolling$ subject. This will notify all subscribers to stop listening for further polling events.

Returns : void
Async transformAIRequest
transformAIRequest(request: AiQuarkyRequest)
Parameters :
Name Type Optional
request AiQuarkyRequest No
Returns : Promise<boolean>
Async transformAIResponse
transformAIResponse(response: AiQuarkyResponse, requestTransformed: boolean)
Parameters :
Name Type Optional
response AiQuarkyResponse No
requestTransformed boolean No
Returns : Promise<void>
updateServiceProvider
updateServiceProvider(config: AIServiceProviderRequestBody)

Updates the service provider with the given config.

Parameters :
Name Type Optional
config AIServiceProviderRequestBody No
Returns : Observable<any>

Observable} - An Observable that emits the response of the HTTP PUT request.

result-matching ""

    No results matching ""