БОТ ДОЛЖЕН БЫТЬ АСИНХРОННЫМ. Нужно реализовать очередь запросов, если модель нагружена и возращается busy, то запрос надо отправить в очередь и после заново отправить пока не получим ответ или более 10 попыток не будет.
Напиши полноценного телеграм бота который будет Ui для этого api. нужно сделать запоминание контекста модели ai, очистку контекста. температура и top-p, ФОРМАТИРОВАНИЕ ОТВЕТА В ТЕЛЕГРАМ. используй aiogram 3!!!! и сделай легкое добавление других моделей ai (у каждой модели должен быть свой массив комманд. мой токен <TRUFFLEHOG_REDACTED_HUGGINGFACE>. ожидать ответа от модели можно очень долго, в группах должен отвечать только на команды:Find the API endpoint below corresponding to your desired function in the app. Copy the code snippet, replacing the placeholder values with your own input data. If this is a private Space, you may need to pass your Hugging Face token as well (read more). Or use the

to automatically generate your API requests.
api_name: /enable_inputs

from gradio_client import Client

client = Client("yuntian-deng/o1mini")
result = client.predict(
api_name="/enable_inputs"
)
print(result)

Accepts 0 parameters:
Returns 1 element
api_name: /reset_textbox

from gradio_client import Client

client = Client("yuntian-deng/o1mini")
result = client.predict(
api_name="/reset_textbox"
)
print(result)

Accepts 0 parameters:
Returns 1 element

str

The output value that appears in the "Type an input and press Enter" Textbox component.
api_name: /predict

from gradio_client import Client

client = Client("yuntian-deng/o1mini")
result = client.predict(
inputs="Hello!!",
top_p=1,
temperature=1,
chat_counter=0,
chatbot=[],
api_name="/predict"
)
print(result)

Accepts 5 parameters:

inputs str Required

The input value that is provided in the "Type an input and press Enter" Textbox component.

top_p float Default: 1

The input value that is provided in the "Top-p (nucleus sampling)" Slider component.

temperature float Default: 1

The input value that is provided in the "Temperature" Slider component.

chat_counter float Default: 0

The input value that is provided in the "parameter_16" Number component.

chatbot Tuple[str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None, str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None] Default: []

The input value that is provided in the "parameter_4" Chatbot component.
Returns tuple of 4 elements

[0] Tuple[str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None, str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None]

The output value that appears in the "value_4" Chatbot component.

[1] float

The output value that appears in the "value_16" Number component.

[2] str

The output value that appears in the "Status code from OpenAI server" Textbox component.

[3] str

The output value that appears in the "Type an input and press Enter" Textbox component.
api_name: /reset_textbox_1

from gradio_client import Client

client = Client("yuntian-deng/o1mini")
result = client.predict(
api_name="/reset_textbox_1"
)
print(result)

Accepts 0 parameters:
Returns 1 element

str

The output value that appears in the "Type an input and press Enter" Textbox component.
api_name: /predict_1

from gradio_client import Client

client = Client("yuntian-deng/o1mini")
result = client.predict(
inputs="Hello!!",
top_p=1,
temperature=1,
chat_counter=0,
chatbot=[],
api_name="/predict_1"
)
print(result)

Accepts 5 parameters:

inputs str Required

The input value that is provided in the "Type an input and press Enter" Textbox component.

top_p float Default: 1

The input value that is provided in the "Top-p (nucleus sampling)" Slider component.

temperature float Default: 1

The input value that is provided in the "Temperature" Slider component.

chat_counter float Default: 0

The input value that is provided in the "parameter_16" Number component.

chatbot Tuple[str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None, str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None] Default: []

The input value that is provided in the "parameter_4" Chatbot component.
Returns tuple of 4 elements

[0] Tuple[str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None, str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None]

The output value that appears in the "value_4" Chatbot component.

[1] float

The output value that appears in the "value_16" Number component.

[2] str

The output value that appears in the "Status code from OpenAI server" Textbox component.

[3] str

The output value that appears in the "Type an input and press Enter" Textbox component.