Use client.get_search_rag_response() to perform a Retrieval-Augmented Generation (RAG) task. This method searches for information, summarizes the results, and generates related queries in a single call.
Parameters:
query: The search query string.search_provider: The engine to use (e.g., 'bing').llm_model: The model to use for summarization (e.g., 'SciPhi/Sensei-7B-V1').
Returns:
A dictionary containing:
response: The summarized answer.related_queries: A list of suggested follow-up queries.search_results: The raw search results used.
# Requires SCIPHI_API_KEY in the environment
from agent_search import SciPhi
client = SciPhi()
# Search, then summarize result and generate related queries
agent_summary = client.get_search_rag_response(query='latest news', search_provider='bing', llm_model='SciPhi/Sensei-7B-V1')
print(agent_summary)
# {'response': "The latest news encompasses ...", 'related_queries': ['Details on the...', ...], 'search_results' : [...]}