Skip to main content

<a id=“SuperOffice_WebApi_Agents_AIAgent”></a> Class AIAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
AI services, such as Translation, Statistics, Sentiment analysis, backed by calls to Public Cloud providers

Inheritance

objectAgentBaseAIAgent

Implements

IAIAgent, IAgentBase, IDisposable

Inherited Members

AgentBase._json, AgentBase._binary, AgentBase._config, AgentBase._client, AgentBase._disposeClient, AgentBase.Merge(RequestOptions), AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string), AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.ParseAuthorization(IAuthorization), AgentBase.CancelRequest(), AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.SendRequest(HttpRequestMessage, RequestOptions), AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage), AgentBase.ParseResponse<T&gt;(HttpResponseMessage), AgentBase.Finally(RequestOptions), AgentBase.Dispose(), AgentBase.Configuration, AgentBase.Client, AgentBase.HasRunningRequest, AgentBase.ClientCancellationTokenSource, AgentBase.ProgressListener, AgentBase.UploadProgressListener, object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()

Examples

<pre><code class=“lang-csharp”>using SuperOffice.WebApi; using SuperOffice.WebApi.Agents; var mySession = new WebApiOptions(“http://example.com/super/api”); mySession.Authorization = new AuthorizationUsernamePassword(“user”, “pass”); using (AIAgent agent = new AIAgent(mySession)) { // call methods on agent here… }</code></pre>

Constructors

<a id=“SuperOffice_WebApi_Agents_AIAgent__ctor_System_Net_Http_HttpClient_”></a> AIAgent(HttpClient)

Constructor: AI services, such as Translation, Statistics, Sentiment analysis, backed by calls to Public Cloud providers

Parameters

httpClient HttpClient Use this HTTP client instead of making own HttpClient instance.

<a id=“SuperOffice_WebApi_Agents_AIAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> AIAgent(WebApiOptions, HttpClient)

Constructor: AI services, such as Translation, Statistics, Sentiment analysis, backed by calls to Public Cloud providers

Parameters

options WebApiOptions Base URL and authentication values. httpClient HttpClient Optional: Use this HTTP client instead of making a new one.

Methods

<a id=“SuperOffice_WebApi_Agents_AIAgent_AnalyzeBizCardImageAsync_System_Byte___System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> AnalyzeBizCardImageAsync(byte[], bool, RequestOptions)

Returns contact and person information from an image. Merges results with matching database records if merge = true

Parameters

image byte[] Image data containg a business card mergeWithDatabase bool Merge results from analysis with matching database records? True: match company/person names and set ids on returned entities. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<BizCard&gt; Returns a Contact and a Person entity.

<a id=“SuperOffice_WebApi_Agents_AIAgent_AnalyzeBizCardTextAsync_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> AnalyzeBizCardTextAsync(string, bool, RequestOptions)

Extract contact and person information from text. Merge results with matching database records if merge = true

Parameters

text string Text that contains useful contact and person information. mergeWithDatabase bool Merge results from analysis with matching database records? True: match company/person names and set ids on returned entities. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<BizCard&gt; Returns a Contact and a Person entity.

<a id=“SuperOffice_WebApi_Agents_AIAgent_AnswerAcceptedAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> AnswerAcceptedAsync(string, RequestOptions)

Signal that answer was inserted into response- feedback is logged and used to improve the answer algorithm.

Parameters

trackingId string The id of the answer that you are giving feedback to. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_AIAgent_AnswerAsync_System_String_System_String_SuperOffice_WebApi_Data_RagType_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> AnswerAsync(string, string, RagType, int, RequestOptions)

Returns an answer.

Parameters

namespaceName string Defines the search domain used for generating answer. e.g. ‘ServiceCopilot’ query string Question. The search query to answer. type RagType Filter results based on content type. Default: None = no filtering top int Max Number of results to use in generating answer. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RagAnswer&gt; Generated answer based on query.

<a id=“SuperOffice_WebApi_Agents_AIAgent_AnswerFeedbackAsync_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> AnswerFeedbackAsync(string, bool, RequestOptions)

Send feedback on answer - feedback is logged and used to improve the answer algorithm.

Parameters

trackingId string The id of the answer that you are giving feedback to. isThumbsUp bool True = Like, False = Dislike. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_AIAgent_AnswerUsingContextAsync_System_String_System_String_SuperOffice_WebApi_Data_RagContextIds_SuperOffice_WebApi_Data_RagType_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> AnswerUsingContextAsync(string, string, RagContextIds, RagType, int, RequestOptions)

Returns an answer based on the query, and provided context.

Parameters

namespaceName string Defines the search domain used for generating answer. e.g. ‘ServiceCopilot’ query string Question. The search query to answer. contextIds RagContextIds The IDs of the current context for contact, person, project, sale, and ticket. type RagType Filter results based on content type. Default: None = no filtering top int Max Number of results to use in generating answer. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RagAnswer&gt; Generated answer based on query.

<a id=“SuperOffice_WebApi_Agents_AIAgent_CancelIndexingAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> CancelIndexingAsync(string, RequestOptions)

Cancel the current re-indexing job on a given namespace. Leaves data in inconsistent state, because removal of old data is skipped.

Parameters

namespaceName string Identifies the namespace to stop indexing in. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RagStatus&gt; Status of the indexing run after cancellation.

<a id=“SuperOffice_WebApi_Agents_AIAgent_ClearChatbotTurnsAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> ClearChatbotTurnsAsync(string, RequestOptions)

Clears the stored history of chat messages for a given chat_id. Chat_id is usually derived from soproto + current id, but could also be arbitrary name

Parameters

chatId string identifies this chat = arbitrary name (e.g. user-defined) or the soprotocol + id (e.g. ticket-123, contact-43, diary) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_AIAgent_CreateDefaultCopilotDataSourceEntityAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultCopilotDataSourceEntityAsync(RequestOptions)

Set default values into a new CopilotDataSourceEntity. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CopilotDataSourceEntity&gt; A blank CopilotDataSourceEntity

<a id=“SuperOffice_WebApi_Agents_AIAgent_CreateDefaultCopilotEntityAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultCopilotEntityAsync(RequestOptions)

Set default values into a new CopilotEntity. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CopilotEntity&gt; A blank CopilotEntity

<a id=“SuperOffice_WebApi_Agents_AIAgent_CreateTextForAppointmentAsync_SuperOffice_WebApi_Data_AppointmentEntity_System_String_SuperOffice_WebApi_RequestOptions_”></a> CreateTextForAppointmentAsync(AppointmentEntity, string, RequestOptions)

Generate agenda text for an appointment based on appointment’s company category, title, person, etc.

Parameters

appointment AppointmentEntity The appointment object to generate text for. isoLangCode string Language returned text should be in. Blank = do not specify language. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Agenda text in markdown format

<a id=“SuperOffice_WebApi_Agents_AIAgent_DeleteCopilotDataSourceEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteCopilotDataSourceEntityAsync(int, RequestOptions)

Deletes the CopilotDataSourceEntity

Parameters

copilotDataSourceEntityId int The identity of the CopilotDataSourceEntity requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_AIAgent_DeleteCopilotEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteCopilotEntityAsync(int, RequestOptions)

Deletes the CopilotEntity

Parameters

copilotEntityId int The identity of the CopilotEntity requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_AIAgent_DetectLanguageAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> DetectLanguageAsync(string, RequestOptions)

Given a (reasonably short) text, detect the language it is written in

Parameters

text string Text to be analyzed; there may be a cost-per-character so do not send a book here requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; ISO Language code, such as NO, US, ES, FR

<a id=“SuperOffice_WebApi_Agents_AIAgent_DetectSentimentAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> DetectSentimentAsync(string, RequestOptions)

Detect the sentiment of a (reasonably short) text. Sentiment analysis may cause a translation to be made, since sentiment analysis only supports a limited set of languages

Parameters

text string Text to be analyzed requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Sentiment&gt; The sentiment information: score (-100 to +100) and confidence

<a id=“SuperOffice_WebApi_Agents_AIAgent_ExpandTextAsync_System_String_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> ExpandTextAsync(string, int, string, RequestOptions)

Generate a longer version of a text

Parameters

text string Text to embiggen percentBigger int How much to embiggen. isoLangCode string Language returned text should be in. Blank = do not specify language. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Expanded version of the text

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetChatbotPromptSuggestionsAsync_System_String_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetChatbotPromptSuggestionsAsync(string, string, int, RequestOptions)

Return one or more suggested prompts as actions to display in an empty chat window

Parameters

isoLangCode string ISO2 Language code (‘en’, ‘no’, ‘de’…) for suggestions in response soProtocol string Context for suggestions (‘contact.main.activities’) currentId int current company/person/project id - used for context in suggestions requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ChatbotTurn&gt; Contains zero or more BotActions, and welcome message in Bot response

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetChatbotResponseAsync_System_String_System_String_System_String_System_String_SuperOffice_WebApi_Data_ChatbotTurn___System_String_SuperOffice_WebApi_RequestOptions_”></a> GetChatbotResponseAsync(string, string, string, string, ChatbotTurn[], string, RequestOptions)

Return a chatbot response given prompt and previous turns. Stores the new turn in the history for the chatId

Parameters

chatId string identifies this chat = arbitrary name (e.g. user-defined) or the soprotocol + id (e.g. ticket-123, contact-43, diary) isoLangCode string ISO2 Language code (‘en’, ‘no’, ‘de’…) for suggestions in response userPrompt string User question for chatbot displayValue string User question for display - optional - null = use userPrompt previousTurns ChatbotTurn[] Chat history - all previous turns in chronological order apiUrl string CRM API endpoint URL for chatbot to make callbacks to. ‘https://example.com/superoffice/api/ requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ChatbotTurn&gt; Returns new turn that client can append to its local history.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetChatbotTurnsAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetChatbotTurnsAsync(string, RequestOptions)

Returns stored history of chat messages for a given chat_id. Chat_id is usually derived from soproto + current id, but could also be arbitrary name.

Parameters

chatId string identifies this chat = arbitrary name (e.g. user-defined) or the soprotocol + id (e.g. ticket-123, contact-43, diary) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ChatbotTurn[]&gt; Array containing zero or more turns. If you got zero turns, call GetChatbotPromptSuggestions to get an initial turn from the bot.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetCopilotDataSourceEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetCopilotDataSourceEntityAsync(int, RequestOptions)

Gets a specific CopilotDataSourceEntity object.

Parameters

copilotDataSourceEntityId int The identifier of the CopilotDataSourceEntity object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CopilotDataSourceEntity&gt; CopilotDataSourceEntity

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetCopilotEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetCopilotEntityAsync(int, RequestOptions)

Gets a specific CopilotEntity object.

Parameters

copilotEntityId int The identifier of the CopilotEntity object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CopilotEntity&gt; CopilotEntity

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetFirstFormDesignCssFromImageAsync_System_Byte___System_String_SuperOffice_WebApi_RequestOptions_”></a> GetFirstFormDesignCssFromImageAsync(byte[], string, RequestOptions)

Starts a form design analysis from an image, returning the properties for a single CSS class.

Parameters

image byte[] Image data to analyze for design cssClass string The CSS class to generate styles for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<FormDesignCss&gt; Returns CSS properties for a single CSS class, and the internal state for the analyzer.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetFirstFormDesignCssFromUrlAsync_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetFirstFormDesignCssFromUrlAsync(string, string, RequestOptions)

Starts a form design analysis from a URL, returning the properties for a single CSS class.

Parameters

url string Url of the web page to extract style from. cssClass string The CSS class to generate styles for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<FormDesignCss&gt; Returns CSS properties for a single CSS class, and the internal state for the analyzer.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetFormDesignCssFromImageAsync_System_Byte___System_String___SuperOffice_WebApi_RequestOptions_”></a> GetFormDesignCssFromImageAsync(byte[], string[], RequestOptions)

Returns Form Designer CSS based on the look of a picture

Parameters

image byte[] Image data to analyze for design cssClasses string[] List of CSS classes to generate styles for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<FormDesignCarrier&gt; Returns CSS rules and confidence score.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetFormDesignCssFromUrlAsync_System_String_System_String___SuperOffice_WebApi_RequestOptions_”></a> GetFormDesignCssFromUrlAsync(string, string[], RequestOptions)

Returns Form Designer properties based on the look of a web page

Parameters

url string Url of the web page to extract style from. cssClasses string[] List of CSS classes to generate styles for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<FormDesignCarrier&gt; Returns CSS rules and confidence score.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetFormDesignFromImageAsync_System_Byte___SuperOffice_WebApi_RequestOptions_”></a> GetFormDesignFromImageAsync(byte[], RequestOptions)

Returns Form Designer properties based on the look of a picture

Parameters

image byte[] Image data to analyze for design requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<StringDictionary&gt; Returns a Form Designer properties.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetFormDesignFromUrlAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetFormDesignFromUrlAsync(string, RequestOptions)

Returns Form Designer properties based on the look of a web page

Parameters

url string Url of the web page to extract style from. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<StringDictionary&gt; Returns a Form Designer properties.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetIndexingStatusAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetIndexingStatusAsync(string, RequestOptions)

Get the current status.

Parameters

namespaceName string Identifies the namespace to store content in. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RagStatus&gt; Status of the indexing run - may be cancelled if another run is in progress.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetNextFormDesignCssAsync_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetNextFormDesignCssAsync(string, string, RequestOptions)

Returns another CSS class, continuing the CSS generation, one class at a time.

Parameters

state string Internal state from the analyzer, from the previous call. cssClass string The CSS class to generate styles for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<FormDesignCss&gt; Returns CSS properties for a single CSS class, and the updated internal state for the analyzer.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetSummarizeContactPromptAsync_System_Int32_System_Int32_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetSummarizeContactPromptAsync(int, int, string, string, RequestOptions)

Return the prompt used to get a short summary of the activities on a contact. Does not call the chatbot for a response. Used for transfering a summary to a chat session.

Parameters

contactId int Contact id to summarize numSentences int Length of summary summary string Chatbot’s summary of the contact activities isoLangCode string Language returned text should be in. Blank = do not specify language. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ChatbotTurn&gt; Display text and Prompt used to generate a short summary of the activities on a contact.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetSummarizeSalePromptAsync_System_Int32_System_Int32_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetSummarizeSalePromptAsync(int, int, string, string, RequestOptions)

Return the prompt used to get a short summary of the activities on a sale. Does not call the chatbot for a response. Used for transfering a summary to a chat session.

Parameters

saleId int Sale id to summarize numSentences int Length of summary summary string Chatbot’s summary of the sale activities isoLangCode string Language returned text should be in requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ChatbotTurn&gt; Display text and Prompt used to generate a short summary of the activities on a sale.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetSummarizeTicketPromptAsync_System_Int32_System_Int32_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetSummarizeTicketPromptAsync(int, int, string, string, RequestOptions)

Return the prompt used to get a short summary of the messages on a ticket. Does not call the chatbot for a response. Used for transfering a summary to a chat session.

Parameters

ticketId int Ticket id to summarize numSentences int Length of summary summary string Chatbot’s summary of the ticket isoLangCode string Language returned text should be in requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ChatbotTurn&gt; Display text and Prompt used to generate a short summary of the messages on a ticket.

<a id=“SuperOffice_WebApi_Agents_AIAgent_GetTrainingStatusAsync_SuperOffice_WebApi_RequestOptions_”></a> GetTrainingStatusAsync(RequestOptions)

Calling the HugoAI endpoint to fetch the current training status.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CategorizationStatusResponse&gt; Carrier to describe the current status of HugoAI categorization

<a id=“SuperOffice_WebApi_Agents_AIAgent_GuessCategoryAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GuessCategoryAsync(int, RequestOptions)

Given a ticket’s id, guess the ticket category it should be placed in. Currently this is based on the first message in the ticket

Parameters

ticketId int Id of ticket to guess category for requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int&gt; Suggested ticket category ID

<a id=“SuperOffice_WebApi_Agents_AIAgent_ParseQueryIntoRestrictionsAsync_System_String_System_String_SuperOffice_WebApi_Data_NaturalLanguageSearch_SuperOffice_WebApi_RequestOptions_”></a> ParseQueryIntoRestrictionsAsync(string, string, NaturalLanguageSearch, RequestOptions)

Return archive restrictions based on a natural language query.

Parameters

query string What the user asked for. currents string Current context prompt. e.g. Current company name and id, what selection are we looking at? previousQuery NaturalLanguageSearch Previous query, if applicable. NULL if no previous query. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<NaturalLanguageSearch&gt; Returns archive restrictions and columns for the query. Pass this result in as the previous query on the next call to continue the conversation.

<a id=“SuperOffice_WebApi_Agents_AIAgent_RemovePhotoBackgroundAsync_System_Byte___System_String_SuperOffice_WebApi_RequestOptions_”></a> RemovePhotoBackgroundAsync(byte[], string, RequestOptions)

Returns an image with the background removed, leaving only the main subject

Parameters

image byte[] Image to be cleaned. JPG or PNG. returnContentType string Accept content-type. Default “application/octet-stream”. Could also be “application/pdf”, “text/plain”, “text/html”, or “multipart/related” requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<byte[]&gt; Image with background removed

<a id=“SuperOffice_WebApi_Agents_AIAgent_RephraseTextAsync_System_String_SuperOffice_WebApi_Data_AiTextStyle_System_String_SuperOffice_WebApi_RequestOptions_”></a> RephraseTextAsync(string, AiTextStyle, string, RequestOptions)

Generate a new version of a text

Parameters

text string Text to transform style AiTextStyle New style to transform text into (Rephrase, Correct, Casual, Formal) isoLangCode string Language returned text should be in. Blank = do not specify language. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; New version of the text

<a id=“SuperOffice_WebApi_Agents_AIAgent_SaveCopilotDataSourceEntityAsync_SuperOffice_WebApi_Data_CopilotDataSourceEntity_SuperOffice_WebApi_RequestOptions_”></a> SaveCopilotDataSourceEntityAsync(CopilotDataSourceEntity, RequestOptions)

Updates the existing CopilotDataSourceEntity or creates a new CopilotDataSourceEntity if the id parameter is 0.

Parameters

copilotDataSourceEntity CopilotDataSourceEntity The CopilotDataSourceEntity that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CopilotDataSourceEntity&gt; New or updated CopilotDataSourceEntity

<a id=“SuperOffice_WebApi_Agents_AIAgent_SaveCopilotEntityAsync_SuperOffice_WebApi_Data_CopilotEntity_SuperOffice_WebApi_RequestOptions_”></a> SaveCopilotEntityAsync(CopilotEntity, RequestOptions)

Updates the existing CopilotEntity or creates a new CopilotEntity if the id parameter is 0.

Parameters

copilotEntity CopilotEntity The CopilotEntity that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CopilotEntity&gt; New or updated CopilotEntity

<a id=“SuperOffice_WebApi_Agents_AIAgent_SearchAsync_System_String_System_String_SuperOffice_WebApi_Data_RagType_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> SearchAsync(string, string, RagType, int, RequestOptions)

Returns semantic search results from vector database.

Parameters

namespaceName string Defines the search domain. e.g. ‘ServiceCopilot’. query string Search query. type RagType Filter results based on a specific content type. Default: None = no filtering top int Max Number of results to return. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RagResult[]&gt; Array containing vector search results

<a id=“SuperOffice_WebApi_Agents_AIAgent_StartRagIndexingAsync_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> StartRagIndexingAsync(string, string, RequestOptions)

Kicks off a batch task to update the RAG index

Parameters

namespaceName string Defines the search domain. e.g. ‘ServiceCopilot’. sourceId string (Optional) Identifies the data source to update. Blank = all sources requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int&gt; The batch task id

<a id=“SuperOffice_WebApi_Agents_AIAgent_SummarizeContactAsync_System_Int32_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> SummarizeContactAsync(int, int, string, RequestOptions)

Generate a short summary of the activities on a contact

Parameters

contactId int Contact id to summarize numSentences int Length of summary isoLangCode string Language returned text should be in. Blank = do not specify language. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Short summary of the activities on a contact - in HTML.

<a id=“SuperOffice_WebApi_Agents_AIAgent_SummarizeSaleAsync_System_Int32_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> SummarizeSaleAsync(int, int, string, RequestOptions)

Generate a short summary of the activities on a sale

Parameters

saleId int Sale id to summarize numSentences int Length of summary isoLangCode string Language returned text should be in. Blank = do not specify language. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Short summary of the activities on a sale - in HTML.

<a id=“SuperOffice_WebApi_Agents_AIAgent_SummarizeTextAsync_System_String_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> SummarizeTextAsync(string, int, string, RequestOptions)

Generate a short summary of a text

Parameters

text string Text to summarize percentSmaller int How much to shorten. isoLangCode string Language returned text should be in. Blank = do not specify language. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Short summary of the text

<a id=“SuperOffice_WebApi_Agents_AIAgent_SummarizeTicketAsync_System_Int32_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> SummarizeTicketAsync(int, int, string, RequestOptions)

Generate a short summary of the messages on a ticket

Parameters

ticketId int Ticket id to summarize numSentences int Length of summary isoLangCode string Language returned text should be in requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Short summary of the messages on a ticket - in HTML.

<a id=“SuperOffice_WebApi_Agents_AIAgent_TrainCategoryGuesserAsync_System_Int32_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> TrainCategoryGuesserAsync(int, int, int, RequestOptions)

The category guesser training API will be called with an array of CategorizationTrainingItem during the (background, Batch) execution of this call

Parameters

selectionId int Id of selection of tickets, to retrieve training data from maxItems int Maximum number of tickets to retrieve data from maxTextLength int Maximum length of PlainTextBody or any other large text, truncated to nearest word boundary requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Placeholder for result… should this be a BatchTaskId? maybe not useful?

<a id=“SuperOffice_WebApi_Agents_AIAgent_TranslateAsync_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> TranslateAsync(string, string, RequestOptions)

Translate a text from one language to another. Language of the text is automatically detected.

Parameters

text string Text to be translated. Language of the text is automatically detected. targetLanguage string ISO Language code (such as FR) to translate the text into requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Translated text

<a id=“SuperOffice_WebApi_Agents_AIAgent_TranslateEntityAsync_System_String_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> TranslateEntityAsync(string, int, string, RequestOptions)

Retrieve, format and translate text for an entity to a specified language

Parameters

entityName string Name of entity to get the text to be translated; eg., ‘ticketMessage’ entityId int Identifier for the entity to get text to be translated targetLanguage string ISO Language code (such as FR) to translate the text into requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Translated text