Fix LlamaParse 401 + update logo to v5
- Add LLAMA_CLOUD_BASE_URL config option so the LlamaCloud regional endpoint can be set without code changes (fixes 401/region errors on production); pass it through to AsyncLlamaCloud client init - Document LLAMA_CLOUD_BASE_URL in .env.deploy.example with EU endpoint - Copy BAR-ModComms-logo-v5.png to frontend/public - Sidebar: update logo reference v4 → v5 - PDF header: update logo v4 → v5, wrap in black (#000) band for legibility, remove duplicate "Oliver" wordmark Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
da63629720
commit
538a32505e
7 changed files with 18 additions and 7 deletions
|
|
@ -67,6 +67,10 @@ DISABLE_AUTH=false
|
|||
|
||||
GEMINI_API_KEY=your_gemini_api_key
|
||||
LLAMA_CLOUD_API_KEY=your_llama_cloud_api_key
|
||||
# Optional: set regional base URL to fix 401 errors (US is default).
|
||||
# EU region: https://api.eu.cloud.llamaindex.ai
|
||||
# Leave blank to use the default US endpoint.
|
||||
LLAMA_CLOUD_BASE_URL=
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# Email (Mailgun)
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ class Settings:
|
|||
|
||||
# LlamaParse API key (optional - KB processing pipeline disabled if not set)
|
||||
LLAMA_CLOUD_API_KEY: str = os.getenv("LLAMA_CLOUD_API_KEY", "")
|
||||
# LlamaParse region base URL (optional - defaults to US; set for EU: https://api.cloud.llamaindex.ai)
|
||||
LLAMA_CLOUD_BASE_URL: str = os.getenv("LLAMA_CLOUD_BASE_URL", "")
|
||||
|
||||
# Mailgun Configuration for support emails
|
||||
MAILGUN_API_URL: str = os.getenv("MAILGUN_API_URL", "")
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ async def lifespan(app: FastAPI):
|
|||
if settings.LLAMA_CLOUD_API_KEY:
|
||||
from app.services.llamaparse_service import LlamaParseService
|
||||
print("Initializing LlamaParse service...")
|
||||
llamaparse_service = LlamaParseService(settings.LLAMA_CLOUD_API_KEY)
|
||||
llamaparse_service = LlamaParseService(settings.LLAMA_CLOUD_API_KEY, settings.LLAMA_CLOUD_BASE_URL)
|
||||
knowledge_base_service = KnowledgeBaseService(llamaparse_service, gemini_service, reference_docs)
|
||||
print("Knowledge Base pipeline ready!")
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -17,8 +17,9 @@ class ParseResult:
|
|||
class LlamaParseService:
|
||||
"""Service for parsing documents using LlamaParse with the llama-cloud SDK."""
|
||||
|
||||
def __init__(self, api_key: str):
|
||||
def __init__(self, api_key: str, base_url: str = ""):
|
||||
self.api_key = api_key
|
||||
self.base_url = base_url
|
||||
|
||||
async def parse_document(self, file_data: bytes, filename: str) -> ParseResult:
|
||||
"""
|
||||
|
|
@ -38,7 +39,10 @@ class LlamaParseService:
|
|||
|
||||
logger.info(f"[LLAMAPARSE] Starting agentic_plus parse for '{filename}' ({len(file_data)} bytes)")
|
||||
|
||||
client = AsyncLlamaCloud(api_key=self.api_key)
|
||||
client = AsyncLlamaCloud(
|
||||
api_key=self.api_key,
|
||||
**({"base_url": self.base_url} if self.base_url else {})
|
||||
)
|
||||
|
||||
# Write bytes to a temp file for upload
|
||||
suffix = Path(filename).suffix or ".pdf"
|
||||
|
|
|
|||
|
|
@ -123,9 +123,10 @@ export const PDFReport: React.FC<PDFReportProps> = ({ campaignName, proofs, base
|
|||
<div style={{ width: '210mm', fontFamily: 'Arial, sans-serif', color: '#333333', background: '#FFFFFF' }}>
|
||||
{/* --- Cover Page --- */}
|
||||
<div style={{ width: '210mm', height: '297mm', display: 'flex', flexDirection: 'column', padding: '20mm', boxSizing: 'border-box', borderBottom: '1px solid #e5e5e5' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', paddingBottom: '10mm', borderBottom: '1px solid #e5e5e5' }}>
|
||||
<img src={`${baseUrl}/BAR-ModComms-logo-v4.png`} alt="Mod Comms AI — In partnership with Barclays" style={{ height: '60px', width: 'auto' }} />
|
||||
<div style={{ fontFamily: 'Arial, sans-serif', fontSize: '22px', fontWeight: '900', letterSpacing: '3px', color: '#1a1a1a', textTransform: 'uppercase' }}>Oliver</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', paddingBottom: '10mm', borderBottom: '1px solid #e5e5e5' }}>
|
||||
<div style={{ backgroundColor: '#000000', padding: '10px 16px', borderRadius: '6px', display: 'inline-flex' }}>
|
||||
<img src={`${baseUrl}/BAR-ModComms-logo-v5.png`} alt="Mod Comms AI — In partnership with Barclays" style={{ height: '60px', width: 'auto' }} />
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ flexGrow: 1, display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', textAlign: 'center' }}>
|
||||
<h1 style={{ fontSize: '42px', color: '#001f5a', margin: '0 0 10px 0' }}>AI Compliance & Brand Report</h1>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, userNa
|
|||
<aside className="w-72 flex-shrink-0 bg-oliver-black text-slate-200 flex flex-col font-sans">
|
||||
{/* Brand Header */}
|
||||
<div className="py-6 px-8 border-b border-white/10 flex flex-col items-center text-center">
|
||||
<img src={`${import.meta.env.BASE_URL}BAR-ModComms-logo-v4.png`} alt="Mod Comms AI" className="w-full h-auto object-contain" />
|
||||
<img src={`${import.meta.env.BASE_URL}BAR-ModComms-logo-v5.png`} alt="Mod Comms AI" className="w-full h-auto object-contain" />
|
||||
</div>
|
||||
|
||||
{/* Navigation */}
|
||||
|
|
|
|||
BIN
frontend/public/BAR-ModComms-logo-v5.png
Normal file
BIN
frontend/public/BAR-ModComms-logo-v5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
Loading…
Add table
Reference in a new issue