{"id":514066,"date":"2024-10-02T07:19:38","date_gmt":"2024-10-02T06:19:38","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=pycharm&#038;p=514066"},"modified":"2024-10-15T19:46:20","modified_gmt":"2024-10-15T18:46:20","slug":"prompt-ai-directly-in-the-editor","status":"publish","type":"pycharm","link":"https:\/\/blog.jetbrains.com\/en\/pycharm\/2024\/10\/prompt-ai-directly-in-the-editor","title":{"rendered":"Prompt AI Directly in the Editor"},"content":{"rendered":"\n<p>With PyCharm, you now have the support of AI Assistant at your fingertips. You can interact with it right where you do most of your work \u2013 in the editor.&nbsp;<\/p>\n\n\n\n<p>Stuck with an error in your code? Need to add documentation or tests? Just <strong>start typing your request on a new line in the editor<\/strong>, just as if you were typing in the <em>AI Assistant<\/em> chat<em> <\/em>window. PyCharm will automatically recognize your natural language request and generate a response.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"602\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/10\/login-python-1.gif\" alt=\"\" class=\"wp-image-516233\"\/><\/figure>\n\n\n\n<p>PyCharm leaves a purple mark in the gutter next to lines changed by AI Assistant so you can easily see what has been updated.&nbsp;<\/p>\n\n\n\n<p>If you don\u2019t like the initial suggestion, you can generate a new one by pressing <code>Tab<\/code>. You can also adjust the initial input by clicking on the purple block in the gutter or simply pressing <code>Ctrl+\/<\/code> or <code><em>\u2318<\/em>\/<\/code>.<\/p>\n\n\n\n<p>Want to get assistance with a specific argument? You can <strong>narrow the context<\/strong> that AI Assistant uses for its response as much as you want. Just put the caret in the relevant context, type the <code>$<\/code> or <code>?<\/code> symbol, and start writing. PyCharm will recognize your prompt and take the current context into account for its suggestions.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/10\/django_context_example.mov\"><\/video><\/figure>\n\n\n\n<p>The new inline AI assistance works for Python, JavaScript, TypeScript, JSON, and YAML file formats, while the option to narrow the context works only for Python so far.<\/p>\n\n\n\n<p><em>This feature is available to all AI Assistant subscribers in the second PyCharm 2024.3 EAP build.&nbsp;You can <strong>get a free trial version of AI Assistant<\/strong> straight in the IDE: to enable AI Assistant, open a project in PyCharm, click the AI icon on the right-hand toolbar, and follow the instructions that appear. <\/em><\/p>\n\n\n\n<p><p align=\"center\"><a class=\"jb-download-button\" href=\"https:\/\/www.jetbrains.com\/pycharm\/nextversion\/\" target=\"_blank\" rel=\"noopener\">Download PyCharm 2024.3 EAP<\/a><\/p>\n","protected":false},"author":1208,"featured_media":516268,"comment_status":"closed","ping_status":"closed","template":"","categories":[8526],"tags":[600],"cross-post-tag":[8396],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/pycharm\/514066"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/pycharm"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/types\/pycharm"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/users\/1208"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/comments?post=514066"}],"version-history":[{"count":6,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/pycharm\/514066\/revisions"}],"predecessor-version":[{"id":516280,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/pycharm\/514066\/revisions\/516280"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/media\/516268"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/media?parent=514066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/categories?post=514066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/tags?post=514066"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/cross-post-tag?post=514066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}