TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #425 · 20 апр.

Недавно делал быстрый прототип асинхронного приложения в котором требовалось вызывать много синхронного кода. Да, я знаю, что это не лучший дизайн, но нужно было быстрое решение на один процесс и без очередей. Поэтому я выполнял код в потоках. Выглядело это примерно так: from fastapi.concurrency import run_in_threadpool async def execute(data: DataRequest) -> DataResponse: try: result = await run_in_threadpool(sync_function, data) return DataResponse(data=result) except Exception as e: return DataResponse( error=str(e), success=False, ) В общем работает нормально. Для всех вызовов под капотом используется общий тредпул, всё работает предсказуемо. Но потребовалось изменить количество запускаемых в пуле потоков (по умолчанию создается 40 воркеров). Так как дело происходит с FastAPI, делается это через lifespan используя настройки anyio: import anyio @asynccontextmanager async def lifespan(app: FastAPI): limiter = anyio.to_thread.current_default_thread_limiter() limiter.total_tokens = 100 yield # если вдруг нужно вернуть обратно limiter.total_tokens = 40 Зачем менять количество воркеров? - уменьшить, если оперативки мало (один тред занимает ~8мб) - увеличить чтобы выдержать нагрузку Если есть предложения получше при тех же вводных - предлагайте😉 #async

Hashtags

Резултати

Пронајдени 3 слични објави

Пребарај: #cua

当前筛选 #cua清除筛选
GitHub Trends

@githubtrending · Post #15063 · 15.08.2025 г., 13:00

#python#agents#ai#ai_ux#autogen#browser_use#computer_use_agent#cua#ui Magentic-UI is a tool that helps you automate complex web tasks by working together with you. It lets you plan step-by-step actions, watch the progress, and approve sensitive steps to keep control and safety. You can interact with it through a browser, upload files, and even run multiple tasks at once. It learns from past tasks to improve future automation. This means you save time on repetitive or complicated web activities while staying in control, making your work easier and more efficient. It supports Python 3.10+ and works best with Docker or WSL2 on Windows. https://github.com/microsoft/magentic-ui

GitHub Trends

@githubtrending · Post #14711 · 15.05.2025 г., 14:00

#python#agent#ai_agent#apple#computer_use#cua#lume#macos#manus#operator#swift#virtualization#virtualization_framework The information provided doesn't directly relate to Discord bots or their benefits. However, if we consider the broader context of automation and AI tools like those mentioned in the text, these technologies can enhance user experiences by automating tasks and providing interactive features. For example, AI agents can control virtual environments, which might be useful in various applications, including gaming or educational settings. This kind of automation can save time and increase efficiency, similar to how Discord bots automate tasks and engage communities[1][2]. https://github.com/trycua/cua

GitHub Trends

@githubtrending · Post #15071 · 18.08.2025 г., 12:30

#typescript#agent#agentic_ai#agents#ai#ai_agents#ai_tools#anthropic#automation#bytebot#computer_use#computer_use_agent#cua#desktop#desktop_automation#docker#gemini#llm#mcp#openai Bytebot is an open-source AI desktop agent that acts like a virtual employee with its own computer, able to use real applications, browse websites, handle passwords, and process documents automatically. You just describe tasks in plain English, and Bytebot completes them by clicking, typing, downloading files, organizing data, and running complex workflows across multiple programs. It runs locally on your own infrastructure, ensuring privacy and full control, and supports many AI models. This helps you save time by automating repetitive or complex tasks without scripting, improving efficiency and accuracy in business, research, or development work. https://github.com/bytebot-ai/bytebot