File size: 2,529 Bytes
3813680 2127385 0a9fa33 2127385 0a9fa33 5fdaabe 2127385 5fdaabe 2127385 5fdaabe 2ae12af 2127385 d516471 2127385 2ae12af 2127385 2ae12af 2127385 2ae12af 5fdaabe 2127385 5fdaabe 2127385 5fdaabe 2127385 5fdaabe 2127385 5fdaabe 2127385 5fdaabe 2127385 5fdaabe 2127385 5fdaabe 2127385 3813680 5fdaabe 2127385 5fdaabe |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
import gradio as gr
from geminisearch import webSearch
# Concise example questions for MCP interface
mcp_examples = [
"What are the latest AI technology developments?",
"What's happening in global news today?",
"What's the current cryptocurrency market status?"
]
# Custom CSS for better styling
custom_css = """
.gradio-container {
max-width: 1200px !important;
margin: auto !important;
}
.chatbot {
border-radius: 15px !important;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}
.input-container {
border-radius: 25px !important;
border: 2px solid #e1e5e9 !important;
}
.input-container:focus-within {
border-color: #4285f4 !important;
box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1) !important;
}
h1 {
text-align: center !important;
color: #1a73e8 !important;
font-weight: 600 !important;
margin-bottom: 2rem !important;
}
.examples {
margin-top: 1rem !important;
}
.example {
border-radius: 20px !important;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
color: white !important;
border: none !important;
transition: all 0.3s ease !important;
}
.example:hover {
transform: translateY(-2px) !important;
box-shadow: 0 8px 25px rgba(0,0,0,0.2) !important;
}
"""
# Create the enhanced interface
app = gr.ChatInterface(
webSearch,
chatbot=gr.Chatbot(
height=500,
show_label=False,
container=True,
bubble_full_width=False,
render_markdown=True
),
type="messages",
textbox=gr.Textbox(
placeholder="🔍 Ask me anything about current events, news, or real-time information...",
container=False,
scale=7,
show_label=False,
lines=1,
max_lines=3
),
title="✨ Quasar LLM Web Chat",
description="Quasar LLM powered interface for real-time web search and intelligent responses.",
theme=gr.themes.Soft(
primary_hue="blue",
secondary_hue="slate",
neutral_hue="slate",
font=gr.themes.GoogleFont("Inter")
),
examples=mcp_examples,
cache_examples=False,
css=custom_css,
analytics_enabled=False,
show_progress="minimal"
)
# Additional configuration
app.queue(
default_concurrency_limit=20,
max_size=50
)
if __name__ == "__main__":
app.launch(
mcp_server=True,
share=False,
inbrowser=True,
show_error=True,
quiet=False,
favicon_path=None,
ssl_verify=False
) |