Skip to content

Commit

Permalink
RAIN-3244 Added support to fetch environment variable values (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit-eGov authored Aug 4, 2021
1 parent c9f5206 commit fbea6fb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
15 changes: 15 additions & 0 deletions nlp-engine/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
########### MDMS SERVICE #####################

MDMS_HOST = 'http://egov-mdms-service.egov:8080/'
MDMS_SEARCH_URL = 'egov-mdms-service/v1/_search'
MDMS_MODULE_NAME = 'Chatbot'
CITY_MASTER = 'CityNames'
CITY_LOCALE_MASTER = 'CityLocaleMasterData'

########### EGOV-LOCATION SERVICE ###############
EGOV_LOCATION_HOST = 'http://egov-location.egov:8080/'
EGOV_LOCATION_SEARCH_URL = 'egov-location/location/v11/boundarys/_search'


STATE_LEVEL_TENANTID = 'pb'
DEFAULT_LOCALISATION_TENANT = 'pb'
2 changes: 1 addition & 1 deletion nlp-engine/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ six==1.15.0
sniffio==1.1.0
tqdm==4.48.2
urllib3==1.25.10
Werkzeug==1.0.1
Werkzeug==1.0.1
3 changes: 2 additions & 1 deletion nlp-engine/src/CitySearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
import nltk
import requests
import json
import os

translator= Translator()

punct= string.punctuation

url = MDMS_HOST + MDMS_SEARCH_URL
data = {"RequestInfo":{},"MdmsCriteria":{"tenantId": "","moduleDetails":[{"moduleName":"", "masterDetails":[]}]}}
data["MdmsCriteria"]["tenantId"] = STATE_LEVEL_TENANTID
data["MdmsCriteria"]["tenantId"] = os.environ.get('DEFAULT_LOCALISATION_TENANT')
data["MdmsCriteria"]["moduleDetails"][0]["moduleName"] = MDMS_MODULE_NAME
masterDeatils = {"name":CITY_MASTER}
data["MdmsCriteria"]["moduleDetails"][0]["masterDetails"].append(masterDeatils)
Expand Down
3 changes: 2 additions & 1 deletion nlp-engine/src/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
EGOV_LOCATION_SEARCH_URL = 'egov-location/location/v11/boundarys/_search'


STATE_LEVEL_TENANTID = 'pb'
STATE_LEVEL_TENANTID = 'pb'
DEFAULT_LOCALISATION_TENANT = 'pb'

0 comments on commit fbea6fb

Please sign in to comment.