Register and share your invite link to earn from video plays and referrals.

Search results for 、Python
、Python community
One keyword maps to one global community path.
Create community
People
Not Found
Tweets including 、Python
New: OpenRouter Agent SDKs for both Python and Go! They are kept in sync automatically with the TypeScript SDK 🔁
You can now call methods defined in a Python Worker from a JavaScript Worker and vice versa. You can share objects across Python and JavaScript, and call methods on a Python object from TypeScript. It all just works.
Show more
# Practical and Useful Patterns with ADK ⚡ Turn Python functions into tools, wrap agents as tools, and run long tasks without blocking — ADK's Function Tools maximize flexibility in tool definitions. 📌 Title: Function Tools — Functions, Agents, and Async Tasks as Tools 🔗 URL: 🧩 Overview ADK's Function Tools let you use Python/TypeScript functions directly as agent tools. AgentTool wraps an entire agent as a tool accessible to other agents. Long Running Function Tools handle time-consuming tasks like video encoding and batch jobs without blocking the agent's execution flow. 🛠 Usage Basic function tool definitions and AgentTool usage. Import `Agent` and `AgentTool` from `google.adk`. Define a simple function tool `calculate_price` that takes `base_price` (float), `quantity` (int), and `discount_percent` (float, default 0), computes the total with the discount applied, and returns a dict with `total` and `currency`. For wrapping an agent as a tool, create an `analysis_agent` with `name="data_analyst"` and `tools=[query_database]`. Then define `main_agent` with `tools=[calculate_price, AgentTool(agent=analysis_agent)]`, allowing the main agent to call both the pricing function and the data analysis agent as tools. Using Long Running Function Tools. Import `LongRunningFunctionTool` from `google.adk`. Define an async function `encode_video` that takes `video_url` (str) and `format` (str, default "mp4"), starts an encoding job via `start_encoding_job`, and returns the job ID with a processing status. Wrap it with `LongRunningFunctionTool(func=encode_video)` to create `video_tool`, then pass it to an `Agent`'s `tools` list so the agent can trigger long-running tasks without blocking. 🏗 Practical Patterns **Modularization with AgentTool**: Encapsulate complex logic as specialized agents and expose them via AgentTool. This keeps the main agent's instructions simple while each specialist agent maintains its own tools and prompts -- achieving clean separation of concerns. Define a `summarizer` agent (for 3-line summaries) and a `translator` agent (for Japanese translation) as separate `Agent` instances. Then create a `content_manager` agent with `tools=[AgentTool(agent=summarizer), AgentTool(agent=translator)]`, allowing the main agent to invoke these specialists as tools for content management tasks. **When to Use Long Running Tools**: Ideal for batch processing, external API polling, file conversion — anything taking seconds to minutes. The agent receives a job ID and can proceed with other tasks in parallel. **Type Annotations Matter**: Clear parameter types and return types help the LLM call tools accurately. Docstrings serve as tool descriptions, so keep them concise and clear. 💡 Use Cases 🧮 Calculation and conversion functions as tools (pricing, unit conversion) 🤖 Reusable specialist agents via AgentTool 🎬 Async video encoding and image processing 📊 Non-blocking batch data processing ⚠️ Caveats - Function docstrings become tool descriptions. Write LLM-friendly descriptions — missing docstrings make tool purposes unclear. - Agents called via AgentTool run in a separate session from the parent. Be careful about state sharing. - Long Running Function Tools require a separate completion notification mechanism. Consider polling or webhook-based notifications. ✨ Function Tools let you integrate existing code assets directly into agents, and AgentTool enables seamless agent reuse. A massive boost to development productivity! #ADK# #AIAgent#
Show more
Sydney Sweeney is wrapped in a python — and little else — in bizarre ‘Euphoria’ scene
Google uses Python. Meta uses Python. Netflix uses Python. Spotify uses Python. Dropbox uses Python. Instagram uses Python. Reddit uses Python. Uber uses Python. Pinterest uses Python. OpenAI uses Python. What’s stopping you from learning Python?
Show more
Have you noticed that AI removed ever lasting war between Python vs. R ?! 😂
I used to really enjoy building a nice elegant class in python 🥲
$10 computer (ESP32) running Python, Tailscale, 8 containers and LLM model in parallel offline. Yes it’s possible and actually quite good. You can even test it live in the browser while you wait for your own ESP32 to arrive in the mail 😎 - Custom trained AI model ✅ - 8 containers using under 50kB ✅ - Tailscale client in Rust ✅ - Live demo of everything ✅ Try it out:
Show more
How to tame the inflation python
Curated list of 920 Python machine learning projects