Introducing Gradio ClientsJoin us on Thursday, 9am PST
LivestreamIntroducing Gradio ClientsJoin us on Thursday, 9am PST
LivestreamNew to Gradio? Start here: Getting Started
See the Release History
To install Gradio from main, run the following command:
pip install https://gradio-builds.s3.amazonaws.com/99f328d4be5f196d643e66f27687bdba6a3f15b5/gradio-4.33.0-py3-none-any.whl
*Note: Setting share=True
in
launch()
will not work.
gradio.Request(ยทยทยท)
headers
, client
, query_params
, session_hash
, and path_params
. If auth is enabled, the username
attribute can be used to get the logged in user.import gradio as gr
def echo(text, request: gr.Request):
if request:
print("Request headers dictionary:", request.headers)
print("IP address:", request.client.host)
print("Query parameters:", dict(request.query_params))
print("Session hash:", request.session_hash)
return text
io = gr.Interface(echo, "textbox", "textbox").launch()
Parameter | Description |
---|---|
request fastapi.Request | None default: None | A fastapi.Request |
username str | None default: None | The username of the logged in user (if auth is enabled) |
session_hash str | None default: None | The session hash of the current session. It is unique for each page load. |