Skip to content

add faq#7

Open
skosarew wants to merge 5 commits into
masterfrom
feature/slack_bot
Open

add faq#7
skosarew wants to merge 5 commits into
masterfrom
feature/slack_bot

Conversation

@skosarew

Copy link
Copy Markdown
Contributor

Add getting answers from faq table

@submaps submaps left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add comments

Comment thread support_model.py
Comment thread support_model.py Outdated


def get_answer_if_known(query):
gc = gspread.service_account(filename='ods-qna-dd4a610895ad.json')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where is this file? What does its name mean? Is it a file with credentials?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it possible to add this info from file to the environment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll send it privately. I'm afraid not, it's not possible. Also, change name to ods-qna-secret.json.

@submaps submaps Mar 20, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok. I think we can create this file from env text variable. I mean it will be better to make one env.sh file with all credentials, tokens and variables. This file of course we will be share privately.

Comment thread support_model.py Outdated
Comment thread support_model.py Outdated
list_of_dicts = questions.get_all_records()

for dct in list_of_dicts:
if query in dct['known_question']:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have second column known_question_synonimous, so we have to search there too. In addition, I suggest to extract this condition to function is_query_in_row. Further, we will improve this condition.

@skosarew skosarew Mar 20, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • add method is_query_in_row

@skosarew skosarew Mar 20, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • find in known_question_synonimous

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about tests?

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.

2 participants