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

标签:#ai

找到 7754 篇相关文章

AI 资讯

OpenAI Usage API api_key_id: Reconcile Tokens and Costs by Key

OpenAI Usage API api_key_id grouping solves a practical reporting gap: I can see which API key produced completion-token activity and which key accumulated cost. The tricky part is not making the two requests. It is joining their daily buckets without dropping unattributed or unmatched data. I want a reconciliation report to expose gaps, not smooth them over. A missing cost row, a cost-only row, or a null key ID can each be useful evidence. This pattern keeps those cases visible with a deterministic .NET sample that needs no credentials or paid calls. Why OpenAI Usage API api_key_id needs a full-outer join OpenAI's August 4, 2026 API changelog added API-key filtering and grouping to the usage and cost APIs. That gives both responses a shared operational dimension, but it does not make them identical datasets. The completions usage endpoint reports measures such as input tokens, output tokens, and model requests. Its api_key_id can be null. The costs endpoint returns monetary amounts and currency, also with a nullable API-key dimension. An inner join would retain only rows present in both responses. That is attractive for a tidy chart, but unsafe for reconciliation. It can hide a key that has token usage but no matching cost row, a key with cost but no completion row, or an unattributed bucket. I use a full-outer join keyed by (start_time, end_time, api_key_id) instead. Null or blank IDs become an explicit display value such as <unattributed> ; they do not disappear. Query both APIs at the same daily grain The Costs API supports daily buckets, so I request bucket_width=1d from both endpoints. I also group by the same single dimension: GET /v1/organization/usage/completions ?start_time=... &end_time=... &bucket_width=1d &group_by=api_key_id GET /v1/organization/costs ?start_time=... &end_time=... &bucket_width=1d &group_by=api_key_id Both resources paginate with has_more and next_page . I keep requesting pages until has_more is false. If a response says more data exis

2026-08-31 原文 →
AI 资讯

FastAPI for AI Engineers - Part 8: Uploading Files with FastAPI

In the previous article, we learned how to secure our APIs using JWT Authentication and protect routes from unauthorized access. Now let's explore another feature used in almost every AI application— file uploads . If you've built applications like ChatGPT, document Q&A systems, resume analyzers, legal contract reviewers, or medical report analyzers, one thing is common across all of them: The user uploads a file. Without file uploads, there is nothing for the AI model to process. If you haven't read the previous article, check it out first to continue the series: Protecting routes with JWT Tokens Why Do We Need File Uploads? Consider some popular AI applications: ChatGPT allows you to upload PDFs and images. Resume analyzers require your resume. Legal AI assistants analyze contracts. Medical AI systems analyze lab reports. RAG applications build knowledge bases from documents. The workflow usually looks like this: User │ ▼ Upload File │ ▼ FastAPI │ ▼ Save / Read File │ ▼ Process using AI FastAPI makes uploading files extremely simple. Installing Required Package FastAPI uses python-multipart to process uploaded files. Install it using: pip install python-multipart Your First File Upload API FastAPI provides two important classes: File UploadFile Let's import them. from fastapi import FastAPI , File , UploadFile app = FastAPI () Creating the Upload Endpoint @app.post ( " /upload " ) def upload_file ( file : UploadFile ): return { " filename " : file . filename } Run the application. Open Swagger UI. Click POST /upload . You'll notice FastAPI automatically provides a file picker. Upload a file. Response: { "filename" : "resume.pdf" } Our API successfully received the uploaded file. Understanding UploadFile You might wonder: Why didn't we simply use a string or bytes? FastAPI provides the UploadFile class because it contains useful information about the uploaded file. Some commonly used attributes are: file . filename Returns: resume.pdf file . content_type Returns: a

2026-08-31 原文 →
AI 资讯

Building a WhatsApp AI Lead Qualification System for Real Estate

Most WhatsApp AI projects start with a simple goal: Receive a message → send an AI-generated reply. For real estate, I think that's only the beginning. A useful real-estate AI system should do more than generate text. It should understand the buyer's intent, capture important information, qualify the lead, preserve conversation context, organize that information in a CRM, and know when a human salesperson should take over. That's the system I'm currently building with Vaxyro . The problem: a WhatsApp conversation is not a lead record A typical real-estate enquiry might look like this: "Hi, is the 3 BHK available?" Then: "What's the price?" Then: "Is there anything around 80L in Gurgaon?" Then: "I can visit this weekend." The messages themselves are simple. The difficult part is turning the conversation into structured information that a sales team can actually use. The system should be able to understand something like: Property type: 3 BHK Location: Gurgaon Budget: ₹80 lakh Timeline: This weekend Intent: High Next action: Site visit discussion Instead of leaving all of that information buried inside a WhatsApp conversation. What a WhatsApp AI lead qualification system should do I think the workflow can be broken into six stages: WhatsApp message ↓ Message understanding ↓ Intent detection ↓ Lead qualification ↓ Structured CRM data ↓ Follow-up ↓ Human handoff The important part is that the AI is not only generating a reply. It is also producing structured sales information. That distinction changes the architecture. 1. Message understanding The first step is understanding what the buyer is actually asking. For example: "Looking for a 3 BHK in Gurgaon under 80L" could produce structured information such as: { "property_type": "3 BHK", "location": "Gurgaon", "budget": "8000000", "intent": "property_search" } This gives the rest of the system something useful to work with. The goal is not to perfectly understand every sentence. The goal is to extract the information tha

2026-08-31 原文 →
AI 资讯

Debian won’t ban AI code from its Linux distribution

Debian voted to allow developers to use AI tools in their contributions to the Linux distribution's "development, maintenance, [and] documentation." The new policy on AI acknowledges that "responsible" use of AI can improve developers' productivity, and goes on to say, "generative AI is neither exempt from nor subject to special rules beyond the standards already […]

2026-08-31 原文 →
AI 资讯

DDD and Typelevel cookbook

Hello everyone. Scala's a programming language I've enjoyed learning on the side not only because I think it's stylish but because it's made me a better developer. Some of the gripes you encounter once you try to go intermediate or beyond, it's the Typelevel stack complexity. You just want to bootstrap a server and start writing some routes, and tbh sometimes the docs aren't that friendly. That's why I wrote Scala 3 Domain Design & Typelevel Stack Cookbook — a book that teaches some DDD in Scala and gives you some recipes to get you started on the stack (cats, cats-effects, fs2, http4s). It's a WIP currently at 40%. You can read a couple of chapters for free in leanpub: https://leanpub.com/scala3-domain-typestack-dev

2026-08-31 原文 →
开发者

DoorDash’s Flux Runs 130,000 Engineering Tasks Through Cloud-Based Agents

DoorDash has moved engineering agent workloads from developer laptops to its Flux cloud platform. The platform automated 130,000 engineering tasks in one month and supports more than 25,000 automated code reviews weekly. Flux uses isolated Firecracker microVMs, an MCP gateway, reusable playbooks, and multiple invocation surfaces to run agent workflows with scoped access and centralized auditing. By Leela Kumili

2026-08-31 原文 →
AI 资讯

Instagram cracks down on AI accounts pretending to be human

Instagram is finally taking steps to address the rise of fake AI-influencer accounts that have gotten harder to spot. It's also renaming the "AI creator" label to "AI-generated profile" to make it clear when a profile features an AI-generated person that's not a real human being. "We've heard that people don't like seeing a profile […]

2026-08-31 原文 →
AI 资讯

Grok 4.6 Is Now in Foundry — Here’s What It Means If You Write C#

Grok 4.6 — SpaceXAI's latest frontier model — just landed in public preview in Microsoft Foundry as an Azure Direct Model. The headline isn't "another big model dropped." It's that Grok 4.6 is built specifically for long-horizon, agentic work: planning across many steps, calling tools reliably, recovering when something goes wrong, and handing you a finished work product instead of a half-baked fragment you have to stitch together yourself. That's a meaningfully different design target than "answer this one prompt well." And it's exactly the kind of thing that matters once you move past demos and start building agents that actually have to survive contact with real workloads. As always: no Python required, no notebook required. Just Microsoft.Extensions.AI and dotnet run . What Grok 4.6 Actually Is A few things worth knowing before you touch any code: Frontier reasoning at value pricing. Grok 4.6 is positioned as the value-tier frontier option — frontier-class reasoning at a materially lower cost per task than comparable models. That matters the moment "reasoning agent" stops being a one-off demo and becomes something running continuously in production. Selectable reasoning effort. You choose reasoning depth per call — low , medium , high , or xhigh (default high ) — instead of paying maximum-reasoning cost on every single request regardless of whether the task needs it. Long-horizon agentic execution. It's designed to sustain complex, multi-step work — planning, tool calls, error recovery, and self-verification — with limited human babysitting. Multimodal input. Text and images, so document-heavy, diagram-heavy, and screenshot-heavy workflows don't need a bolted-on separate vision pipeline. 200K token context window at launch. Solid for most agentic and document-analysis workloads — just set expectations up front if your scenario needs more. Still preview. Validate against your own prompts, tools, and safety thresholds before anything production-sensitive touches i

2026-08-31 原文 →
AI 资讯

How Do You Actually Evaluate Your RAG App?

RAG Evaluation: How to Know if Your RAG System Actually Works You built a RAG chatbot. It answers questions from your documents. You test it a few times. The answers look good. So… can you ship it? No. One good answer doesn't tell you whether your RAG system works. A RAG application has multiple moving parts. The retriever can fail. The generator can fail. They can both work individually and still fail when combined. And once the application goes live, your users will ask questions you never tested. So how do you actually evaluate a RAG system? The answer is an eval suite . Components → Pipeline → Application → Regression → Online Evaluation This article walks through the same framework I use in my RAG evaluation video. ▶ Watch the full video The Problem: “It Feels Better” Isn't an Evaluation Imagine you're building an airline support chatbot for a fictional airline called SkyHigh Airlines . Passengers can ask questions about: Baggage Refunds Pets Travel policies The chatbot uses RAG to search the airline's policy documents and generate an answer. A passenger asks: “How much does it cost to bring my cat?” The chatbot responds: “Bringing your cat costs $95.” Looks good. But what if the retriever found the wrong document and the model happened to generate something plausible? Or what if the retriever found the correct policy, but the model ignored it and invented the answer? From the outside, both problems look identical: Bad answer. But they require completely different fixes. That's why you can't evaluate RAG as one giant black box. You need to test the pieces separately. First: Build a Golden Set Before measuring anything, you need something to measure against. Create a fixed set of questions that represent the kinds of questions your users will actually ask. For our SkyHigh chatbot, imagine we create 50 questions about the airline's policies. For every question, we record: The question The correct answer The document chunks that should contain the answer For examp

2026-08-31 原文 →
AI 资讯

Automating Excel Merges with Power Automate: A Deep Dive into Workflow Automation and Data Cleaning

Dealing with multiple Excel or CSV files is a common task in business. Whether it is sales reports from different regions, customer data across various campaigns, or financial records by month, the need to combine these files into a single, cohesive dataset is constant. Manually copying and pasting or even using complex formulas can quickly become a time sink, prone to errors, and a source of frustration. What if you could automate this repetitive process? Imagine setting up a workflow that automatically merges your Excel files for you. That is where Microsoft Power Automate comes in. And when your data is messy, inconsistent, or riddled with duplicates, AI tools can take your automation to the next level. This guide will walk you through building robust workflows in Power Automate to combine your Excel workbooks. We will also explore how AI can address the often overlooked challenge of data cleaning and standardization, turning disparate data into a clean, unified source. Why Automate Excel Merges? The benefits of automating Excel data consolidation extend beyond simply saving time. Consider these advantages: Time Savings: Free up hours spent on manual data handling, allowing you to focus on analysis and strategic tasks. Reduced Errors: Eliminate human error from copy-pasting, formula mistakes, or missing data. Consistency: Ensure data is merged and formatted uniformly every time, regardless of who runs the process. Scalability: Easily handle increasing volumes of files without proportional increases in manual effort. Timeliness: Get up-to-date consolidated reports faster, enabling quicker decision-making. The Old Way: Manual Merges and VBA Limitations For years, consolidating data meant either painstaking manual copy-pasting, using VLOOKUP or INDEX/MATCH across sheets, or resorting to VBA (Visual Basic for Applications) scripts. Manual methods are slow and error-prone, especially with large datasets or many files. VBA offered a significant improvement, providing c

2026-08-31 原文 →
AI 资讯

J’ai mis un Agent Claude dans ma CI pendant 3 mois , voici ce qu’il a vraiment fait

Retour d’experience sur l’automatisation de déploiements avec un agent LLM et sur les gardes-fous qu’il a fallu inventer en cours de route L’idée est venue d’un frustration banale. Sur mon projet terraform , je passais beaucoup de temps à refaire la même chose : lire un plan qui échoue , comprendre pourquoi , corriger des lignes de configurations , toujours trop long. Un agent LLM sait faire ca , mais la question était se savoir s’il pouvait le faire sans supervision , dans un pipeline , sur une infrastructure qui coûte de l’argent réel. Trois mois plus tard , la réponse est oui , mais pas du tout dans le périmètre que j’imaginais au départ. Le Montage: Rien de complexe, un VPS à 12 euro par mois , la CLI de l’agent installée dessus , et un runner Gitlab qui l’invoque sur un déclencheur précis: quand un terraform plan échoue sur une MR. l’agent recoit trois choises: la sortie d’erreur , le diff de la MR, et un accès en lecture du dépôt.Il produit une proposition de correctif sous forme de patch, qu’il pousse sur une branche dédiée. Ce qui a bien marché: les erreurs de typage et de reference. Un var.instance_type mal orthographié, un output référencé qui n'existe plus après un refactor, un module dont la signature a changé. L'agent corrige ça avec un taux de réussite que j'estime autour de 85 %. Ce sont des erreurs mécaniques, à contexte local, exactement ce qu'un LLM traite bien. Les messages d’erreur opaques. C'est le gain que je n'avais pas anticipé. Certaines erreurs de provider AWS sont d'une inutilité remarquable , un InvalidRequestException sans description, par exemple. L'agent, lui, va lire le corps de la requête dans les logs de debug et repérer le paramètre malformé. Il ne « comprend » pas mieux que moi, mais il lit trois cents lignes de log en deux secondes sans se lasser. À 19h un vendredi , ma qualité de diagnostic s’effondre. Celle de l’agent, non. Ce qui a cassé Il a proposé de détruire une base de données. C'est l'incident qui a tout recadré. Un clus

2026-08-31 原文 →
AI 资讯

Running Local LLMs with RamaLama and Docker on a Mac: A Hands-On Guide

RamaLama runs large language models as OCI containers, so a single command ( ramalama run smollm:135m ) pulls a model and starts talking to it, with no Python environment to babysit. I spent an afternoon putting it through its paces on an Apple Silicon Mac (Apple M4 Pro, 48 GB RAM, macOS 26.6) with Docker 29.4 provided by OrbStack. This guide is what I actually saw: the install, the first model, an OpenAI-compatible server, and the one macOS-specific catch that isn't obvious from the docs. Every command and number below is from that run, on RamaLama 0.24.0. What is RamaLama? RamaLama is an open-source CLI from the container-tooling community that treats models like container images. Instead of assembling an inference stack yourself, it pulls a hardened OCI image containing llama.cpp (or vLLM/MLX) plus your chosen model and runs it with Podman or Docker. If you've used Ollama the ergonomics feel familiar ( run , serve , list , pull ), but the runtime and model live inside containers you can inspect and sign, and weights come straight from Hugging Face, Ollama, or any OCI registry. Installing RamaLama on macOS With Homebrew it's one command: brew install ramalama That pulled RamaLama 0.24.0 and, notably, its own copy of llama.cpp , ggml , and libomp as dependencies. Hold onto that detail; it matters for GPU acceleration later. Confirm the install: ramalama version # ramalama version 0.24.0 You also need a container engine running. I used Docker through OrbStack; Podman works too and is RamaLama's default on Linux. Running your first model The headline command: ramalama run smollm:135m "In one sentence, what is a Linux container?" Passing a prompt as an argument gives you one-shot output instead of dropping into a chat REPL. On first run this pulled the RamaLama container image, downloaded the model, and answered. smollm:135m resolves to hf://HuggingFaceTB/smollm-135M-instruct-v0.2-Q8_0-GGUF , a 138 MB, 8-bit quantized GGUF from Hugging Face. First-run wall-clock was 2

2026-08-31 原文 →
AI 资讯

When Your AI Reviewer Remembers Too Much: A Two-Phase Memory Probe

Most AI code-reviewer evaluations treat the candidate as an amnesiac: feed it one pull request, read one verdict, and move on. Persistent-memory reviewers break that model because they keep history across PRs, and that history becomes a second source of bugs. The dominant failure is no longer amnesia but overconfidence in stale context. A two-phase probe exposes whether a candidate trusts its own memory more than the repository's current decisions. This article supplies the complete take-home package: a fixture repository, a reusable candidate prompt, an HTTP-flavored scoring rubric, a reference solution, and a zero-cost runner script. The probe uses two synthetic PRs and measures one skill: which convention source wins inside the reviewer's context window. That focus separates it from single-shot snapshot tests, which cannot observe memory effects at all. Why Memory Changed the Review Game Review agents increasingly index merged PRs, cache decision logs, and carry state between sessions; memory is now a product feature rather than an accident. A bot that recalled yesterday's debate can produce faster and better reviews than a cold-start model. The same memory can poison verdicts when it retrieves an obsolete decision or anchors on the first PR it ever saw. Hiring decisions usually rest on a one-off trial that optimizes for prompt compliance, not for long-run behavior. A bot can ace a snapshot test and then fail its third week by citing a convention that the repository replaced. The probe below converts that risk into a scored, reproducible exercise. The Fixture Repository fixture/ ├── docs/decisions/0001-metrics-pipeline.md # accepted 2026-07-02 ├── docs/decisions/0012-rename-to-telemetry.md # accepted 2026-08-14 ├── src/metrics_service.py # legacy module, 120 lines ├── src/telemetry_service.py # replacement module, 140 lines └── pyproject.toml # lint: E501 disabled for telemetry only The fixture encodes a deliberate conflict: the team renamed the metrics pipeline

2026-08-31 原文 →