Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit f31fdd0

Browse files
committed
removed unnecessary properties and a couple of style fixes
1 parent 969442f commit f31fdd0

File tree

16 files changed

+44
-852
lines changed

16 files changed

+44
-852
lines changed

libraries/botbuilder-ai/botbuilder/ai/luis/intent_score.py

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,5 @@ class IntentScore(object):
1010
"""
1111

1212
def __init__(self, score: float = None, properties: Dict[str, object] = {}):
13-
self._score: float = score
14-
self._properties: Dict[str, object] = properties
15-
16-
@property
17-
def score(self) -> float:
18-
"""Gets confidence in an intent.
19-
20-
:return: Confidence in an intent.
21-
:rtype: float
22-
"""
23-
24-
return self._score
25-
26-
@score.setter
27-
def score(self, value: float) -> None:
28-
"""Sets confidence in an intent.
29-
30-
:param value: Confidence in an intent.
31-
:type value: float
32-
:return:
33-
:rtype: None
34-
"""
35-
36-
self._score = value
37-
38-
@property
39-
def properties(self) -> Dict[str, object]:
40-
"""Gets any extra properties to include in the results.
41-
42-
:return: Any extra properties to include in the results.
43-
:rtype: Dict[str, object]
44-
"""
45-
46-
return self._properties
47-
48-
@properties.setter
49-
def properties(self, value: Dict[str, object]) -> None:
50-
"""Sets any extra properties to include in the results.
51-
52-
:param value: Any extra properties to include in the results.
53-
:type value: Dict[str, object]
54-
:return:
55-
:rtype: None
56-
"""
57-
58-
self._properties = value
13+
self.score: float = score
14+
self.properties: Dict[str, object] = properties

libraries/botbuilder-ai/botbuilder/ai/luis/luis_application.py

Lines changed: 3 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def __init__(self, application_id: str, endpoint_key: str, endpoint: str):
4141
if not valid:
4242
raise ValueError(f'"{endpoint}" is not a valid LUIS endpoint.')
4343

44-
self._application_id = application_id
45-
self._endpoint_key = endpoint_key
46-
self._endpoint = endpoint
44+
self.application_id = application_id
45+
self.endpoint_key = endpoint_key
46+
self.endpoint = endpoint
4747

4848
@classmethod
4949
def from_application_endpoint(cls, application_endpoint: str):
@@ -59,72 +59,6 @@ def from_application_endpoint(cls, application_endpoint: str):
5959
)
6060
return cls(application_id, endpoint_key, endpoint)
6161

62-
@property
63-
def application_id(self) -> str:
64-
"""Gets LUIS application ID.
65-
66-
:return: LUIS application ID.
67-
:rtype: str
68-
"""
69-
70-
return self._application_id
71-
72-
@application_id.setter
73-
def application_id(self, value: str) -> None:
74-
"""Sets LUIS application ID.
75-
76-
:param value: LUIS application ID.
77-
:type value: str
78-
:return:
79-
:rtype: None
80-
"""
81-
82-
self._application_id = value
83-
84-
@property
85-
def endpoint_key(self) -> str:
86-
"""Gets LUIS subscription or endpoint key.
87-
88-
:return: LUIS subscription or endpoint key.
89-
:rtype: str
90-
"""
91-
92-
return self._endpoint_key
93-
94-
@endpoint_key.setter
95-
def endpoint_key(self, value: str) -> None:
96-
"""Sets LUIS subscription or endpoint key.
97-
98-
:param value: LUIS subscription or endpoint key.
99-
:type value: str
100-
:return:
101-
:rtype: None
102-
"""
103-
104-
self._endpoint_key = value
105-
106-
@property
107-
def endpoint(self) -> str:
108-
"""Gets LUIS endpoint like https://westus.api.cognitive.microsoft.com.
109-
110-
:return: LUIS endpoint where application is hosted.
111-
:rtype: str
112-
"""
113-
114-
return self._endpoint
115-
116-
@endpoint.setter
117-
def endpoint(self, value: str) -> None:
118-
"""Sets LUIS endpoint like https://westus.api.cognitive.microsoft.com.
119-
120-
:param value: LUIS endpoint where application is hosted.
121-
:type value: str
122-
:return:
123-
:rtype: None
124-
"""
125-
126-
self._endpoint = value
127-
12862
@staticmethod
12963
def _parse(application_endpoint: str) -> Tuple[str, str, str]:
13064
url, valid = LuisApplication._try_parse_url(application_endpoint)

libraries/botbuilder-ai/botbuilder/ai/luis/luis_prediction_options.py

Lines changed: 10 additions & 231 deletions
Original file line numberDiff line numberDiff line change
@@ -22,234 +22,13 @@ def __init__(
2222
telemetry_client: BotTelemetryClient = NullTelemetryClient(),
2323
log_personal_information: bool = False,
2424
):
25-
self._bing_spell_check_subscription_key: str = bing_spell_check_subscription_key
26-
self._include_all_intents: bool = include_all_intents
27-
self._include_instance_data: bool = include_instance_data
28-
self._log: bool = log
29-
self._spell_check: bool = spell_check
30-
self._staging: bool = staging
31-
self._timeout: float = timeout
32-
self._timezone_offset: float = timezone_offset
33-
self._telemetry_client: BotTelemetryClient = telemetry_client
34-
self._log_personal_information: bool = log_personal_information
35-
36-
@property
37-
def bing_spell_check_subscription_key(self) -> str:
38-
"""Gets the Bing Spell Check subscription key.
39-
40-
:return: The Bing Spell Check subscription key.
41-
:rtype: str
42-
"""
43-
44-
return self._bing_spell_check_subscription_key
45-
46-
@bing_spell_check_subscription_key.setter
47-
def bing_spell_check_subscription_key(self, value: str) -> None:
48-
"""Sets the Bing Spell Check subscription key.
49-
50-
:param value: The Bing Spell Check subscription key.
51-
:type value: str
52-
:return:
53-
:rtype: None
54-
"""
55-
56-
self._bing_spell_check_subscription_key = value
57-
58-
@property
59-
def include_all_intents(self) -> bool:
60-
"""Gets whether all intents come back or only the top one.
61-
62-
:return: True for returning all intents.
63-
:rtype: bool
64-
"""
65-
66-
return self._include_all_intents
67-
68-
@include_all_intents.setter
69-
def include_all_intents(self, value: bool) -> None:
70-
"""Sets whether all intents come back or only the top one.
71-
72-
:param value: True for returning all intents.
73-
:type value: bool
74-
:return:
75-
:rtype: None
76-
"""
77-
78-
self._include_all_intents = value
79-
80-
@property
81-
def include_instance_data(self) -> bool:
82-
"""Gets a value indicating whether or not instance data should be included in response.
83-
84-
:return: A value indicating whether or not instance data should be included in response.
85-
:rtype: bool
86-
"""
87-
88-
return self._include_instance_data
89-
90-
@include_instance_data.setter
91-
def include_instance_data(self, value: bool) -> None:
92-
"""Sets a value indicating whether or not instance data should be included in response.
93-
94-
:param value: A value indicating whether or not instance data should be included in response.
95-
:type value: bool
96-
:return:
97-
:rtype: None
98-
"""
99-
100-
self._include_instance_data = value
101-
102-
@property
103-
def log(self) -> bool:
104-
"""Gets if queries should be logged in LUIS.
105-
106-
:return: If queries should be logged in LUIS.
107-
:rtype: bool
108-
"""
109-
110-
return self._log
111-
112-
@log.setter
113-
def log(self, value: bool) -> None:
114-
"""Sets if queries should be logged in LUIS.
115-
116-
:param value: If queries should be logged in LUIS.
117-
:type value: bool
118-
:return:
119-
:rtype: None
120-
"""
121-
122-
self._log = value
123-
124-
@property
125-
def spell_check(self) -> bool:
126-
"""Gets whether to spell check queries.
127-
128-
:return: Whether to spell check queries.
129-
:rtype: bool
130-
"""
131-
132-
return self._spell_check
133-
134-
@spell_check.setter
135-
def spell_check(self, value: bool) -> None:
136-
"""Sets whether to spell check queries.
137-
138-
:param value: Whether to spell check queries.
139-
:type value: bool
140-
:return:
141-
:rtype: None
142-
"""
143-
144-
self._spell_check = value
145-
146-
@property
147-
def staging(self) -> bool:
148-
"""Gets whether to use the staging endpoint.
149-
150-
:return: Whether to use the staging endpoint.
151-
:rtype: bool
152-
"""
153-
154-
return self._staging
155-
156-
@staging.setter
157-
def staging(self, value: bool) -> None:
158-
"""Sets whether to use the staging endpoint.
159-
160-
161-
:param value: Whether to use the staging endpoint.
162-
:type value: bool
163-
:return:
164-
:rtype: None
165-
"""
166-
167-
self._staging = value
168-
169-
@property
170-
def timeout(self) -> float:
171-
"""Gets the time in milliseconds to wait before the request times out.
172-
173-
:return: The time in milliseconds to wait before the request times out. Default is 100000 milliseconds.
174-
:rtype: float
175-
"""
176-
177-
return self._timeout
178-
179-
@timeout.setter
180-
def timeout(self, value: float) -> None:
181-
"""Sets the time in milliseconds to wait before the request times out.
182-
183-
:param value: The time in milliseconds to wait before the request times out. Default is 100000 milliseconds.
184-
:type value: float
185-
:return:
186-
:rtype: None
187-
"""
188-
189-
self._timeout = value
190-
191-
@property
192-
def timezone_offset(self) -> float:
193-
"""Gets the time zone offset.
194-
195-
:return: The time zone offset.
196-
:rtype: float
197-
"""
198-
199-
return self._timezone_offset
200-
201-
@timezone_offset.setter
202-
def timezone_offset(self, value: float) -> None:
203-
"""Sets the time zone offset.
204-
205-
:param value: The time zone offset.
206-
:type value: float
207-
:return:
208-
:rtype: None
209-
"""
210-
211-
self._timezone_offset = value
212-
213-
@property
214-
def telemetry_client(self) -> BotTelemetryClient:
215-
"""Gets the BotTelemetryClient used to log the LuisResult event.
216-
217-
:return: The client used to log telemetry events.
218-
:rtype: BotTelemetryClient
219-
"""
220-
221-
return self._telemetry_client
222-
223-
@telemetry_client.setter
224-
def telemetry_client(self, value: BotTelemetryClient) -> None:
225-
"""Sets the BotTelemetryClient used to log the LuisResult event.
226-
227-
:param value: The client used to log telemetry events.
228-
:type value: BotTelemetryClient
229-
:return:
230-
:rtype: None
231-
"""
232-
233-
self._telemetry_client = value
234-
235-
@property
236-
def log_personal_information(self) -> bool:
237-
"""Gets a value indicating whether to log personal information that came from the user to telemetry.
238-
239-
:return: If true, personal information is logged to Telemetry; otherwise the properties will be filtered.
240-
:rtype: bool
241-
"""
242-
243-
return self._log_personal_information
244-
245-
@log_personal_information.setter
246-
def log_personal_information(self, value: bool) -> None:
247-
"""Sets a value indicating whether to log personal information that came from the user to telemetry.
248-
249-
:param value: If true, personal information is logged to Telemetry; otherwise the properties will be filtered.
250-
:type value: bool
251-
:return:
252-
:rtype: None
253-
"""
254-
255-
self.log_personal_information = value
25+
self.bing_spell_check_subscription_key: str = bing_spell_check_subscription_key
26+
self.include_all_intents: bool = include_all_intents
27+
self.include_instance_data: bool = include_instance_data
28+
self.log: bool = log
29+
self.spell_check: bool = spell_check
30+
self.staging: bool = staging
31+
self.timeout: float = timeout
32+
self.timezone_offset: float = timezone_offset
33+
self.telemetry_client: BotTelemetryClient = telemetry_client
34+
self.log_personal_information: bool = log_personal_information

0 commit comments

Comments
 (0)