Spaces:
Sleeping
Sleeping
Update main.py
Browse files123421 unmodified lines26272829303132import json, osfrom fastapi.middleware.cors import CORSMiddlewarefrom fastapi import FastAPI, Request, Header, BackgroundTasks, HTTPException, statusimport google.generativeai as genai21 unmodified lines@app.get("/")def root():return {"title": "Line Bot"}@app.post("/webhook")async def webhook(1234521 unmodified lines2728293031323334353637383940414243444546474849import json, osimport gradio as grfrom fastapi.middleware.cors import CORSMiddlewarefrom fastapi import FastAPI, Request, Header, BackgroundTasks, HTTPException, statusimport google.generativeai as genai21 unmodified lines@app.get("/")def root():def get_gemini_response(input):response = model.generate_content(input)return response.text# Define the Gradio interfaceiface = gr.Interface(fn=get_gemini_response,inputs=[gr.Textbox(label="Enter your question here:"),],outputs=gr.Textbox(label="The response is"),title="Gemini Bot",description="Ask Gemini!!!",)# Launch the Gradio interfaceiface.launch()return {"title": "Line Bot"}@app.post("/webhook")async def webhook(
main.py+18-1