{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":634,"path":"api-reference/scripts/exploring-now-assist-code.md","title":"Exploring ServiceNow Otto for Code","bundle":null,"doc_type":null,"release":"australia","body":"\n# Exploring ServiceNow Otto for Code\n\nServiceNow® ServiceNow Otto for Code is a generative AI-powered tool designed to help developers create, edit, and summarize code.\n\nServiceNow Otto for Code is designed to empower developers with code suggestions. By using natural language prompts in the script editor on the ServiceNow AI Platform®, you will receive context-aware code suggestions that enhance your coding experience.\n\nServiceNow Otto for Code supports Now LLM Service, Azure OpenAI, Google Gemini and AWS Anthropic model providers. This capability is a part of Creator Pro Plus offering and includes the following skills:\n\n-   Code generation\n-   Code autocomplete\n-   Code editing\n-   Code explain and summarize\n\n## Code generation overview\n\nThe Code generation skill creates new code at the cursor location based on user input, without altering the surrounding code. It considers the context provided by the code preceding and following it.\n\nWhen code generation is enabled on an instance, Otto \\(\\[Omitted image \"soc-otto-icon.png\"\\] Alt text: Otto icon appears in script editor\\) appears in the script editor.\n\nAfter you describe the code you want to generate, you will receive code suggestions in the JavaScript editor on forms in the ServiceNow AI Platform® and in Script steps within Workflow Studio. Developers, regardless of their scripting experience on the ServiceNow AI Platform®, can benefit from code generation, allowing them to start writing custom code or refine existing code more efficiently.\n\n**Note:** Developers must be assigned the now.assist.creator role to use code generation. For more information on using this skill, see [Generate code with AI-powered code generation](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/generate-scripts-from-text.md).\n\n## Code autocomplete overview\n\nThe Code autocomplete skill provides contextually relevant suggestions as users type in the script editor. These suggestions appear in grey text and will only be added to the script once the user accepts them.\n\nFor more information, see [Generate code with autocomplete](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/generate-code-with-autocomplete.md).\n\nWith the Australia release, Code autocomplete is available in the ServiceNow integrated development environment \\(IDE\\) application.\n\n## Difference between Code generation and Code autocomplete skills\n\nThe Code generation skill requires a specific prompt from the user to create code that aligns precisely with the given requirements or instructions. The Code autocomplete skill works automatically. It generates code completions or snippets based on the context around it.\n\nThis means the first skill relies on direct user input, while the second skill anticipates what the user might need, offering suggestions and completions without needing detailed prompts.\n\n## Code edit overview\n\nThe Code Edit skill modifies the selected code while reviewing the surrounding code. It functions only when the code to be edited is highlighted.\n\nFor more information, see [https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/edit-code-now-assist.md](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/edit-code-now-assist.md).\n\n## Code explain and summarize overview\n\nThe Code explain and summarize skill provides a summary of the code and a comprehensive explanation of its functionality.\n\nFor more information, see [Explain and summarize code](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/explain-and-summarize-code-with-quick-actions.md).\n\n## ServiceNow Otto for Code benefits\n\n|Benefit|Feature|Users|\n|-------|-------|-----|\n|Generate code based on your prompts to improve quality and reduce repetitive tasks.|[Generate code with AI-powered code generation](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/generate-scripts-from-text.md)|Developers|\n|Quickly edit and refactor large code segments.|[https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/edit-code-now-assist.md](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/edit-code-now-assist.md)|Developers|\n|Add comments to code segments.|[Add comments to code](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/add-comments-to-code-with-quick-actions.md)|Developers|\n|Understand code.|[Explain and summarize code](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/explain-and-summarize-code-with-quick-actions.md)|Developers|\n|Identify code generated by AI.|[Tracking AI-generated code](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/scripts/tracking-ai-generated-code.md)|Developers, administrators|\n\n"}}