Spaces:
Running
Running
File size: 1,137 Bytes
4dfd3e5 3714c6c | 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 | import requests
import json
import gradio as gr
def simulate_thinking_chat(message, history):
response = requests.request("POST", "https://api.langsearch.com/v1/web-search", headers={'Authorization': 'Bearer sk-e94998940aae45a5854c45eade3ec168', 'Content-Type': 'application/json'}, data=json.dumps({ "query": f"{message}", "freshness": "noLimit", "summary": True, "count": 50}))
yield response.text
theme = gr.themes.Base(primary_hue="violet", secondary_hue="violet", neutral_hue="zinc",)
with gr.Blocks() as demo:
gr.ChatInterface(
simulate_thinking_chat,
title="Agentic AI Chat Boot 🤔",
multimodal=False,
chatbot = gr.Chatbot(label="Agent", avatar_images=("https://api.dicebear.com/7.x/avataaars/svg?seed=Felix", "https://em-content.zobj.net/source/twitter/376/hugging-face_1f917.png",),),
textbox= gr.MultimodalTextbox(
interactive=True,
file_count="multiple",
placeholder="Enter message...",
show_label=False),
save_history=False,
editable=True,
fill_width=True,
stop_btn=True,
analytics_enabled=True)
demo.launch(theme=theme, share=True, mcp_server=True) |