API
- class ugly_bot.BotTag(value)
- CRON = 'cron'
cron
- MODERATOR = 'moderator'
moderator
- NEWS = 'news'
news
- VIDEO = 'video'
video
- WEB = 'web'
web
- class ugly_bot.Button(type: ButtonType, icon: Icon | None = None, text: str | None = None, lang: UserLang | None = None, func: str | None = None, uri: str | None = None, params: Dict[str, Any] | None = None, buttons: List[Button] | None = None, selected: bool | None = None, disabled: bool | None = None)
- class ugly_bot.ButtonType(value)
- BUTTON = 'button'
button
- LINK = 'link'
link
- MENU = 'menu'
menu
- TEXT = 'text'
text
- class ugly_bot.Conversation(id: str, type: ConversationType, title: str, context: str | None = None)
- class ugly_bot.ConversationContent(type: ConversationContentType, file_id: str | None = None, disabled: bool | None = None, uri: str | None = None)
- class ugly_bot.ConversationType(value)
- BOT = 'bot'
bot
- GROUP = 'group'
group
- HUMAN = 'human'
human
- class ugly_bot.Emotion(neutral: int, happy: int, sad: int, angry: int, fearful: int, disgusted: int, surprised: int)
- class ugly_bot.File(id: str, user_id: str, type: FileType, title: str, text: str | None = None, image: Image | None = None, thumbnail: Image | None = None, markdown: str | None = None, uri: str | None = None, page: dict | None = None, tags: List[str] | None = None)
- class ugly_bot.FileChunk(file_id: str, text: str)
- class ugly_bot.FileType(value)
- AUDIO = 'audio'
audio
- IMAGE = 'image'
image
- LINK = 'link'
link
- MARKDOWN = 'markdown'
markdown
- PAGE = 'page'
page
- PDF = 'pdf'
pdf
- VIDEO = 'video'
video
- class ugly_bot.Icon(value)
- CHAT = 'chat'
chat
- FACEBOOK = 'facebook'
facebook
- IMAGE = 'image'
image
- INSTAGRAM = 'instagram'
instagram
- PINTEREST = 'pinterest'
pinterest
- SETTINGS = 'settings'
settings
- SNAPCHAT = 'snapchat'
snapchat
- THREADS = 'threads'
threads
- TIKTOK = 'tiktok'
tiktok
- WEB = 'web'
web
- WHATSAPP = 'whatsapp'
whatsapp
- X = 'x'
x
- YOUTUBE = 'youtube'
youtube
- class ugly_bot.Image(type: ImageType | None = None, width: int | None = None, height: int | None = None, base64: str | None = None, mime_type: ImageMimeType | None = None, uri: str | None = None, description: str | None = None, sizes: List[int] | None = None, file: str | None = None, buffer: bytes | None = None)
- class ugly_bot.ImageGenModel(value)
- FAL_BRIA = 'fal_bria'
fal_bria
- FAL_FLUX_DEV = 'fal_flux_dev'
fal_flux_dev
- FAL_FLUX_PRO = 'fal_flux_pro'
fal_flux_pro
- FAL_SD3 = 'fal_sd3'
fal_sd3
- class ugly_bot.ImageGenSize(value)
- LANDSCAPE_16_9 = 'landscape_16_9'
landscape_16_9
- LANDSCAPE_21_9 = 'landscape_21_9'
landscape_21_9
- LANDSCAPE_4_3 = 'landscape_4_3'
landscape_4_3
- PORTRAIT_16_9 = 'portrait_16_9'
portrait_16_9
- PORTRAIT_21_9 = 'portrait_21_9'
portrait_21_9
- PORTRAIT_4_3 = 'portrait_4_3'
portrait_4_3
- SQUARE = 'square'
square
- class ugly_bot.ImageMimeType(value)
- GIF = 'image/gif'
image/gif
- JPG = 'image/jpeg'
image/jpeg
- PNG = 'image/png'
image/png
- WEBP = 'image/webp'
image/webp
- class ugly_bot.ImageType(value)
- BASE64 = 'base64'
base64
- PUBLIC = 'public'
public
- URI = 'uri'
uri
- class ugly_bot.KagiSearchItem(url: str, title: str, snippet: str, published: int | None = None, thumbnail: Image | dict | None = None)
- class ugly_bot.KagiSearchOutput(items: List[KagiSearchItem | dict], related: List[str] | None = None)
- class ugly_bot.MenuItem(func: str, title: str, params: Dict[str, Any] | None = None, checked: bool | None = None, enabled: bool | None = None)
- class ugly_bot.Message(id: str, created: int, user_id: str, text: str, is_bot: bool, markdown: str | None = None, system: bool | None = None, mention_user_ids: List[str] | None = None, lang: UserLang | None = None, only_user_ids: List[str] | None = None, visibility: MessageVisibility | None = None, color: MessageColor | None = None, buttons: List[Button] | None = None, mood: Mood | None = None, impersonate_user_id: str | None = None, file_ids: List[str] | None = None, context_file_id: str | None = None, parent_message_id: str | None = None)
- class ugly_bot.MessageColor(value)
- ACCENT = 'accent'
accent
- ERROR = 'error'
error
- NOTICE = 'notice'
notice
- class ugly_bot.MessageVisibility(value)
- HIDDEN = 'hidden'
hidden
- NORMAL = 'normal'
normal
- SILENT = 'silent'
silent
- class ugly_bot.Mood(value)
- ANGRY = 'angry'
angry
- DISGUST = 'disgust'
disgust
- FEAR = 'fear'
fear
- HAPPY = 'happy'
happy
- LOVE = 'love'
love
- NEUTRAL = 'neutral'
neutral
- SAD = 'sad'
sad
- SLEEP = 'sleep'
sleep
- class ugly_bot.NewsArticle(title: str, content: str, uri: str | None)
- class ugly_bot.NewsCategory(value)
- AUTO = 'auto'
auto
- FASHION = 'fashion'
fashion
- FOOD = 'food'
food
- HOME = 'home'
home
- MUSIC = 'music'
music
- NEWS = 'news'
news
- PR = 'pr'
pr
- SPORTS = 'sports'
sports
- TECH = 'tech'
tech
- class ugly_bot.Padding(left: int, top: int, right: int, bottom: int)
- class ugly_bot.SearchArticle(title: str, synopsis: str, uri: str | None)
USearchArticlesSearchArticleer
- class ugly_bot.TextGenMessage(role: TextGenRole, content: str | List[str | Image])
- class ugly_bot.TextGenModel(value)
- ANTHROPHIC_CLAUDE_3_HAIKU = 'anthrophic_claude_3_haiku'
anthrophic_claude_3_haiku
- ANTHROPHIC_CLAUDE_3_OPUS = 'anthrophic_claude_3_opus'
anthrophic_claude_3_opus
- ANTHROPHIC_CLAUDE_3_SONNET = 'anthrophic_claude_3_sonnet'
anthrophic_claude_3_sonnet
- OPENAI_GPT_3_TURBO = 'openai_gpt_3_turbo'
openai_gpt_3_turbo
- OPENAI_GPT_3_TURBO_16K = 'openai_gpt_3_turbo_16k'
openai_gpt_3_turbo_16k
- OPENAI_GPT_4 = 'openai_gpt_4'
openai_gpt_4
- OPENAI_GPT_4O = 'openai_gpt_4o'
openai_gpt_4o
- OPENAI_GPT_4_32K = 'openai_gpt_4_32k'
openai_gpt_4_32k
- OPENAI_GPT_4_TURBO = 'openai_gpt_4_turbo'
openai_gpt_4_turbo
- OPENAI_O1 = 'openai_o1'
openai_o1
- OPENAI_O1_MINI = 'openai_o1_mini'
openai_o1_mini
- PERPLEXITY_LLAMA_3_SONAR_HUGE_128K_ONLINE = 'perplexity_llama_3_sonar_huge_128k_online'
perplexity_llama_3_sonar_huge_128k_online
- PERPLEXITY_LLAMA_3_SONAR_LARGE_128K_ONLINE = 'perplexity_llama_3_sonar_large_128k_online'
perplexity_llama_3_sonar_large_128k_online
- PERPLEXITY_LLAMA_3_SONAR_SMALL_128K_ONLINE = 'perplexity_llama_3_sonar_small_128k_online'
perplexity_llama_3_sonar_small_128k_online
- TOGETHER_DEEPSEEK_R1 = 'together_deepseek_r1'
together_deepseek_r1
- TOGETHER_DEEPSEEK_V3 = 'together_deepseek_v3'
together_deepseek_v3
- TOGETHER_KIMI_K2 = 'together_kimi_k2'
together_kimi_k2
- TOGETHER_META_LLAMA4_400B = 'together_meta_llama4_400b'
together_meta_llama4_400b
- TOGETHER_META_LLAMA_3_405B = 'together_meta_llama_3_405b'
together_meta_llama_3_405b
- TOGETHER_META_LLAMA_3_70B = 'together_meta_llama_3_70b'
together_meta_llama_3_70b
- TOGETHER_META_LLAMA_3_8B = 'together_meta_llama_3_8b'
together_meta_llama_3_8b
- TOGETHER_META_LLAMA_VISION_3_11B = 'together_meta_llama_vision_3_11b'
together_meta_llama_vision_3_11b
- TOGETHER_MISTRAL_24B = 'together_mistral_24b'
together_mistral_24b
- TOGETHER_MISTRAL_7B = 'together_mistral_7b'
together_mistral_7b
- TOGETHER_MIXTRAL_8X22B = 'together_mixtral_8x22b'
together_mixtral_8x22b
- TOGETHER_MIXTRAL_8X7B = 'together_mixtral_8x7b'
together_mixtral_8x7b
- TOGETHER_QWEN2_72B = 'together_qwen2_72b'
together_qwen2_72b
- TOGETHER_QWEN2_VISION_72B = 'together_qwen2_vision_72b'
together_qwen2_vision_72b
- TOGETHER_QWEN3_235B = 'together_qwen3_235b'
together_qwen3_235b
- class ugly_bot.TextGenTool(name: str, description: str, parameters: Dict[str, Any] | None = None)
- class ugly_bot.Timezone(value)
- AFRICA_ALGIERS = 'Africa/Algiers'
Africa/Algiers
- AFRICA_CAIRO = 'Africa/Cairo'
Africa/Cairo
- AFRICA_CASABLANCA = 'Africa/Casablanca'
Africa/Casablanca
- AFRICA_HARARE = 'Africa/Harare'
Africa/Harare
- AFRICA_NAIROBI = 'Africa/Nairobi'
Africa/Nairobi
- AMERICA_ARGENTINA_BUENOS_AIRES = 'America/Argentina/Buenos_Aires'
America/Argentina/Buenos_Aires
- AMERICA_BELIZE = 'America/Belize'
America/Belize
- AMERICA_BOGOTA = 'America/Bogota'
America/Bogota
- AMERICA_BOISE = 'America/Boise'
America/Boise
- AMERICA_CARACAS = 'America/Caracas'
America/Caracas
- AMERICA_CHICAGO = 'America/Chicago'
America/Chicago
- AMERICA_CHIHUAHUA = 'America/Chihuahua'
America/Chihuahua
- AMERICA_DAWSON = 'America/Dawson'
America/Dawson
- AMERICA_DETROIT = 'America/Detroit'
America/Detroit
- AMERICA_GODTHAB = 'America/Godthab'
America/Godthab
- AMERICA_JUNEAU = 'America/Juneau'
America/Juneau
- AMERICA_LOS_ANGELES = 'America/Los_Angeles'
America/Los_Angeles
- AMERICA_MEXICO_CITY = 'America/Mexico_City'
America/Mexico_City
- AMERICA_MONTEVIDEO = 'America/Montevideo'
America/Montevideo
- AMERICA_PHOENIX = 'America/Phoenix'
America/Phoenix
- AMERICA_REGINA = 'America/Regina'
America/Regina
- AMERICA_SANTIAGO = 'America/Santiago'
America/Santiago
- AMERICA_SAO_PAULO = 'America/Sao_Paulo'
America/Sao_Paulo
- AMERICA_ST_JOHNS = 'America/St_Johns'
America/St_Johns
- AMERICA_TIJUANA = 'America/Tijuana'
America/Tijuana
- ASIA_ALMATY = 'Asia/Almaty'
Asia/Almaty
- ASIA_BAGHDAD = 'Asia/Baghdad'
Asia/Baghdad
- ASIA_BAKU = 'Asia/Baku'
Asia/Baku
- ASIA_BANGKOK = 'Asia/Bangkok'
Asia/Bangkok
- ASIA_COLOMBO = 'Asia/Colombo'
Asia/Colombo
- ASIA_DHAKA = 'Asia/Dhaka'
Asia/Dhaka
- ASIA_DUBAI = 'Asia/Dubai'
Asia/Dubai
- ASIA_IRKUTSK = 'Asia/Irkutsk'
Asia/Irkutsk
- ASIA_JERUSALEM = 'Asia/Jerusalem'
Asia/Jerusalem
- ASIA_KABUL = 'Asia/Kabul'
Asia/Kabul
- ASIA_KAMCHATKA = 'Asia/Kamchatka'
Asia/Kamchatka
- ASIA_KARACHI = 'Asia/Karachi'
Asia/Karachi
- ASIA_KATHMANDU = 'Asia/Kathmandu'
Asia/Kathmandu
- ASIA_KOLKATA = 'Asia/Kolkata'
Asia/Kolkata
- ASIA_KRASNOYARSK = 'Asia/Krasnoyarsk'
Asia/Krasnoyarsk
- ASIA_KUALA_LUMPUR = 'Asia/Kuala_Lumpur'
Asia/Kuala_Lumpur
- ASIA_KUWAIT = 'Asia/Kuwait'
Asia/Kuwait
- ASIA_MAGADAN = 'Asia/Magadan'
Asia/Magadan
- ASIA_RANGOON = 'Asia/Rangoon'
Asia/Rangoon
- ASIA_SEOUL = 'Asia/Seoul'
Asia/Seoul
- ASIA_SHANGHAI = 'Asia/Shanghai'
Asia/Shanghai
- ASIA_TAIPEI = 'Asia/Taipei'
Asia/Taipei
- ASIA_TEHRAN = 'Asia/Tehran'
Asia/Tehran
- ASIA_TOKYO = 'Asia/Tokyo'
Asia/Tokyo
- ASIA_VLADIVOSTOK = 'Asia/Vladivostok'
Asia/Vladivostok
- ASIA_YAKUTSK = 'Asia/Yakutsk'
Asia/Yakutsk
- ASIA_YEKATERINBURG = 'Asia/Yekaterinburg'
Asia/Yekaterinburg
- ATLANTIC_AZORES = 'Atlantic/Azores'
Atlantic/Azores
- ATLANTIC_CANARY = 'Atlantic/Canary'
Atlantic/Canary
- ATLANTIC_CAPE_VERDE = 'Atlantic/Cape_Verde'
Atlantic/Cape_Verde
- AUSTRALIA_ADELAIDE = 'Australia/Adelaide'
Australia/Adelaide
- AUSTRALIA_BRISBANE = 'Australia/Brisbane'
Australia/Brisbane
- AUSTRALIA_DARWIN = 'Australia/Darwin'
Australia/Darwin
- AUSTRALIA_HOBART = 'Australia/Hobart'
Australia/Hobart
- AUSTRALIA_PERTH = 'Australia/Perth'
Australia/Perth
- AUSTRALIA_SYDNEY = 'Australia/Sydney'
Australia/Sydney
- EUROPE_AMSTERDAM = 'Europe/Amsterdam'
Europe/Amsterdam
- EUROPE_ATHENS = 'Europe/Athens'
Europe/Athens
- EUROPE_BELGRADE = 'Europe/Belgrade'
Europe/Belgrade
- EUROPE_BRUSSELS = 'Europe/Brussels'
Europe/Brussels
- EUROPE_BUCHAREST = 'Europe/Bucharest'
Europe/Bucharest
- EUROPE_DUBLIN = 'Europe/Dublin'
Europe/Dublin
- EUROPE_HELSINKI = 'Europe/Helsinki'
Europe/Helsinki
- EUROPE_LISBON = 'Europe/Lisbon'
Europe/Lisbon
- EUROPE_LONDON = 'Europe/London'
Europe/London
- EUROPE_MOSCOW = 'Europe/Moscow'
Europe/Moscow
- EUROPE_SARAJEVO = 'Europe/Sarajevo'
Europe/Sarajevo
- PACIFIC_AUCKLAND = 'Pacific/Auckland'
Pacific/Auckland
- PACIFIC_FIJI = 'Pacific/Fiji'
Pacific/Fiji
- PACIFIC_GUAM = 'Pacific/Guam'
Pacific/Guam
- PACIFIC_HONOLULU = 'Pacific/Honolulu'
Pacific/Honolulu
- PACIFIC_MIDWAY = 'Pacific/Midway'
Pacific/Midway
- PACIFIC_TONGATAPU = 'Pacific/Tongatapu'
Pacific/Tongatapu
- UTC = 'UTC'
UTC
- class ugly_bot.User(id: str, name: str, bio: str, avatar: Avatar, voice_id: str | None, birthday: int | None, type: str, lang: UserLang, timezone: Timezone)
- class ugly_bot.UserLang(value)
- AR = 'ar'
ar
- DE = 'de'
de
- EN = 'en'
en
- ES = 'es'
es
- FA = 'fa'
fa
- FR = 'fr'
fr
- HI = 'hi'
hi
- IT = 'it'
it
- JA = 'ja'
ja
- PT = 'pt'
pt
- RU = 'ru'
ru
- TL = 'tl'
tl
- TR = 'tr'
tr
- VI = 'vi'
vi
- ZH = 'zh'
zh
- class ugly_bot.WebPageData(html: str, url: str, title: str)
- ugly_bot.bot_owners_get(id: str) List[str]
Get owners of a bot
- ugly_bot.conversation_bots(tag: BotTag | None = None) List[Bot]
Get bots for the active conversation
- ugly_bot.conversation_buttons_show(user_id: str | None = None, buttons: List[Button] | None = None) None
Show buttons in the active conversation
- ugly_bot.conversation_content_hide() None
Show content in the active conversation
- ugly_bot.conversation_content_maximized(maximized: bool, user_id: str | None = None) None
Toggle the content netween maximized and normal size
- ugly_bot.conversation_content_show(type: ConversationContentType = ConversationContentType.URI, file_id: str | None = None, disabled: bool | None = None, uri: str | None = None, padding: Padding | None = None) None
Show content in the active conversation
Add context menu to the current web page when this conversation is active
- ugly_bot.conversation_cron_extend(end: int | None = None) None
Extends the end of cron jobs for this conversation
- ugly_bot.conversation_get(id: str) Conversation | None
Get conversation
- ugly_bot.conversation_users(type: str | None = None, role: str | None = None) List[User]
Get users for the active conversation
- ugly_bot.data_get() SimpleNamespace
Get bot data
- ugly_bot.data_set(**kwargs) SimpleNamespace
Set bot data
- ugly_bot.email_send(user_id: str | None = None, user_ids: List[str] | None = None, subject: str | None = None, text: str | None = None, markdown: str | None = None, file_id: str | None = None) None
Send email
- ugly_bot.error(*args: Any) None
Log an error
- ugly_bot.export(name: str)
Decorator to export functions from your bot
- ugly_bot.file_create(type: FileType, title: str | None = None, markdown: str | None = None, uri: str | None = None, thumbnail: Image | None = None, lang: UserLang | None = None, indexable: bool | None = None, page: dict | None = None, tags: List[str] | None = None) File
Create file
- ugly_bot.file_to_text_gen_message(file: File, role: TextGenRole | None = None, include_name: bool | None = None, text: str | None = None) TextGenMessage
Convert a file to TextGenMessage, this is useful if you need to pass file into text_gen
- ugly_bot.file_update(id: str, markdown: str | None = None, title: str | None = None, thumbnail: Image | None = None, page: dict | None = None) None
Update file, only supported on markdown & page files
- ugly_bot.google_search(query: str) List[SearchArticle]
Google search
- ugly_bot.image_gen(prompt: str, model: ImageGenModel | None = None, negative_prompt: str | None = None, size: ImageGenSize | None = None, guidance_scale: float | None = None, steps: int | None = None, image: Image | None = None, image_strength: float | None = None) Image | None
Generate an image using specified model
- ugly_bot.kagi_enrich_news(query: str)
Kagi Enrich News
- ugly_bot.kagi_enrich_web(query: str)
Kagi Enrich Web
- ugly_bot.kagi_search(query: str, limit: int | None = None)
Kagi Search
- ugly_bot.kagi_summarize(url: str | None = None, text: str | None = None)
Kagi Summarize
- ugly_bot.log(*args: Any) None
Log, this works the same as print
- ugly_bot.markdown_create_image(file_id: str, image: Image) str
Convert an image into markdown syntax, this will upload the file if it is base64
- ugly_bot.message_continue(message: Message) None
Continue a message to the active conversation, only used by moderator bots
- ugly_bot.message_delete(id: str) None
Delete an existing message
- ugly_bot.message_edit(id: str, text: str | None = None, markdown: str | None = None) Message
Edit an existing message
- ugly_bot.message_history(duration: int | None = None, limit: int | None = None, start: int | None = None, include_hidden: bool | None = None) List[Message]
Get messages from the active conversation
- ugly_bot.message_send(id: str | None = None, text: str | None = None, image: Image | None = None, images: List[Image] | None = None, markdown: str | None = None, mention_user_ids: List[str] | None = None, only_user_ids: List[str] | None = None, lang: UserLang | None = None, visibility: MessageVisibility | None = None, color: MessageColor | None = None, buttons: List[Button] | None = None, mood: Mood | None = None, impersonate_user_id: str | None = None, files: List[File] | None = None) Message
Send a message to the active conversation
- ugly_bot.message_send_all(text: str | None = None, image: Image | None = None, images: List[Image] | None = None, markdown: str | None = None, lang: UserLang | None = None, visibility: MessageVisibility | None = None, color: MessageColor | None = None, buttons: List[Button] | None = None, mood: Mood | None = None, files: List[File] | None = None) None
Send a message to all conversations
- ugly_bot.message_typing() None
Show a typing indicator in the active conversation
- ugly_bot.messages_to_text(messages: List[Message], strip_names: bool | None = None) str
Convert a list of messages into string, useful if you need to add your conversation history to an LLM prompt
- ugly_bot.query_files(query: str, scope: str | None = None, catalog_ids: List[str] | None = None, limit: int | None = None) List[FileChunk]
Get files based on semantic search using the query
- ugly_bot.query_news(query: str | None = None, created: int | None = None, limit: int | None = None, categories: List[NewsCategory] | None = None) List[NewsArticle]
Get news based on semantic search using the query
- ugly_bot.start()
Start your bot, this runs the event loop so your bot can receive calls
- ugly_bot.start_nonblocking()
Start your bot, this start an async loop to handle future calls
- ugly_bot.text_gen(question: str | None = None, instruction: str | None = None, messages: List[TextGenMessage | Message] | None = None, model: TextGenModel | None = None, temperature: float | None = None, top_k: int | None = None, top_p: float | None = None, max_tokens: int | None = None, frequency_penalty: float | None = None, presence_penalty: float | None = None, repetition_penalty: float | None = None, tools: List[TextGenTool] | None = None, include_files: bool | None = None, json: Dict[str, Any] | None = None) str | None
Generate text using the specified model (LLM)
- ugly_bot.tool_conversation_show(session_id: str, video_call_enabled: bool | None = None) None
Open a conversation
- ugly_bot.web_page_get(session_id: str) WebPageData
Get active web page, this only works when Ugly is being used a sidePanel in Chrome
- ugly_bot.bot.bot_params = None
Bot Params
- ugly_bot.bot.bot_id = None
Bot ID
- ugly_bot.bot.conversation_id = None
Conversation ID