今日已更新 156 条资讯 | 累计 20626 条内容
关于我们

标签:#Python

找到 623 篇相关文章

AI 资讯

Transitioning to Data Engineering: My Top 4 Essential Tools So Far

Switching focus from Frontend development to Data Engineering means shifting from building user interfaces to architecting robust data pipelines. It’s a completely different mindset, and the learning curve is exciting! As I dive deeper into the world of Data, these are the 4 essential tools and concepts that have become the absolute backbone of my daily learning roadmap: 1️⃣ Python (The Swiss Army Knife): Coming from JavaScript/TypeScript, picking up Python has been a breath of fresh air. From writing custom ETL scripts to data manipulation with Pandas, it's the ultimate language for data manipulation. 2️⃣ Advanced SQL (The Core): It's not just about simple SELECT statements anymore. Mastering Window Functions, CTEs (Common Table Expressions), and query optimization is where the real magic happens when interacting with Data Warehouses. 3️⃣ ETL/ELT Pipelines: Understanding how to efficiently Extract, Transform, and Load data without breaking downstream analytics. Moving from UI state management to Data state management is a game-changer. 4️⃣ Cloud Ecosystems & Modern Stack: Exploring how data flows through modern cloud environments and learning how big data tools manage scale. The transition requires patience, but applying my previous engineering background to these new tools makes the journey incredibly rewarding. 💡 To the Data Engineers in my network: What is the one tool or concept you believe is a "must-have" for someone transitioning into the field today? Drop your advice below!

2026-06-02 原文 →
AI 资讯

Running Claude in CI: A GitHub Actions + Claude Code SDK Auto-PR-Reviewer That Costs $0.03 per Review

⚠️ この記事はアフィリエイト広告(プロモーション)を含みます。リンク先で発生した収益の一部が運営者に支払われますが、読者の購入価格には一切影響ありません。 By the end of this article you will have a GitHub Actions workflow that, on every pull_request , runs the Claude Code SDK headlessly, reads only the diff, and posts inline review comments via the GitHub API. I'll show the exact YAML and Python that run in my own repos, the token math that keeps each review at roughly $0.03, and the three failures that cost me a weekend before it worked. Why I stopped piping the full repo into Claude on GitHub Actions My first version did the obvious thing: clone the repo, concatenate every changed file in full, and ask Claude to "review this PR." It worked on toy PRs and exploded on real ones. A 9-file refactor sent ~48,000 input tokens and the review drifted into commentary about code the PR didn't touch. The fix that changed the economics: feed Claude the unified diff with 3 lines of context , not the files. A git diff against the merge base is typically 5–15x smaller than the files it touches. On claude-haiku-4-5 , a median PR in my projects now costs about $0.028 per review (measured across 60 PRs: 4,100 input tokens + 900 output tokens average). The expensive version was hitting $0.40+ on Sonnet because file context dominated. The other lesson: the diff alone is not enough context to judge correctness, but it is enough to catch the 80% of review nits that humans waste time on — unhandled errors, missing null checks, off-by-one, leftover debug prints, secrets in code. So I scoped the prompt to exactly that, and told it to stay silent when unsure. Silence is a feature; a reviewer that comments on everything gets muted by the team within a week. The GitHub Actions workflow YAML that triggers Claude on pull_request This is the full .github/workflows/claude-review.yml . It runs on every PR, restores a uv-cached venv, and calls a Python entrypoint. Note the permissions block — without pull-requests: write the comment-posting step fails with a 403 that GitH

2026-06-02 原文 →
AI 资讯

Persistent Agent Memory with Azure AI Foundry: A Complete Developer Guide

Meta Description: Learn how to build AI agents with persistent memory using Azure AI Foundry Memory Service. A complete developer guide covering concepts, memory types, scope, provisioning, and a full Python implementation with the Foundry Hosted Agent Framework. Persistent Agent Memory with Azure AI Foundry: A Complete Developer Guide Table of Contents Introduction What Is Azure AI Foundry Memory? Memory Types Deep Dive Memory Architecture: How It Really Works Access Patterns: Tool vs. Low-Level API Understanding Scope Hands-On: Provisioning a Memory Store Hands-On: Building the Foundry Hosted Memory Agent Running & Deploying the Agent Security Best Practices Quotas, Limits & Regional Availability Conclusion + Next Steps Introduction Imagine you've just shipped a polished AI assistant for your SaaS product. Users log in, ask questions, and get sharp, helpful responses. The launch goes well. Then the complaints start rolling in. "Why does it keep asking me for my name every single session?" "I told it last week that I'm vegetarian — why is it recommending steak again?" "It feels like talking to someone with amnesia." This is the stateless agent problem — one of the most frustrating gaps between the promise of conversational AI and the lived reality of production deployments. Every conversation starts from a blank slate. The agent has no idea who it is talking to, what that person prefers, or what was discussed yesterday, last week, or a month ago. The result is a user experience that feels hollow and repetitive — the opposite of the intelligent, personalized assistant your users were promised. The solution is persistent memory, and Azure AI Foundry Memory is Microsoft's production-grade answer to exactly this problem. Introduced as part of the Azure AI Foundry platform, the Memory Service gives agents the ability to remember facts across sessions, distill long conversation histories into concise summaries, and retrieve the right context at the right moment — all wit

2026-06-02 原文 →
AI 资讯

DeepSeek vs Qwen vs Kimi vs GLM: Which Chinese AI Model Actually Wins in 2026?

Let me start with a confession: I'm a data scientist who's been burned by hype more times than I care to admit. When everyone told me "Model X is the next GPT-killer," I'd run my own benchmarks and find... well, let's just say the results were rarely as advertised. So when I started seeing claims about Chinese AI models catching up to (and sometimes surpassing) Western counterparts, I did what any self-respecting data nerd would do: I put them through my own rigorous testing pipeline. Over the past three months, I've run over 2,000 API calls across four major Chinese model families — DeepSeek, Qwen, Kimi, and GLM — using Global API's unified endpoint (more on that later). I tracked latency, token costs, output quality across multiple benchmarks, and even threw in some real-world tasks that mattered to me personally. Here's what I found, with all the numbers you'd expect from someone who still gets excited about statistical significance. The Testing Methodology (Because Anecdotes Aren't Data) Before we dive into results, let me be transparent about my approach. I ran each model on the following standardized tests: Code Generation : HumanEval (Python) and MBPP (multi-language) — 164 problems total Reasoning : GSM8K (math word problems) and MMLU-Pro (general knowledge) — 1,200 questions Chinese Language : CLUE benchmarks (text classification, NER, reading comprehension) — 3,500 samples English Language : LAMBADA and Hellaswag — 2,000 samples Speed : Average tokens per second over 100 consecutive requests with consistent prompt lengths I also tested vision tasks where applicable, but let's be real — Kimi doesn't support vision at all, and DeepSeek's implementation is... experimental at best. More on that later. All tests were conducted using the same global-apis.com/v1 endpoint, which normalizes API compatibility to OpenAI's format. This isn't an ad — I genuinely found it made my testing easier because I could swap models without rewriting code. The Big Picture: Pricing

2026-06-02 原文 →
AI 资讯

Three Polymarket CLOB gotchas: 401, "invalid signature", and a cancel that does nothing

Three Polymarket CLOB gotchas: 401, "invalid signature", and a cancel that does nothing Automating Polymarket with py-clob-client , I lost an embarrassing amount of time to three failures that aren't clearly documented anywhere. Here they are with the exact fixes, so you don't. 1. Your cancel returns 404 — because the endpoint isn't what you'd guess The intuitive DELETE /order/{id} returns 404 and your order silently stays open. The real endpoint is: DELETE /order body: {"orderID": "0x..."} # and the body is part of the signature Sign request_path = "/order" together with that body, then send the exact body. Miss this and your "canceled" orders keep resting on the book. 2. 401 Unauthorized that "should work" Authenticated calls need L2 HMAC headers, and the most common silent mistake is POLY_ADDRESS : it must be your wallet address , not the api_key. The reliable move is to let py-clob-client build the headers via create_level_2_headers from correctly-formed RequestArgs (method, request_path, body, serialized_body) — and make sure the serialized body you sign is byte-for-byte the body you send. 3. invalid signature = SignatureType / funder mismatch Nine times out of ten this is the SignatureType not matching how your wallet holds funds: 0 = EOA funder = your own wallet (holds USDC) 1 = POLY_PROXY funder = the proxy address (email/magic wallet) 2 = POLY_GNOSIS_SAFE funder = the safe address Signing as an EOA while pointing funder at a proxy (or vice-versa) yields invalid signature with no further hint. Bonus: the fill you read is wrong For a BUY , the shares you got are in takingAmount ; for a SELL , they're in makingAmount (takingAmount is the USDC). Read the wrong field and your accounting drifts, which then triggers resubmits and balance errors. I packaged the cancel/auth/fill helpers as a small MIT library: https://github.com/BlueWhale-Quant-Lab/polymarket-401-invalid-signature-cancel-order (For the harder production bits — reading /data/trades for reconciliation

2026-06-02 原文 →
AI 资讯

Skills Are a Mess. Let's Fix That.

Skills Are a Mess. Let's Fix That. Here's the problem: you write a skill for zeroclaw. It works locally. You push it. Someone else tries to install it. Nothing works. The error says "missing dependency" but doesn't say which one. Or it installs but the audit fails silently. Or the test harness just... doesn't run. Sound familiar? I've been watching the zeroclaw skills ecosystem grow. More people are authoring skills. More people are hitting the same walls. The v0.7.6 release is about tearing those walls down. What Actually Breaks Let's get specific. Three failure modes I see every week: 1. Install hell zeroclaw skills install my-skill # → Error: Failed to resolve dependency graph # → (no other output) You're left guessing. Is it a peer dependency conflict? A missing Python version? A circular reference in the skill manifest? The loader gives you nothing. 2. Audit blindness zeroclaw skills audit ./my-skill # → Audit complete. 0 issues found. # → (skill crashes immediately on first use) The audit passed. But it didn't check for the actual runtime errors — missing environment variables, incompatible tool signatures, malformed output schemas. It checked the manifest format. That's it. 3. Test harness that doesn't test zeroclaw skills test ./my-skill # → Running 3 test cases... # → All passed. # → (skill still hallucinates in production) The test harness runs your skill against mock data. But the mock data doesn't match real tool outputs. Your skill passes locally, fails in the wild. Why This Happens The current architecture treats skills as static packages. You define metadata in a skill.json , point to some functions, and assume it works. But skills are dynamic. They call tools. They depend on runtime state. They interact with the sandbox. The loader doesn't validate the runtime contract. The audit doesn't simulate execution. The test harness doesn't fuzz inputs. So you get false positives everywhere. "Works on my machine" becomes "works in my specific environment with

2026-06-02 原文 →
AI 资讯

Clean Audio Before Whisper: How Noise Removal Improves Transcription Accuracy (With Code)

Whisper is remarkably robust. But "robust" doesn't mean "immune to noise." If you've ever run a meeting recording through Whisper and gotten back garbage — or worse, confidently wrong text — the problem is usually the audio, not the model. Here's the thing: different noise types fail differently. Electrical hum causes Whisper to hallucinate syllables. Echo makes it drop words entirely. Static makes it confuse phonemes. Knowing which noise you have tells you exactly which fix to apply. This post covers: ✅ How each noise type (hum, hiss, echo, wind, static) degrades Whisper output ✅ A Python preprocessing pipeline that detects and removes noise before transcription ✅ How to call the StemSplit Denoise API for cloud GPU noise removal (no local setup) ✅ Measured WER improvements you can reproduce The Noise → Transcription Failure Map Noise Type What It Sounds Like How It Breaks Whisper Hum (50/60 Hz) Constant low-frequency "buzz" Inserts phantom syllables, lowers confidence Hiss High-frequency "shhh" Loses sibilants, confuses "s/sh/f" sounds Echo / Room reverb Words "bounce" and overlap Drops end-of-sentence words, merges phrases Wind Burst plosives, low-frequency rumble Transcribes as "[inaudible]", breaks sentence segmentation Static / crackling Random pops and snaps Breaks word boundaries, causes mid-word cuts These aren't hypothetical. They're reproducible failure modes. Let me show you how to handle each one. Prerequisites pip install openai-whisper requests python-dotenv soundfile numpy librosa You'll need: A StemSplit API key from stemsplit.io/developers (free 5-minute tier, no credit card) ffmpeg installed ( brew install ffmpeg / sudo apt install ffmpeg ) The Preprocessing Pipeline Here's the full pipeline before we break it down: Audio file → [Noise detection] → [Denoise via StemSplit API] → [Post-process: normalize, trim silence] → Whisper → Transcript Step 1: Detect What Kind of Noise You Have Before throwing everything at a denoiser, it helps to know what you

2026-06-02 原文 →
AI 资讯

The RL Flywheel That Actually Works

The RL Flywheel That Actually Works Here's what's breaking: You've got a reinforcement learning setup that trains, validates, deploys, and then... nothing. No feedback loop. No automatic retraining. No safety gates. Just a model that gets stale the moment it hits production. Sound familiar? I've been building RL systems for a decade. The pattern is always the same: great training pipeline, terrible deployment loop. You spend weeks getting 95% validation accuracy, push to prod, and three days later the distribution shifts. Your agent starts making garbage decisions. You scramble to retrain. Rinse. Repeat. This sucks. I know. The Real Problem The issue isn't training. It's the feedback loop . Most RL systems have: Training pipeline — works fine Validation — mostly works Deployment — fire and forget Observation — maybe some metrics Strategy update — manual, if ever Step 4 and 5 are broken. You're flying blind after deployment. The Flywheel Architecture Here's what a real RL flywheel looks like: Train → Simulate → Validate → Gate → Deploy → Observe → Analyze → Train Every arrow is automated. Every gate is a hard check. Every observation feeds back into training strategy. Let me show you the actual implementation. The Training Loop class RLFlywheel : def __init__ ( self ): self . model = Model () self . buffer = ReplayBuffer ( 1_000_000 ) self . safety_gate = SafetyGate () self . observer = OnlineObserver () def train_epoch ( self , episodes = 1000 ): for ep in range ( episodes ): states , actions , rewards = self . simulate_episode () self . buffer . store ( states , actions , rewards ) batch = self . buffer . sample ( 256 ) loss = self . model . update ( batch ) # Validate against known failure modes validation_score = self . safety_gate . validate ( self . model ) return loss , validation_score Notice the validation happens during training, not after. That's the first gate. The Safety Gate class SafetyGate : def __init__ ( self , thresholds ): self . thresholds = thre

2026-06-02 原文 →
AI 资讯

I Scanned My PC for AI Agents — Found 457 of Them

After using Claude Code, Codex, and Pi Agent for months, I wondered: how many AI agents are on my machine? I built a scanner. Here's what it found: Framework Active Archived Claude Code 192 191 Codex CLI 37 0 Pi Agent 8 sub-agents 12 scripts MCP Servers 8 - Total 448+ The Waste Duplicate calls : Same prompt → 3 agents (8-18% waste) Overqualified models : Simple tasks on expensive models (15-25% waste) Cache fragmentation : No shared prompt cache (12-20% waste) Zombie agents : Archived still indexed (2-8% waste) → 30-50% of AI API spend is wasted. The Fix AMA — Agent Management Agent bash pip install ama-core && ama scan && ama start Scans all agents across frameworks Smart routing (simple task → cheap model) Lifecycle management Local dashboard at localhost:8765 Free calculator: ama-agent-store.vercel.app/calculator MIT licensed. Feedback welcome!

2026-06-02 原文 →
AI 资讯

Free Live Webinar: Testing AI Agents in Python for Real-World Reliability

AI agents are getting smarter fast. They can reason through tasks, manage workflows, call tools, and automate decisions across applications. But as these systems become more capable, one challenge becomes impossible to ignore: reliability. How do you know your AI agent is making the right decisions consistently? How do you test workflows that involve memory, reasoning, and multiple execution steps? And how do you debug failures when outputs become unpredictable? That’s exactly what this free live webinar, “ Testing AI Agents in Python: Building Reliable Evals with LangGraph & LangSmith ,” is focused on. The session includes a “ Live demo of the AI agent evaluation pipeline ,” where you’ll see how developers are building structured evaluation workflows using LangGraph and LangSmith to test, trace, and improve AI agent performance in real-world scenarios. Here is the link to register .. Who Should Join This Session? This webinar is designed for developers and technical teams working with AI systems, especially: Python developers building AI agents or LLM workflows AI engineers exploring evaluation and observability Architects designing production-ready AI systems Product teams experimenting with AI automation Founders building intelligent applications faster Whether you’re actively deploying AI agents or still evaluating the ecosystem, this session will give you a clearer understanding of how reliable AI systems are actually built. What You’ll Learn During the Webinar This isn’t a high-level AI trends session. The focus is practical implementation, testing workflows, and evaluation strategies developers can actually use. In this webinar, you’ll learn: Why evaluation matters for modern AI agents How LangGraph helps manage complex agent workflows How LangSmith can trace and monitor agent execution Ways to create repeatable and scalable evaluation pipelines Practical approaches for debugging and improving AI agent behavior See the AI Evaluation Pipeline Live One of the b

2026-06-01 原文 →
AI 资讯

Why I Stopped Organizing AI Agents by Role (and Built a Document Exchange Center Instead)

Most multi-agent frameworks for software development organize agents around roles : a product manager agent, a developer agent, a tester agent. ChatDev and MetaGPT pioneered this approach, and it works well for monolithic tasks. But I ran into a wall when I tried to apply it to a real system with multiple independently-deployed services. The Problem with Role-Based Coordination Imagine you have a backend search service and a frontend management console. The backend team implements a new API endpoint. The frontend needs to adapt. In a role-based framework, there's no natural mechanism for this. Both agents are "developers" in the same simulated organization. There's no concept of service boundaries, no versioned contracts, no way to say "the backend changed, and the frontend needs to know exactly what changed." The coordination problem in multi-service development isn't "which role should handle this task" — it's "which service needs to know about this change, and what exactly changed." That reframing led me to build something different. AgentNexus: Coordinating Agents at the Service Granularity AgentNexus is a document exchange center that treats each service as a first-class citizen. Instead of roles, it uses service boundaries as the coordination primitive. Here's how it works: Each service registers as a sub-project with its own document namespace Services publish versioned Markdown documents: requirements, design specs, API docs, config Services subscribe to documents from other services they depend on When a subscribed document changes, the subscriber receives a diff-aware notification containing both the structured diff and the full latest content The whole thing is exposed as an MCP (Model Context Protocol) server running in streamable-HTTP mode, so multiple agents can connect simultaneously from different machines. The Diff-Aware Update Protocol This is the part I'm most proud of. When an agent calls get_my_updates_with_context , it gets back: { "update_id"

2026-06-01 原文 →
开发者

Python Programming for Beginners – Day 9

Tuples, Sets, and Dictionaries in Python In the previous lesson, we learned about Lists and how they are used to store multiple items in a single variable. Today, we will learn about three important Python data structures: Tuples Sets Dictionaries These data structures help programmers organize and manage data efficiently in different situations. 1. Tuples in Python A Tuple is a collection of items stored in a single variable. Tuples are: Ordered Unchangeable (Immutable) Allow duplicate values Tuples are created using parentheses "()". Example languages = ( " Python " , " Java " , " C++ " ) print ( languages ) Output ( ' Python ' , ' Java ' , ' C++ ' ) Accessing Tuple Items Tuple items are accessed using indexes. Example languages = ( " Python " , " Java " , " C++ " ) print ( languages [ 0 ]) print ( languages [ 1 ]) Output Python Java Negative Indexing in Tuples Example languages = ( " Python " , " Java " , " C++ " ) print ( languages [ - 1 ]) Output C ++ Tuple Length The "len()" function returns the number of items in a tuple. Example numbers = ( 10 , 20 , 30 ) print ( len ( numbers )) Output 3 Why Tuples are Important Tuples are useful when data should not be modified accidentally. They are commonly used for: Fixed data Coordinates Database records Returning multiple values from functions 2. Sets in Python A Set is a collection of unique items. Sets are: Unordered Unchangeable items Do not allow duplicates Sets are created using curly brackets "{}". Example numbers = { 1 , 2 , 3 , 4 } print ( numbers ) Output {1, 2, 3, 4} Duplicate Values in Sets Sets automatically remove duplicate values. Example numbers = { 1 , 2 , 2 , 3 , 4 } print ( numbers ) Output {1, 2, 3, 4} Adding Items to a Set The "add()" method inserts a new item into a set. Example numbers = { 1 , 2 , 3 } numbers . add ( 4 ) print ( numbers ) Output {1, 2, 3, 4} Removing Items from a Set The "remove()" method removes an item from a set. Example numbers = { 1 , 2 , 3 , 4 } numbers . remove ( 2 ) print

2026-06-01 原文 →
AI 资讯

Your Scraper Returned a Clean Row. It Was Wrong.

The row looked perfect. rating: 7 . Valid JSON, right type, no nulls, no missing keys. My schema check waved it through. The page had returned HTTP 200. The selectors hadn't moved. Everything green. A rating of 7 on a 5-star site is impossible. The model invented it, formatted it correctly, and handed it to me with total confidence. That's the failure I want to talk about. Not the scraper that breaks loudly. The one that hands you a clean-looking row that is quietly, plausibly false — and sails past every check you have, because your checks are all looking at the shape of the data, and the lie is in the value . TL;DR HTTP 200, intact selectors, and valid JSON tell you the form is fine. They say nothing about whether the value is true. When an LLM extracts from messy free-text, structured-output mode guarantees you get valid JSON. It does not guarantee the content is real. The model fills uncertain fields rather than leaving them empty — because the schema demands a complete row. A ~60-line value-level sanity gate (ranges, dates, cross-field, reference, language) catches the obvious lies before they hit your database. Real code and real output below. The honest catch: this gate catches rule violations , not plausible lies inside the allowed range . A rating: 4 where the truth is 2 slides right through. I'll be specific about where the gate stops. Two different ways a scraper lies to you I wrote about source drift last week — the case where the page changes underneath you and a 30-line schema check catches the structure shifting. That's an input problem. The source mutated; your agreement with the page broke; you detect it by watching the shape. This is the other end of the pipe. The source is fine. The page is intact, the selectors are correct, the structure is exactly what you expected. The thing that lied to you is the model , on the extraction step, when you asked it to pull structured fields out of a paragraph of human prose. Those two failures feel similar and t

2026-06-01 原文 →