Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 2 additions & 46 deletions libraries/botbuilder-ai/botbuilder/ai/luis/intent_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,5 @@ class IntentScore(object):
"""

def __init__(self, score: float = None, properties: Dict[str, object] = {}):
self._score: float = score
self._properties: Dict[str, object] = properties

@property
def score(self) -> float:
"""Gets confidence in an intent.

:return: Confidence in an intent.
:rtype: float
"""

return self._score

@score.setter
def score(self, value: float) -> None:
"""Sets confidence in an intent.

:param value: Confidence in an intent.
:type value: float
:return:
:rtype: None
"""

self._score = value

@property
def properties(self) -> Dict[str, object]:
"""Gets any extra properties to include in the results.

:return: Any extra properties to include in the results.
:rtype: Dict[str, object]
"""

return self._properties

@properties.setter
def properties(self, value: Dict[str, object]) -> None:
"""Sets any extra properties to include in the results.

:param value: Any extra properties to include in the results.
:type value: Dict[str, object]
:return:
:rtype: None
"""

self._properties = value
self.score: float = score
self.properties: Dict[str, object] = properties
72 changes: 3 additions & 69 deletions libraries/botbuilder-ai/botbuilder/ai/luis/luis_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def __init__(self, application_id: str, endpoint_key: str, endpoint: str):
if not valid:
raise ValueError(f'"{endpoint}" is not a valid LUIS endpoint.')

self._application_id = application_id
self._endpoint_key = endpoint_key
self._endpoint = endpoint
self.application_id = application_id
self.endpoint_key = endpoint_key
self.endpoint = endpoint

@classmethod
def from_application_endpoint(cls, application_endpoint: str):
Expand All @@ -59,72 +59,6 @@ def from_application_endpoint(cls, application_endpoint: str):
)
return cls(application_id, endpoint_key, endpoint)

@property
def application_id(self) -> str:
"""Gets LUIS application ID.
:return: LUIS application ID.
:rtype: str
"""

return self._application_id

@application_id.setter
def application_id(self, value: str) -> None:
"""Sets LUIS application ID.
:param value: LUIS application ID.
:type value: str
:return:
:rtype: None
"""

self._application_id = value

@property
def endpoint_key(self) -> str:
"""Gets LUIS subscription or endpoint key.
:return: LUIS subscription or endpoint key.
:rtype: str
"""

return self._endpoint_key

@endpoint_key.setter
def endpoint_key(self, value: str) -> None:
"""Sets LUIS subscription or endpoint key.
:param value: LUIS subscription or endpoint key.
:type value: str
:return:
:rtype: None
"""

self._endpoint_key = value

@property
def endpoint(self) -> str:
"""Gets LUIS endpoint like https://westus.api.cognitive.microsoft.com.
:return: LUIS endpoint where application is hosted.
:rtype: str
"""

return self._endpoint

@endpoint.setter
def endpoint(self, value: str) -> None:
"""Sets LUIS endpoint like https://westus.api.cognitive.microsoft.com.
:param value: LUIS endpoint where application is hosted.
:type value: str
:return:
:rtype: None
"""

self._endpoint = value

@staticmethod
def _parse(application_endpoint: str) -> Tuple[str, str, str]:
url, valid = LuisApplication._try_parse_url(application_endpoint)
Expand Down
241 changes: 10 additions & 231 deletions libraries/botbuilder-ai/botbuilder/ai/luis/luis_prediction_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,234 +22,13 @@ def __init__(
telemetry_client: BotTelemetryClient = NullTelemetryClient(),
log_personal_information: bool = False,
):
self._bing_spell_check_subscription_key: str = bing_spell_check_subscription_key
self._include_all_intents: bool = include_all_intents
self._include_instance_data: bool = include_instance_data
self._log: bool = log
self._spell_check: bool = spell_check
self._staging: bool = staging
self._timeout: float = timeout
self._timezone_offset: float = timezone_offset
self._telemetry_client: BotTelemetryClient = telemetry_client
self._log_personal_information: bool = log_personal_information

@property
def bing_spell_check_subscription_key(self) -> str:
"""Gets the Bing Spell Check subscription key.
:return: The Bing Spell Check subscription key.
:rtype: str
"""

return self._bing_spell_check_subscription_key

@bing_spell_check_subscription_key.setter
def bing_spell_check_subscription_key(self, value: str) -> None:
"""Sets the Bing Spell Check subscription key.
:param value: The Bing Spell Check subscription key.
:type value: str
:return:
:rtype: None
"""

self._bing_spell_check_subscription_key = value

@property
def include_all_intents(self) -> bool:
"""Gets whether all intents come back or only the top one.
:return: True for returning all intents.
:rtype: bool
"""

return self._include_all_intents

@include_all_intents.setter
def include_all_intents(self, value: bool) -> None:
"""Sets whether all intents come back or only the top one.
:param value: True for returning all intents.
:type value: bool
:return:
:rtype: None
"""

self._include_all_intents = value

@property
def include_instance_data(self) -> bool:
"""Gets a value indicating whether or not instance data should be included in response.
:return: A value indicating whether or not instance data should be included in response.
:rtype: bool
"""

return self._include_instance_data

@include_instance_data.setter
def include_instance_data(self, value: bool) -> None:
"""Sets a value indicating whether or not instance data should be included in response.
:param value: A value indicating whether or not instance data should be included in response.
:type value: bool
:return:
:rtype: None
"""

self._include_instance_data = value

@property
def log(self) -> bool:
"""Gets if queries should be logged in LUIS.
:return: If queries should be logged in LUIS.
:rtype: bool
"""

return self._log

@log.setter
def log(self, value: bool) -> None:
"""Sets if queries should be logged in LUIS.
:param value: If queries should be logged in LUIS.
:type value: bool
:return:
:rtype: None
"""

self._log = value

@property
def spell_check(self) -> bool:
"""Gets whether to spell check queries.
:return: Whether to spell check queries.
:rtype: bool
"""

return self._spell_check

@spell_check.setter
def spell_check(self, value: bool) -> None:
"""Sets whether to spell check queries.
:param value: Whether to spell check queries.
:type value: bool
:return:
:rtype: None
"""

self._spell_check = value

@property
def staging(self) -> bool:
"""Gets whether to use the staging endpoint.
:return: Whether to use the staging endpoint.
:rtype: bool
"""

return self._staging

@staging.setter
def staging(self, value: bool) -> None:
"""Sets whether to use the staging endpoint.
:param value: Whether to use the staging endpoint.
:type value: bool
:return:
:rtype: None
"""

self._staging = value

@property
def timeout(self) -> float:
"""Gets the time in milliseconds to wait before the request times out.
:return: The time in milliseconds to wait before the request times out. Default is 100000 milliseconds.
:rtype: float
"""

return self._timeout

@timeout.setter
def timeout(self, value: float) -> None:
"""Sets the time in milliseconds to wait before the request times out.
:param value: The time in milliseconds to wait before the request times out. Default is 100000 milliseconds.
:type value: float
:return:
:rtype: None
"""

self._timeout = value

@property
def timezone_offset(self) -> float:
"""Gets the time zone offset.
:return: The time zone offset.
:rtype: float
"""

return self._timezone_offset

@timezone_offset.setter
def timezone_offset(self, value: float) -> None:
"""Sets the time zone offset.
:param value: The time zone offset.
:type value: float
:return:
:rtype: None
"""

self._timezone_offset = value

@property
def telemetry_client(self) -> BotTelemetryClient:
"""Gets the BotTelemetryClient used to log the LuisResult event.
:return: The client used to log telemetry events.
:rtype: BotTelemetryClient
"""

return self._telemetry_client

@telemetry_client.setter
def telemetry_client(self, value: BotTelemetryClient) -> None:
"""Sets the BotTelemetryClient used to log the LuisResult event.
:param value: The client used to log telemetry events.
:type value: BotTelemetryClient
:return:
:rtype: None
"""

self._telemetry_client = value

@property
def log_personal_information(self) -> bool:
"""Gets a value indicating whether to log personal information that came from the user to telemetry.
:return: If true, personal information is logged to Telemetry; otherwise the properties will be filtered.
:rtype: bool
"""

return self._log_personal_information

@log_personal_information.setter
def log_personal_information(self, value: bool) -> None:
"""Sets a value indicating whether to log personal information that came from the user to telemetry.
:param value: If true, personal information is logged to Telemetry; otherwise the properties will be filtered.
:type value: bool
:return:
:rtype: None
"""

self.log_personal_information = value
self.bing_spell_check_subscription_key: str = bing_spell_check_subscription_key
self.include_all_intents: bool = include_all_intents
self.include_instance_data: bool = include_instance_data
self.log: bool = log
self.spell_check: bool = spell_check
self.staging: bool = staging
self.timeout: float = timeout
self.timezone_offset: float = timezone_offset
self.telemetry_client: BotTelemetryClient = telemetry_client
self.log_personal_information: bool = log_personal_information
Loading