gradio/client/python/gradio_client/data_classes.py
Abubakar Abid 2efb05ed99
Adds support for kwargs and default arguments in the python client, and improves how parameter information is displayed in the "view API" page (#7732)
* changes

* changes

* add changeset

* improvements to api docs ui

* add changeset

* ux design work

* further styling

* feedback

* add changeset

* get parameter name

* fix code snippet

* construct args

* add changeset

* construct_args

* utils

* changes

* add catches

* fixes

* valid

* fix tests

* js lint

* add tests

* add changeset

* format

* client

* doc

* fixes

* changes

* api docs fixes

* fix .view_api()

* updating guide wip

* guide

* updated guides'

* fix

* guide fixes

* filepath

* address review

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-21 17:18:13 -07:00

29 lines
748 B
Python

from __future__ import annotations
from typing import Any, TypedDict
from typing_extensions import NotRequired
class FileData(TypedDict):
name: str | None # filename
data: str | None # base64 encoded data
size: NotRequired[int | None] # size in bytes
is_file: NotRequired[
bool
] # whether the data corresponds to a file or base64 encoded data
orig_name: NotRequired[str] # original filename
mime_type: NotRequired[str]
is_stream: NotRequired[bool]
class ParameterInfo(TypedDict):
label: str
parameter_name: NotRequired[str]
parameter_has_default: NotRequired[bool]
parameter_default: NotRequired[Any]
type: dict
python_type: dict
component: str
example_input: Any