-
-
Save KyMidd/b69b7dc67a53b8db038c863496b18019 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Format kb_responses into a list of sources | |
| kb_responses_text = [] | |
| for kb_response in kb_responses: | |
| kb_responses_text.append( | |
| [ | |
| kb_response['text'] | |
| ] | |
| ) | |
| # Flatten | |
| kb_responses_text = [item[0] for item in kb_responses_text] | |
| # Construct body | |
| body = json.dumps( | |
| { | |
| "query": flat_conversation, | |
| "documents": kb_responses_text, | |
| "top_n": rerank_number_of_results, | |
| } | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment