Skip to content

Conversation

@parharti
Copy link
Collaborator

issue #92


# OCR using pytesseract
try:
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to run on windows only?
Otherwise remove the static path.



if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True, port=3000)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug flag should come from the environment.
It should never be hard-coded.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Directory name is inconsistent.
No directory named MED_PLAT present.


# === CONFIG ===
MONGO_URI = os.environ.get("MONGO_URI", "mongodb://localhost:27017/")
DB_NAME = "medplat"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move DB_NAME, COLLECTION_NAME & SIMILARITY_THRESHOLD to the environment.

return jsonify({"fallbacks": simplified_data})

if __name__ == "__main__":
app.run(port=5001, debug=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug should not be true it should come from the environment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move all the css files into the assets folder.
This improves the maintainability of the code base.

setLoading(true);
try {
const res = await axios.delete(
`http://127.0.0.1:5000/intent_with_examples/${intent}`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Api base url should always be placed in the environment file as it gets changed according to the deployment environment.

setMessage("");
setButtons([]);

const rasaRes = await fetch("http://localhost:3000/send_message", {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API base url should come from the environment.
So that it can be changed in a single place and it takes effect everywhere.


const fetchClusters = async () => {
try {
const res = await axios.get('http://localhost:5001/get_fallbacks');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API base url should come from environment.

};

try {
const res = await axios.post('http://localhost:5000/add_intent', intentPayload);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API base url should come from environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants