|
import gradio as gr |
|
from llm.financial_chat import financial_chat |
|
from llm.groq_client import get_groq_client |
|
|
|
|
|
groq_client = get_groq_client() |
|
|
|
def chat_with_user(user_input): |
|
return financial_chat(user_input, groq_client=groq_client) |
|
|
|
iface = gr.Interface( |
|
fn=chat_with_user, |
|
inputs=gr.Textbox(label="Ask your finance-related question here:"), |
|
outputs=gr.Textbox(label="FinanceWise AI Response"), |
|
title="AI Assistant for Finance", |
|
description="This assistant only answers finance-related questions." |
|
) |
|
|
|
if __name__ == "__main__": |
|
iface.launch() |