Spaces:
Sleeping
Sleeping
File size: 799 Bytes
a9aecd6 dff3e6f a9aecd6 dff3e6f a76af51 dff3e6f a9aecd6 fa0751c a9aecd6 dff3e6f a9aecd6 dff3e6f fa0751c a9aecd6 |
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 |
import gradio as gr
from lunacode import smart_luna_answer
def respond(
message,
history: list[tuple[str, str]],
system_message,
max_tokens,
):
try:
result = smart_luna_answer(message, max_tokens=max_tokens)
return result
except Exception as e:
return f"Error: {str(e)}"
demo = gr.ChatInterface(
fn=respond,
additional_inputs=[
gr.Textbox(value="You are a helpful AI assistant.", label="System message"),
gr.Slider(minimum=128, maximum=2048, value=512, step=1, label="Max new tokens"),
],
title="Luna AI — Code & Web Enhanced Assistant",
description="Ask Luna questions, generate code, and explore smart AI-powered answers with web context!",
theme="default"
)
if __name__ == "__main__":
demo.launch()
|