-
Notifications
You must be signed in to change notification settings - Fork 0
Added feature to get conversations history into a spreadsheet for analysis #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: msrmain
Are you sure you want to change the base?
Conversation
…ate an Excel file for analysis
analysis/chat_history/history.py
Outdated
|
|
||
| return container | ||
|
|
||
| def got_conversations(start_date = None, end_date = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gOt conversations ? :D
analysis/chat_history/history.py
Outdated
| def extend_dataframe(df): | ||
| # "Promote" the content form the user_query and chat_response columns to the top level of the dataframe | ||
| df['user_input'] = df['user_query'].apply(lambda x: x['content'] if pd.notnull(x) and 'content' in x else None) | ||
| df['answer'] = df['chat_response'].apply(lambda x: x['choices'][0]['messages'][0]['content'] if pd.notnull(x) and 'choices' in x and len(x['choices']) > 0 and 'messages' in x['choices'][0] and len(x['choices'][0]['messages']) > 0 and 'content' in x['choices'][0]['messages'][0] else None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to check for message count>0 and choice count > 0 here before extracting ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe all the needed checks are there. I formatted it across multiple lines for readability. Please let me know if this covers your concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry about that.. readable now
… with conversation details and context
Added Jupyter notebook and helper scripts to enable getting conversations data from a Cosmos DB and creating an Excel spreadsheet for analysis.