SQL_chatbot_API / app_old.txt
saadkhi's picture
optimized sol, review needed
979ad48
raw
history blame contribute delete
440 Bytes
from gradio_client import Client
# Use the existing Hugging Face Space as the backend
client = Client("saadkhi/SQL_chatbot_API")
def chat(prompt: str) -> str:
"""Proxy the prompt to the remote Space /chat endpoint."""
return client.predict(
prompt=prompt,
api_name="/chat",
)
if __name__ == "__main__":
# Simple CLI test
user_prompt = input("Enter your SQL question: ")
print(chat(user_prompt))