in Runtime_env/app/orchestration/tools.py [0:0]
def retrieve_info(query: str) -> tuple[str, List[Document]]:
"""
Use this when you need additional information to answer a question.
Useful for retrieving relevant information based on a query.
Available documents:
Finance: `Alphabet Investor PDFs`: This data contains quarterly earnings releases
and annual reports for Alphabet for every quarter since 2004. The Annual reports include
financial statements (balance sheet, income statement, cash flow statement), a letter to
shareholders, management discussion and analysis (MD&A), and information on corporate governance.
The quarterly earnings releases also contain key financial statements like the income statement,
balance sheet, and cash flow statement, along with management commentary and analysis of
quarterly performance.
Dataset can be found here:
https://console.cloud.google.com/storage/browser/cloud-samples-data/gen-app-builder/search/alphabet-investor-pdfs
HealthCare: `PriMock57 Healthcare consultations`: This dataset consists of 57
mock medical primary care consultations held over 5 days by 7
Babylon clinicians and 57 Babylon employees acting as patients,
using case cards with presenting complaints, symptoms, medical
& general history etc.
Dataset can be found here:
https://console.cloud.google.com/storage/browser/cloud-samples-data/vertex-ai/medlm/primock57/transcripts
Retail: `Google Store`: This data is a list of html web pages from the Google Store from
2023. It represents a listing of products, details, prices, etc related to
Google products.
Dataset can be found here:
https://console.cloud.google.com/storage/browser/cloud-samples-data/dialogflow-cx/google-store
Args:
query (str): The user's question or search query.
Returns:
List[Document]: A list of the top-ranked Document objects, limited to TOP_K (5) results.
"""
# Use the retriever to fetch relevant documents based on the query
retrieved_docs = lang_retriever.invoke(query)
# Re-rank docs with Vertex AI Rank for better relevance
ranked_docs = compressor.compress_documents(documents=retrieved_docs, query=query)
# Format ranked documents into a consistent structure for LLM consumption
formatted_docs = format_docs.format(docs=ranked_docs)
return (formatted_docs, ranked_docs)