Spaces:
Sleeping
Sleeping
import gradio as gr | |
import json | |
from groq_helper import generate_chat_completion | |
from retrieval_helper import fetch | |
from groq import Groq | |
def generate_chat_completion_interface(USER_INPUT): | |
top_documents = fetch(USER_INPUT) | |
related_vectors = "\n".join(top_documents) | |
result = generate_chat_completion(USER_INPUT, related_vectors) | |
return result | |
# Gradio app interface | |
iface = gr.Interface( | |
fn=generate_chat_completion_interface, | |
inputs=gr.Textbox(label="Enter your query"), | |
outputs=gr.Textbox(label="Generated JSON"), | |
title="RAG based search", | |
description="Provide your natural language searhc query" | |
) | |
# Launch the interface | |
iface.launch() | |