Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class SpeechContext.
Hints for the speech recognizer to help with recognition in a specific
conversation state.
Generated from protobuf message google.cloud.dialogflow.v2.SpeechContext
Namespace
Google \ Cloud \ Dialogflow \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ phrases
array
Optional. A list of strings containing words and phrases that the speech recognizer should recognize with higher likelihood. This list can be used to: * * improve accuracy for words and phrases you expect the user to say, e.g. typical commands for your Dialogflow agent * * add additional words to the speech recognizer vocabulary * * ... See the Cloud Speech documentation for usage limits.
↳ boost
float
Optional. Boost for this context compared to other contexts: * * If the boost is positive, Dialogflow will increase the probability that the phrases in this context are recognized over similar sounding phrases. * * If the boost is unspecified or non-positive, Dialogflow will not apply any boost. Dialogflow recommends that you use boosts in the range (0, 20] and that you find a value that fits your use case with binary search.
getPhrases
Optional. A list of strings containing words and phrases that the speech
recognizer should recognize with higher likelihood.
This list can be used to:
improve accuracy for words and phrases you expect the user to say,
e.g. typical commands for your Dialogflow agent
add additional words to the speech recognizer vocabulary
Optional. Boost for this context compared to other contexts:
If the boost is positive, Dialogflow will increase the probability that
the phrases in this context are recognized over similar sounding phrases.
If the boost is unspecified or non-positive, Dialogflow will not apply
any boost.
Dialogflow recommends that you use boosts in the range (0, 20] and that you
find a value that fits your use case with binary search.
Returns
Type
Description
float
setBoost
Optional. Boost for this context compared to other contexts:
If the boost is positive, Dialogflow will increase the probability that
the phrases in this context are recognized over similar sounding phrases.
If the boost is unspecified or non-positive, Dialogflow will not apply
any boost.
Dialogflow recommends that you use boosts in the range (0, 20] and that you
find a value that fits your use case with binary search.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Dialogflow V2 Client - Class SpeechContext (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.SpeechContext)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.SpeechContext)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.SpeechContext)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.SpeechContext)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.SpeechContext)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.SpeechContext)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.SpeechContext)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.SpeechContext)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.SpeechContext)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.SpeechContext)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.SpeechContext)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.SpeechContext)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.SpeechContext)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.SpeechContext)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.SpeechContext)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.SpeechContext)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.SpeechContext)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.SpeechContext)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.SpeechContext)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.SpeechContext)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.SpeechContext) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class SpeechContext.\n\nHints for the speech recognizer to help with recognition in a specific\nconversation state.\n\nGenerated from protobuf message `google.cloud.dialogflow.v2.SpeechContext`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getPhrases\n\nOptional. A list of strings containing words and phrases that the speech\nrecognizer should recognize with higher likelihood.\n\nThis list can be used to:\n\n- improve accuracy for words and phrases you expect the user to say, e.g. typical commands for your Dialogflow agent\n- add additional words to the speech recognizer vocabulary\n- ... See the [Cloud Speech\n documentation](https://cloud.google.com/speech-to-text/quotas) for usage limits.\n\n### setPhrases\n\nOptional. A list of strings containing words and phrases that the speech\nrecognizer should recognize with higher likelihood.\n\nThis list can be used to:\n\n- improve accuracy for words and phrases you expect the user to say, e.g. typical commands for your Dialogflow agent\n- add additional words to the speech recognizer vocabulary\n- ... See the [Cloud Speech\n documentation](https://cloud.google.com/speech-to-text/quotas) for usage limits.\n\n### getBoost\n\nOptional. Boost for this context compared to other contexts:\n\n- If the boost is positive, Dialogflow will increase the probability that\n the phrases in this context are recognized over similar sounding phrases.\n\n- If the boost is unspecified or non-positive, Dialogflow will not apply\n any boost.\n Dialogflow recommends that you use boosts in the range (0, 20\\] and that you\n find a value that fits your use case with binary search.\n\n### setBoost\n\nOptional. Boost for this context compared to other contexts:\n\n- If the boost is positive, Dialogflow will increase the probability that\n the phrases in this context are recognized over similar sounding phrases.\n\n- If the boost is unspecified or non-positive, Dialogflow will not apply\n any boost.\n Dialogflow recommends that you use boosts in the range (0, 20\\] and that you\n find a value that fits your use case with binary search."]]