mirror of
https://github.com/Shubhamsaboo/awesome-llm-apps.git
synced 2026-03-11 17:48:31 -05:00
feat: update Life Insurance Coverage Advisor to use OpenAI GPT-5 instead of OpenRouter
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# 🛡️ Life Insurance Coverage Advisor Agent
|
||||
|
||||
A Streamlit application that helps users estimate the amount of term life insurance they may need and surfaces currently available policy options. The app is powered by the [Agno](https://github.com/agno-agi/agno) agent framework, uses **Grok 4 Fast (via OpenRouter)** as the reasoning model, the **E2B** sandbox for deterministic coverage calculations, and **Firecrawl** for live web research.
|
||||
A Streamlit application that helps users estimate the amount of term life insurance they may need and surfaces currently available policy options. The app is powered by the **Agno** agent framework, uses **OpenAI GPT-5** as the LLM, the **E2B** sandbox for deterministic coverage calculations, and **Firecrawl** for live web research.
|
||||
|
||||
## Highlights
|
||||
- Minimal intake form (age, income, dependents, debt, assets, existing cover, horizon, location).
|
||||
@@ -13,14 +13,10 @@ You will need API keys for each external service:
|
||||
|
||||
| Service | Purpose | Where to get it |
|
||||
| --- | --- | --- |
|
||||
| OpenRouter (Grok 4 Fast) | Core reasoning model | https://openrouter.ai/keys |
|
||||
| OpenAI (GPT-5-mini) | Core reasoning model | https://platform.openai.com/api-keys |
|
||||
| Firecrawl | Web search + crawl tooling | https://www.firecrawl.dev/app/api-keys |
|
||||
| E2B | Secure code execution sandbox | https://e2b.dev |
|
||||
|
||||
> ℹ️ OpenRouter recommends setting the `HTTP-Referer` and `X-Title` headers on every request. The app defaults to
|
||||
> `https://github.com/Shubhamsaboo/awesome-llm-apps` and `Life Insurance Coverage Advisor`, but you can override them
|
||||
> by exporting `OPENROUTER_REFERRER` and `OPENROUTER_TITLE` before launching Streamlit.
|
||||
|
||||
## Installation
|
||||
1. Clone the GitHub repository
|
||||
|
||||
@@ -39,7 +35,7 @@ git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
|
||||
```
|
||||
|
||||
## Using the App
|
||||
1. Enter your OpenRouter, Firecrawl, and E2B API keys in the sidebar (keys are kept in the local Streamlit session).
|
||||
1. Enter your OpenAI, Firecrawl, and E2B API keys in the sidebar (keys are kept in the local Streamlit session).
|
||||
2. Provide the requested financial information and choose an income replacement horizon.
|
||||
3. Click **Generate Coverage & Options** to launch the Agno agent workflow.
|
||||
4. Review the recommended coverage, rationale, and suggested insurers. Raw agent output is available in an expander for debugging.
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Any, Dict, Optional
|
||||
|
||||
import streamlit as st
|
||||
from agno.agent import Agent
|
||||
from agno.models.openrouter import OpenRouter
|
||||
from agno.models.openai import OpenAIChat
|
||||
from agno.tools.e2b import E2BTools
|
||||
from agno.tools.firecrawl import FirecrawlTools
|
||||
|
||||
@@ -17,16 +17,7 @@ st.set_page_config(
|
||||
|
||||
st.title("🛡️ Life Insurance Coverage Advisor")
|
||||
st.caption(
|
||||
"Prototype Streamlit app powered by Agno Agents, Grok 4 Fast via OpenRouter, E2B sandboxed code execution, and Firecrawl search."
|
||||
)
|
||||
|
||||
DEFAULT_OPENROUTER_REFERRER = os.getenv(
|
||||
"OPENROUTER_REFERRER",
|
||||
"https://github.com/Shubhamsaboo/awesome-llm-apps",
|
||||
)
|
||||
DEFAULT_OPENROUTER_TITLE = os.getenv(
|
||||
"OPENROUTER_TITLE",
|
||||
"Life Insurance Coverage Advisor",
|
||||
"Prototype Streamlit app powered by Agno Agents, OpenAI GPT-5, E2B sandboxed code execution, and Firecrawl search."
|
||||
)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
@@ -35,11 +26,11 @@ DEFAULT_OPENROUTER_TITLE = os.getenv(
|
||||
with st.sidebar:
|
||||
st.header("API Keys")
|
||||
st.write("All keys stay local in your browser session.")
|
||||
openrouter_api_key = st.text_input(
|
||||
"OpenRouter API Key",
|
||||
openai_api_key = st.text_input(
|
||||
"OpenAI API Key",
|
||||
type="password",
|
||||
key="openrouter_api_key",
|
||||
help="Create one at https://openrouter.ai/keys",
|
||||
key="openai_api_key",
|
||||
help="Create one at https://platform.openai.com/api-keys",
|
||||
)
|
||||
firecrawl_api_key = st.text_input(
|
||||
"Firecrawl API Key",
|
||||
@@ -163,23 +154,19 @@ def compute_local_breakdown(profile: Dict[str, Any], real_rate: float) -> Dict[s
|
||||
|
||||
|
||||
@st.cache_resource(show_spinner=False)
|
||||
def get_agent(openrouter_key: str, firecrawl_key: str, e2b_key: str) -> Optional[Agent]:
|
||||
if not (openrouter_key and firecrawl_key and e2b_key):
|
||||
def get_agent(openai_key: str, firecrawl_key: str, e2b_key: str) -> Optional[Agent]:
|
||||
if not (openai_key and firecrawl_key and e2b_key):
|
||||
return None
|
||||
|
||||
os.environ["OPENROUTER_API_KEY"] = openrouter_key
|
||||
os.environ["OPENAI_API_KEY"] = openai_key
|
||||
os.environ["FIRECRAWL_API_KEY"] = firecrawl_key
|
||||
os.environ["E2B_API_KEY"] = e2b_key
|
||||
|
||||
return Agent(
|
||||
name="Life Insurance Advisor",
|
||||
model=OpenRouter(
|
||||
id="x-ai/grok-4-fast:free",
|
||||
api_key=openrouter_key,
|
||||
default_headers={
|
||||
"HTTP-Referer": DEFAULT_OPENROUTER_REFERRER,
|
||||
"X-Title": DEFAULT_OPENROUTER_TITLE,
|
||||
},
|
||||
model=OpenAIChat(
|
||||
id="gpt-5-mini-2025-08-07",
|
||||
api_key=openai_key,
|
||||
),
|
||||
tools=[
|
||||
E2BTools(timeout=180),
|
||||
@@ -392,11 +379,11 @@ def render_recommendations(result: Dict[str, Any], profile: Dict[str, Any]) -> N
|
||||
|
||||
|
||||
if submitted:
|
||||
if not all([openrouter_api_key, firecrawl_api_key, e2b_api_key]):
|
||||
st.error("Please configure OpenRouter, Firecrawl, and E2B API keys in the sidebar.")
|
||||
if not all([openai_api_key, firecrawl_api_key, e2b_api_key]):
|
||||
st.error("Please configure OpenAI, Firecrawl, and E2B API keys in the sidebar.")
|
||||
st.stop()
|
||||
|
||||
advisor_agent = get_agent(openrouter_api_key, firecrawl_api_key, e2b_api_key)
|
||||
advisor_agent = get_agent(openai_api_key, firecrawl_api_key, e2b_api_key)
|
||||
if not advisor_agent:
|
||||
st.error("Unable to initialize the advisor. Double-check API keys.")
|
||||
st.stop()
|
||||
|
||||
Reference in New Issue
Block a user