Skip to content

Conversation

@skosarew
Copy link
Contributor

Add getting answers from faq table

Copy link
Member

@submaps submaps left a comment

Choose a reason for hiding this comment

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

Add comments

support_model.py Outdated


def get_answer_if_known(query):
gc = gspread.service_account(filename='ods-qna-dd4a610895ad.json')
Copy link
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
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
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.

Copy link
Member

@submaps submaps Mar 20, 2021

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.

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
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.

Copy link
Contributor Author

@skosarew skosarew Mar 20, 2021

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

Copy link
Contributor Author

@skosarew skosarew Mar 20, 2021

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
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.

3 participants