QnAMaker class
Eseguire una query su QnA Maker knowledge base per le risposte e fornire commenti e suggerimenti.
Costruttori
Qn |
Crea una nuova istanza di QnAMaker. |
Proprietà
log |
Ottiene un valore che indica se determina se registrare le informazioni personali provenienti dall'utente. |
telemetry |
Ottiene botTelemetryClient attualmente configurato che registra gli eventi. |
Metodi
answer(Turn |
Chiama generateAnswer() e invia la risposta risultante come risposta all'utente. |
call |
Inviare commenti e suggerimenti alla knowledge base. |
generate |
Chiama il servizio QnA Maker per generare risposte per una domanda. |
get |
Chiama il servizio QnA Maker per generare risposte per una domanda. |
get |
Genera una risposta dalla knowledge base. |
get |
Genera una risposta dal knowledge base QnA Maker. |
get |
Filtra la domanda ambigua per l'apprendimento attivo. |
Dettagli costruttore
QnAMaker(QnAMakerEndpoint, QnAMakerOptions, BotTelemetryClient, boolean)
Crea una nuova istanza di QnAMaker.
new QnAMaker(endpoint: QnAMakerEndpoint, options?: QnAMakerOptions, telemetryClient?: BotTelemetryClient, logPersonalInformation?: boolean)
Parametri
- endpoint
- QnAMakerEndpoint
Endpoint dell'knowledge base da eseguire query.
- options
- QnAMakerOptions
(Facoltativo) impostazioni aggiuntive usate per configurare l'istanza.
- telemetryClient
-
BotTelemetryClient
BotTelemetryClient usato per registrare gli eventi di telemetria.
- logPersonalInformation
-
boolean
Impostare su true per includere informazioni personali negli eventi di telemetria.
Dettagli proprietà
logPersonalInformation
Ottiene un valore che indica se determina se registrare le informazioni personali provenienti dall'utente.
boolean logPersonalInformation
Valore della proprietà
boolean
True se registra le informazioni personali nel metodo BotTelemetryClient.TrackEvent; in caso contrario, le proprietà verranno filtrate.
telemetryClient
Ottiene botTelemetryClient attualmente configurato che registra gli eventi.
BotTelemetryClient telemetryClient
Valore della proprietà
BotTelemetryClient
BotTelemetryClient attualmente configurato che registra l'evento QnaMessage.
Dettagli metodo
answer(TurnContext)
Avviso
Questa API è ora deprecata.
Instead, favor using QnAMaker.getAnswers() to generate answers for a question.
Chiama generateAnswer() e invia la risposta risultante come risposta all'utente.
function answer(context: TurnContext): Promise<boolean>
Parametri
- context
-
TurnContext
Contesto per il turno corrente della conversazione con l'utente.
Restituisce
Promise<boolean>
Una promessa che risolve true se è stata inviata una risposta
callTrain(FeedbackRecords)
Inviare commenti e suggerimenti alla knowledge base.
function callTrain(feedbackRecords: FeedbackRecords): Promise<void>
Parametri
- feedbackRecords
- FeedbackRecords
Record di feedback.
Restituisce
Promise<void>
Promessa che rappresenta l'operazione asincrona
generateAnswer(string | undefined, number, number)
Avviso
Questa API è ora deprecata.
Instead, favor using QnAMaker.getAnswers() to generate answers for a question.
Chiama il servizio QnA Maker per generare risposte per una domanda.
function generateAnswer(question: string | undefined, top?: number, _scoreThreshold?: number): Promise<QnAMakerResult[]>
Parametri
- question
-
string | undefined
Domanda da rispondere.
- top
-
number
(Facoltativo) numero di risposte da restituire. Per impostazione predefinita viene impostato su un valore di 1
.
- _scoreThreshold
-
number
(Facoltativo) punteggio minimo di risposta necessario per essere considerato una corrispondenza alle domande. Per impostazione predefinita viene impostato su un valore di 0.001
.
Restituisce
Promise<QnAMakerResult[]>
Una promessa che risolve i risultati di QnAMaker
getAnswers(TurnContext, QnAMakerOptions, [key: string]: string, [key: string]: number)
Chiama il servizio QnA Maker per generare risposte per una domanda.
function getAnswers(context: TurnContext, options?: QnAMakerOptions, telemetryProperties?: [key: string]: string, telemetryMetrics?: [key: string]: number): Promise<QnAMakerResult[]>
Parametri
- context
-
TurnContext
Contesto turni che contiene la domanda dell'utente da eseguire una query sul knowledge base.
- options
- QnAMakerOptions
(Facoltativo) Opzioni per il knowledge base QnA Maker. Se null, l'opzione del costruttore viene usata per questa istanza.
- telemetryProperties
-
[key: string]: string
Proprietà aggiuntive da registrare ai dati di telemetria con l'evento QnaMessage.
- telemetryMetrics
-
[key: string]: number
Metriche aggiuntive da registrare ai dati di telemetria con l'evento QnaMessage.
Restituisce
Promise<QnAMakerResult[]>
Una promessa che risolve il risultato QnAMaker
getAnswersRaw(TurnContext, QnAMakerOptions, [key: string]: string, [key: string]: number)
Genera una risposta dalla knowledge base.
function getAnswersRaw(context: TurnContext, options: QnAMakerOptions, telemetryProperties: [key: string]: string, telemetryMetrics: [key: string]: number): Promise<QnAMakerResults>
Parametri
- context
-
TurnContext
TurnContext che contiene la domanda dell'utente da eseguire query sul knowledge base.
- options
- QnAMakerOptions
Facoltativa. QnAMakerOptions per il knowledge base QnA Maker. Se null, l'opzione del costruttore viene usata per questa istanza.
- telemetryProperties
-
[key: string]: string
Facoltativa. Proprietà aggiuntive da registrare ai dati di telemetria con l'evento QnaMessage.
- telemetryMetrics
-
[key: string]: number
Facoltativa. Metriche aggiuntive da registrare ai dati di telemetria con l'evento QnaMessage.
Restituisce
Promise<QnAMakerResults>
Elenco delle risposte per la query utente, ordinato in ordine decrescente del punteggio di classificazione.
getLegacyAnswersRaw(TurnContext, QnAMakerOptions, [key: string]: string, [key: string]: number)
Genera una risposta dal knowledge base QnA Maker.
function getLegacyAnswersRaw(context: TurnContext, options?: QnAMakerOptions, telemetryProperties?: [key: string]: string, telemetryMetrics?: [key: string]: number): Promise<QnAMakerResults>
Parametri
- context
-
TurnContext
TurnContext che contiene la domanda dell'utente da eseguire query sul knowledge base.
- options
- QnAMakerOptions
Facoltativa. QnAMakerOptions per il knowledge base QnA Maker. Se null, l'opzione del costruttore viene usata per questa istanza.
- telemetryProperties
-
[key: string]: string
Facoltativa. Proprietà aggiuntive da registrare ai dati di telemetria con l'evento QnaMessage.
- telemetryMetrics
-
[key: string]: number
Facoltativa. Metriche aggiuntive da registrare ai dati di telemetria con l'evento QnaMessage.
Restituisce
Promise<QnAMakerResults>
Elenco delle risposte per la query utente, ordinato in ordine decrescente del punteggio di classificazione.
getLowScoreVariation(QnAMakerResult[])
Filtra la domanda ambigua per l'apprendimento attivo.
function getLowScoreVariation(queryResult: QnAMakerResult[]): QnAMakerResult[]
Parametri
- queryResult
Output query utente.
Restituisce
risultati filtrati