CrabNote螃蟹笔记

Chat-Overview 概述

Chat-Overview 概述

Chat Overview 概述 Chat Overview 概述 Modified September 6, 2024 Overview 概述 Cursor Chat lets you ask questions or solve problems in your codebase with the most capable language models, all in your editor. Cursor Chat 允许您使用最强大的语言模型在代码库中提出问题或解决问题,所有这些都在您的编辑器中完成。 For language models to give good answers, they need to know specific things that are relevant to your codebase — context. 为了让语言模型给出好的答案,它们需要知道与你的代码库相关的特定事物 — 上下文。 Cursor has several built in features to provide context in chat, such as automatically including context across your entire codebase, searching the web, indexing documentation, and user specified references to code blocks. They are built to eliminate the tedious copy pasting otherwise necessary for working with language models on code. Cursor 具有多项内置功能,可在聊天中提供上下文,例如自动包含整个代码库中的上下文、搜索 Web、为文档编制索引以及用户指定的代码块引用。它们旨在消除在代码上使用语言模型所需的繁琐复制粘贴。 By default, Cursor Chat is in the AI pane, which is on the opposite side of your primary sidebar. You can toggle the AI pane by pressing Ctrl/⌘ + L, which focuses onto the chat when opened. To submit your query, press Enter. 默认情况下,Cursor Chat (光标聊天) 位于 AI 窗格中,该窗格位于主边栏的另一侧。您可以通过按 Ctrl/⌘ + L 来切换 AI 窗格,打开时将焦点放在聊天上。要提交查询,请按 Enter。 User and AI Messages 用户和 AI 消息 User messages contain the text you type, along with the context you’ve referenced. You can go back to any previous user messages to edit and rerun your queries. This will overwrite any messages after that and regenerate new ones. 用户消息包含您键入的文本以及您引用的上下文。您可以返回任何以前的用户消息来编辑和重新运行查询。这将覆盖此后的所有消息并重新生成新消息。 AI messages are the responses generated from the AI model you’ve picked. They are paired with the user message before them. AI messages may contain parsed code blocks which can be added to your codebase with instant apply. AI 消息是您选择的 AI 模型生成的响应。它们与前面的用户消息配对。AI 消息可能包含已解析的代码块,这些代码块可以通过即时应用添加到您的代码库中。 All user/AI messages together in the same thread are called a chat thread, and each chat thread is saved in your chat history. 同一线程中的所有用户/AI 消息称为聊天线程,每个聊天线程都保存在您的聊天历史记录中。 Chat History 聊天记录 By pressing on the “Previous Chats” button on the top right of the AI pane, or by pressing Ctrl/⌘ + Alt/Option + L, you can see the chat history. You can click on any chat thread to go back and see the messages that make up that thread, and you can also modify the title of the thread by clicking the pen icon, or delete the thread by clicking the garbage can icon upon hovering over the thread in the history. 通过按 AI 窗格右上角的“以前的聊天”按钮,或按 Ctrl/⌘ + Alt/Option + L,您可以查看聊天记录。您可以单击任何聊天线程返回并查看组成该线程的消息,还可以通过单击笔图标来修改线程的标题,或者在将鼠标悬停在历史记录中的线程上时通过单击垃圾桶图标来删除线程。 The title of a Cursor thread is just the first few words of the first user message. Cursor 线程的标题只是第一条消息的前几个单词。 Default Context 默认上下文 By default, Cursor Chat includes the current file as context. You can submit a query without including any context by pressing Alt/Option Enter on submit, or turn on Default to no context under Cursor Settings Features Chat. Chats that begin with a no context request will not add context for any messages. 默认情况下,Cursor Chat 将当前文件作为上下文。您可以通过在提交时按 Alt/Option Enter 来提交查询,而不包含任何上下文,或者在光标设置 聊天功能 下打开默认为无上下文。 以 no context 请求开头的聊天不会为任何消息添加上下文。 As you type, you can see what will be included in context in the pills below the input box. 键入时,您可以在输入框下方的胶囊中看到上下文中将包含的内容。 Adding Context 添加上下文 By default, user messages will contain the text you type, along with the context you’ve referenced. You can add more custom context to each bubble with @ symbols, and by default, the current viewing file will be used as context as well in the user message. 默认情况下,用户消息将包含您键入的文本以及您引用的上下文。您可以使用 @ 符号向每个气泡添加更多自定义上下文,默认情况下,当前查看文件也将用作用户消息中的上下文。 See the @ symbols pages for more information. 有关更多信息,请参阅 @ 符号页面。 AI Fix in Chat 聊天中的 AI 修复 A convenient feature to fix linter errors in your codebase is to use the AI fix in chat. To do this, hover over the error in the editor, and click the blue AI fix button that shows up. 修复代码库中的 Linter 错误的一个便捷功能是在聊天中使用 AI 修复。为此,请将鼠标悬停在编辑器中的错误上,然后单击显示的蓝色 AI 修复按钮。 The keyboard shortcut for this would be to do Ctrl/⌘ + Shift + E. 键盘快捷键是执行 Ctrl/⌘ + Shift + E。 Long Context Chat (Beta) 长时间聊天 (Beta 版) You can enable long context chat by going to Cursor Settings Beta Long Context Chat. With this enabled, you can toggle different chat modes through Ctrl/⌘ .. 您可以通过转到 Cursor Settings Beta Long Context Chat 来启用长上下文聊天。启用此功能后,您可以通过Ctrl/⌘切换不同的聊天模式。 Long context chat allows you to include entire folders as context, since the supported models have a larger context window. Check out more about the long context only models here. 长上下文聊天允许您将整个文件夹作为上下文包含在内,因为支持的模型具有更大的上下文窗口。在此处查看有关仅长上下文模型的更多信息。 instant apply 即时应用 @ symbols @ 符号 here 在此处 Overview 概述 Cursor Chat lets you ask questions or solve problems in your codebase with the most capable language models, all in your editor. Cursor Chat 允许您使用最强大的语言模型在代码库中提出问题或解决问题,所有这些都在您的编辑器中完成。 For language models to give good answers, they need to know specific things that are relevant to your codebase — context. 为了让语言模型给出好的答案,它们需要知道与你的代码库相关的特定事物 — 上下文。 Cursor has several built in features to provide context in chat, such as automatically including context across your entire codebase, searching the web, indexing documentation, and user specified references to code blocks. They are built to eliminate the tedious copy pasting otherwise necessary for working with language models on code. Cursor 具有多项内置功能,可在聊天中提供上下文,例如自动包含整个代码库中的上下文、搜索 Web、为文档编制索引以及用户指定的代码块引用。它们旨在消除在代码上使用语言模型所需的繁琐复制粘贴。 By default, Cursor Chat is in the AI pane, which is on the opposite side of your primary sidebar. You can toggle the AI pane by pressing Ctrl/⌘ + L, which focuses onto the chat when opened. To submit your query, press Enter. 默认情况下,Cursor Chat (光标聊天) 位于 AI 窗格中,该窗格位于主边栏的另一侧。您可以通过按 Ctrl/⌘ + L 来切换 AI 窗格,打开时将焦点放在聊天上。要提交查询,请按 Enter。 User and AI Messages 用户和 AI 消息 User messages contain the text you type, along with the context you’ve referenced. You can go back to any previous user messages to edit and rerun your queries. This will overwrite any messages after that and regenerate new ones. 用户消息包含您键入的文本以及您引用的上下文。您可以返回任何以前的用户消息来编辑和重新运行查询。这将覆盖此后的所有消息并重新生成新消息。 AI messages are the responses generated from the AI model you’ve picked. They are paired with the user message before them. AI messages may contain parsed code blocks which can be added to your codebase with instant apply. AI 消息是您选择的 AI 模型生成的响应。它们与前面的用户消息配对。AI 消息可能包含已解析的代码块,这些代码块可以通过即时应用添加到您的代码库中。 instant apply 即时应用 All user/AI messages together in the same thread are called a chat thread, and each chat thread is saved in your chat history. 同一线程中的所有用户/AI 消息称为聊天线程,每个聊天线程都保存在您的聊天历史记录中。 Chat History 聊天记录 By pressing on the “Previous Chats” button on the top right of the AI pane, or by pressing Ctrl/⌘ + Alt/Option + L, you can see the chat history. You can click on any chat thread to go back and see the messages that make up that thread, and you can also modify the title of the thread by clicking the pen icon, or delete the thread by clicking the garbage can icon upon hovering over the thread in the history. 通过按 AI 窗格右上角的“以前的聊天”按钮,或按 Ctrl/⌘ + Alt/Option + L,您可以查看聊天记录。您可以单击任何聊天线程返回并查看组成该线程的消息,还可以通过单击笔图标来修改线程的标题,或者在将鼠标悬停在历史记录中的线程上时通过单击垃圾桶图标来删除线程。 The title of a Cursor thread is just the first few words of the first user message. Cursor 线程的标题只是第一条消息的前几个单词。 Default Context 默认上下文 By default, Cursor Chat includes the current file as context. You can submit a query without including any context by pressing Alt/Option Enter on submit, or turn on Default to no context under Cursor Settings Features Chat. Chats that begin with a no context request will not add context for any messages. 默认情况下,Cursor Chat 将当前文件作为上下文。您可以通过在提交时按 Alt/Option Enter 来提交查询,而不包含任何上下文,或者在光标设置 聊天功能 下打开默认为无上下文。 以 no context 请求开头的聊天不会为任何消息添加上下文。 As you type, you can see what will be included in context in the pills below the input box. 键入时,您可以在输入框下方的胶囊中看到上下文中将包含的内容。 Adding Context 添加上下文 By default, user messages will contain the text you type, along with the context you’ve referenced. You can add more custom context to each bubble with @ symbols, and by default, the current viewing file will be used as context as well in the user message. 默认情况下,用户消息将包含您键入的文本以及您引用的上下文。您可以使用 @ 符号向每个气泡添加更多自定义上下文,默认情况下,当前查看文件也将用作用户消息中的上下文。 See the @ symbols pages for more information. 有关更多信息,请参阅 @ 符号页面。 @ symbols @ 符号 AI Fix in Chat 聊天中的 AI 修复 A convenient feature to fix linter errors in your codebase is to use the AI fix in chat. To do this, hover over the error in the editor, and click the blue AI fix button that shows up. 修复代码库中的 Linter 错误的一个便捷功能是在聊天中使用 AI 修复。为此,请将鼠标悬停在编辑器中的错误上,然后单击显示的蓝色 AI 修复按钮。 The keyboard shortcut for this would be to do Ctrl/⌘ + Shift + E. 键盘快捷键是执行 Ctrl/⌘ + Shift + E。 Long Context Chat (Beta) 长时间聊天 (Beta 版) You can enable long context chat by going to Cursor Settings Beta Long Context Chat. With this enabled, you can toggle different chat modes through Ctrl/⌘ .. 您可以通过转到 Cursor Settings Beta Long Context Chat 来启用长上下文聊天。启用此功能后,您可以通过Ctrl/⌘切换不同的聊天模式。 Long context chat allows you to include entire folders as context, since the supported models have a larger context window. Check out more about the long context only models here. 长上下文聊天允许您将整个文件夹作为上下文包含在内,因为支持的模型具有更大的上下文窗口。在此处查看有关仅长上下文模型的更多信息。 here 在此处