Skip to content

Commit

Permalink
Update entities_checker_util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jkshj21 authored Oct 16, 2023
1 parent a5b3377 commit 72ef9e7
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/dfcx_scrapi/tools/entities_checker_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,17 @@ def __init__(
scope=scope,
)
self.agent_id = agent_id

if creds_path:
self.creds_path = creds_path

self._intents = Intents(agent_id=self.agent_id, creds_path=self.creds_path)
self._entity_types = EntityTypes(agent_id=self.agent_id, creds_path=self.creds_path)
self._intents = Intents(
agent_id=self.agent_id,
creds_path=self.creds_path
)
self._entity_types = EntityTypes(
agent_id=self.agent_id,
creds_path=self.creds_path
)
self.intents_df = pd.DataFrame()
self.entity_types_df = pd.DataFrame()
self._intents_list = []
Expand Down Expand Up @@ -82,7 +87,9 @@ def _set_intents_df(self) -> pd.DataFrame:
})

if not self._intents_list:
self._intents_list = self._intents.list_intents(agent_id=self.agent_id)
self._intents_list = self._intents.list_intents(
agent_id=self.agent_id
)

for intent in self._intents_list:
if 'parameters' in intent:
Expand All @@ -95,7 +102,9 @@ def _set_intents_df(self) -> pd.DataFrame:
text=part.text
params = intent.parameters
param_id = part.parameter_id
entity_type = self._get_entity_by_param_id(params,param_id)
entity_type = self._get_entity_by_param_id(
params, param_id
)
tag_texts_set = (text, param_id, entity_type)
tag_texts.append(tag_texts_set)
if tag_texts:
Expand Down

0 comments on commit 72ef9e7

Please sign in to comment.