Skip to content

Instantly share code, notes, and snippets.

@volkanunsal
Created October 11, 2024 13:48
Show Gist options
  • Save volkanunsal/4093343c75b004bd44a48213349e9d9a to your computer and use it in GitHub Desktop.
Save volkanunsal/4093343c75b004bd44a48213349e9d9a to your computer and use it in GitHub Desktop.
def parse_document(context, endpoint_name):
question = "What is patient's name?"
prompts = f"""Answer only if it is present in context other wise say not present :\n\n{context}\n\n{question}"""
query_response = query_endpoint(prompts.encode("utf-8"), endpoint_name=endpoint_name)
patient_name = parse_response(query_response)
question = "What is patient's age?"
prompts = f"""Answer only if it is present in context other wise say not present :\n\n{context}\n\n{question}"""
query_response = query_endpoint(prompts.encode("utf-8"), endpoint_name=endpoint_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment