File size: 515 Bytes
c652bdc
 
 
02fae49
ab4adaf
c652bdc
02fae49
 
 
 
c652bdc
02fae49
 
 
 
 
c652bdc
02fae49
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import bardapi

# Set your Secure-1PSID value to key
token = 'cQjDrFOQjkhOHHHCW54Tc7IKyphnqos-A-IpmgjVa9p3_ZFFa5Ilet-heMO8Xm3TM1Y5vw.'

def get_answer(input_text):
    # Send an API request and get a response.
    response = bardapi.core.Bard(token).get_answer(input_text)
    return response

# Create a Gradio interface
iface = gr.Interface(
    fn=get_answer,
    inputs=gr.inputs.Textbox(lines=2, placeholder="Enter your input text"),
    outputs="text")

# Run the interface
iface.launch()