泽德人工智能
Zed AI

原始链接: https://zed.dev/blog/zed-ai

Zed AI 提供快速、可靠的文本编辑器,与 Anthonyptic 的 Claude 3.5 Sonnet 提供的人工智能技术集成。 开发人员可以使用其辅助面板和内联转换等功能来编写和分析代码,同时利用人工智能辅助。 助手面板提供了一个文本编辑器,具有包罗万象的上下文,包括文件内容、终端输出、诊断等,从而实现完全的透明度和控制。 内联转换为生成或修改代码提供实时反馈,从而提高效率和整体编码体验。 此外,用户可以通过助手面板使用自定义命令或插件扩展功能。 在初始阶段,Zed AI 是免费使用的。 这个创新的开源平台鼓励开发人员进行修补并为其发展做出贡献,从而促进协作开发环境。 用户可以在MacOS或Linux系统上下载Zed。

Zed 的人工智能 (AI) 集成可让编码人员在环境中顺利、愉快地使用。 用户更喜欢与 Anthropic 直接通信,以尽量减少中间人对其代码的访问。 然而,总体而言,用户发现了 Zed 未来潜在应用的价值。 他们很高兴 Zed 很快就能建立盈利的收入来源,从而减少对可持续性和寿命的担忧。 Zed 无需对开源编辑器收费,而是可以在两年后根据 BSD 或 MIT 等流行许可证授权源代码来实现开放核心模型。 公司无需破解许可软件,只需在运行新代码之前购买许可证密钥即可。 在不牺牲免费版本的情况下有效执行开放核心模型具有挑战性,但它们允许通过付费销售进行持续开发和更新。 除了 AI 之外,用户主要使用 Zed 来参考材料和确定性代码生成,利用不太常用的函数和方法,查找丢失的信息,排除错误,并寻求特定编码步骤组合的指导。 他们对等待人工智能扩展的响应表示不满,因为它们扰乱了用户的流程。 在考虑 AI 驱动的自动完成选项时,用户建议尝试使用 GitHub 的 Codex 或 Cursor 的 Copilot++,因为它们的速度和有效性。 用户预计人工智能准确性将取得显着进步,从而在不久的将来提高生产力水平。 尽管开源项目面临着影响 PR 的低质量 AI 输出的挑战,但用户仍然对当前的 AI 功能持批评态度。 他们鼓励产生高质量的结果,以赢得怀疑并确保在市场中生存。 最后,用户承认 Zed 与其他 AI 助手不同,专注于操作和编辑文本,并赞扬 Zed 强调提供灵活、可定制的上下文帮助。
相关文章

原文

At Zed, we've dedicated our careers to mastering the art of text manipulation. From crafting parser generators to designing programming languages and shipping two production-grade text editors, we've always been captivated by the expressive power of words and symbols. So when large language models emerged to revolutionize text interpretation and generation, we knew we had to explore their potential.

In the two years since LLMs came onto our radar, we've been focused on building out the core of Zed: a fast, reliable text editor with the features developers need. Meanwhile, we've been quietly experimenting with integrating LLMs into our own workflows. Not as a flashy gimmick, but as a practical tool to enhance our productivity working on a complex, real-world codebase.

As we refined our AI integration, we caught the attention of some unexpected allies. Engineers at Anthropic, one of the world's leading AI companies, discovered Zed and quickly saw the value of our raw, text-centric interface that puts minimal separation between the user and the language model. Their enthusiasm was validating, and our conversations sparked a dialogue that quickly evolved into a collaboration.

Now, we're ready to introduce Zed AI, a hosted service providing convenient and performant support for AI-enabled coding in Zed, powered by Anthropic's Claude 3.5 Sonnet and accessible just by signing in. We also worked with Anthropic to optimize Zed for implement their new Prompt Caching beta, leading to lightning-fast responses even with thousands of lines of code included in the context window while reducing cost.

Zed AI is available now, free during our initial launch period. Sign in to Zed to access an AI-powered assistant panel and inline code transformations that integrate directly with your editing environment.

How Zed AI Works

What began as an experiment in AI-assisted coding has evolved into something that's captured the attention of leading AI practitioners. Our collaboration with Anthropic has grown organically, with a growing wave of their developers now using Zed daily and a core team of Anthropic's Rust engineers actively contributing to our open-source codebase.

By marrying cutting-edge AI with a fast, thoughtfully designed editor, we're creating a tool that resonates with those at the forefront of AI development—experts who demand both power and precision in their workflows.

Our approach to AI-assisted coding hinges on the interaction between two core features: Zed's assistant panel and inline transformations. This combination allows developers to leverage the power of language models while maintaining full control over their code.

The Assistant Panel: Mastering Massive Context

The assistant panel is where you interact with AI models in Zed, but it's not your typical chat interface. It's a full-fledged text editor that exposes the entire LLM request. Code snippets, conversation history, file contents—it's all there, and it's all just text. You can observe, edit, and refine any part of the request using familiar coding tools, giving you full transparency and control over every interaction.

To populate this text-based context, we've introduced a system of slash commands:

  • /tab: Insert the contents of an open tab
  • /file: Insert the contents of a specific file or tree of files
  • /terminal: Include terminal output
  • /diagnostics: Insert diagnostic information from across the codebase
  • /fetch: Insert the response from an arbitrary HTTP URL

Creating a Zed extension using the assistant panel.

The /file command allows us to bring in relevant context from our codebase, which the AI can then use to assist in development tasks.

When you use a slash command or the quote selection binding (cmd->), Zed inserts the content as folded text. This includes entire directory trees, which are inserted as recursive folds containing the full text of each file.

Zed's folding mechanism for inserted context balances detail with the big picture when working with large codebases or API documentation. Every token of context remains visible and editable, ensuring precise control over AI prompts. Expand folds to examine specifics, or collapse them to focus on the overall structure. This flexibility lets you tailor both your view and your AI interactions to the task at hand.

Slash commands are extensible via WebAssembly or a JSON-based context server protocol, opening up exciting possibilities. You can create custom commands tailored to your workflow, and we envision a future where language servers might implement /commands to fetch context in language-specific ways.

Now that we've created our Perplexity extension, let's see it in action:

Using the created Zed extension.

In this demo, we:

  1. Use our new /perplexity command to fetch key C interfaces for microphone capture on macOS: "/perplexity Provide the essential C interfaces for capturing microphone input on macOS. Include only the most relevant functions and structures."

  2. Use the fetched interfaces to generate Rust bindings: "Generate Rust bindings for capturing microphone input on macOS using these C interfaces."

This streamlined workflow demonstrates how Zed AI can seamlessly integrate external knowledge (/perplexity) and code generation, all within a single, coherent interface. By fetching the key interfaces directly, we've eliminated the need for manual file operations, making the process more efficient and focused.

Inline Transformations

Inline transformations, activated with ctrl-enter, allow you to transform and generate code via natural language prompts. What sets them apart is their precision and responsiveness.

To give you fast feedback, we've implemented a custom streaming diff protocol that works with Zed's CRDT-based buffers to deliver edits as soon as they're streamed from the model. You see the model's output token by token, allowing you to read and react to changes as they happen. This low-latency streaming creates a fluid, interactive coding experience that keeps you engaged and in control throughout the process.

Inline transformations in Zed use the context you've built in the assistant panel. There's no hidden system prompt-you see and control every input shaping the model's output. This transparency lets you fine-tune the model's behavior and improve your skills in AI-assisted coding.

Text transformation in Zed gains a powerful dimension through its recursive capabilities. You can apply inline transformations within the assistant panel itself, allowing you to refine context and iteratively improve prompts. This feature turns the panel into a dynamic workspace for prompt engineering, where you can experiment with different approaches, refine your instructions, and even use AI to help craft more effective AI prompts.

Inline transformations also work with Zed's multiple cursor feature, allowing you to apply the same transformation across multiple selections simultaneously.

What's Next for Zed AI

We're continuously working to expand Zed AI's capabilities. Here's a glimpse of what we're developing:

Workflows for Complex Transformations

You've seen how inline transformations can pull context from the assistant panel and even transform the panel's content itself. With the /workflow command, we're expanding this capability to create a two-way interaction between the assistant panel and your project files.

This feature allows you to work within the assistant panel to orchestrate changes that directly affect your codebase. When you use /workflow, it directs the model to emit a series of <step> tags that Zed interprets. These steps suggest inline transformations directly in your project files, offering a guided, AI-assisted approach to complex coding tasks.

The /workflow command effectively bridges the gap between the assistant panel and your actual code, allowing for a more integrated and powerful AI-assisted development process. While we're actively refining this feature, you can already try /workflow in Zed today. We encourage you to experiment with it across different programming languages and share your experiences. Your insights will help us expand and improve it.

Using the /workflow command.

Tools for Efficiently Crafting Contexts

We recognize that efficiently building appropriate context is a key challenge in AI-assisted development. To address this, we're developing tools that help you gather relevant information more quickly. These tools maintain the transparency and control central to Zed's philosophy, giving you powerful context-building capabilities while ensuring you understand and manage what goes into each AI interaction.

We're currently working on two key features to solve this problem:

  • /project: Currently behind a configuration flag, this command helps you quickly find and insert relevant project information into the assistant panel. It's designed to speed up context building while still allowing you to review and edit the results before they're used.

  • /auto: An upcoming feature that will automatically insert context based on your current task, much like other / commands. While it operates automatically, the inserted context remains fully visible and editable, allowing you to explore, modify, or remove any information it pulls in. This feature aims to streamline context building while maintaining your ability to control and understand the information being used.

These features are designed to give you leverage in managing complex contexts, while preserving your ability to understand and control exactly what information is being used in your AI interactions. We believe this balance of power and transparency is crucial for effective AI-assisted development.

As we continue to refine these tools, we welcome your feedback and ideas on how to further improve context management in Zed AI.

Join Us in Shaping AI-Assisted Development

Zed AI embodies our belief in open, collaborative software development. We've created a transparent, extensible environment that empowers you to harness AI on your own terms, keeping you firmly in control of your tools and workflows.

We invite you to try Zed AI and become part of this journey. Experiment with custom slash commands, fine-tune prompts, and push boundaries. Share your innovations as extensions or as contributions to the Zed repository.

With Zed AI, you're in the driver's seat, directing AI's potential within the familiar realm of text. Together, we'll build an AI-assisted development experience that amplifies your creativity and adapts to your unique coding style. We're excited to see what our community will create.


联系我们 contact @ memedata.com