The Landscape of AI-Assisted Coding
Class Notebook: https://docs.google.com/document/d/1i_GltAIlFEeWTM-6CmWGNoVh22dOGsPvCoynfSd5Bd8/edit?usp=sharing
Google AI Studio
Google AI Studio is a platform that allows users to experiment with AI tools and models. It provides a user-friendly interface for users to explore and test different AI tools and models.
Important terms in LLMs
Let’s got to “Create Prompt” on the left sidebar. You will find the following terms on the right sidebar:
- Model: The type of model used for the prompt, e.g., “Gemini 2.0 Flash Experiment”, “Gemini 1.5 Pro”, etc.
- Token: The unit of text that is used by the model, e.g., “word”, “character”, etc.
- Temperature: The level of randomness in the output, e.g., “0.7”, “1.0”, etc.
We will explore more in the future:
- Structured output: The output is structured and has a specific format, e.g., “JSON”.
- Function call: The model can invoke functions, e.g., “generate code”, “generate text”, etc.
System Instructions/System Prompt
The system prompt is the first prompt in the prompt list. It is used to guide the model’s behavior, e.g., “You are a helpful assistant.” In the “System Instructions” section, enter the following:
Answer all the questions with the tones and styles of Lu Xun and Oscar Wilde.
Then try asking any question and see if the responses are in the style of Lu Xun and Oscar Wilde.
API Key
An API key is a unique identifier used to authenticate requests to an API, ensuring that only authorized users can access its resources. It is typically a long string of characters that must be included in API requests to verify identity and permissions. Keeping the API key secure is crucial, as unauthorized access can lead to misuse of the API and potential security risks.
- Click “Get API Key”.
- Click “Create API Key”.
- Copy the API key and store it in a secure place.
- If you don’t need the API key anymore, you can delete it on this page.
Using Google Sheet for Bulky Data Processing
Please visit this website: https://www.kwokleongtang.net/GenAI/use-with-other-tools/google-sheet-with-llm-api/
Coding and Programming
I asked a chatbot: “What are the differences between coding and programming?”
The terms “coding” and “programming” are often used interchangeably, but they have distinct meanings: Coding refers specifically to the act of writing code in a programming language. It involves translating logic and algorithms into a syntax that a computer can understand. Coding is often seen as a subset of programming, focusing on the technical aspects of writing code. Programming encompasses a broader range of activities, including coding, but also involves problem-solving, designing algorithms, and planning the overall structure of a software application. It includes debugging, testing, and maintaining code, as well as understanding the requirements and specifications for a project. Programming is about creating a complete solution to a problem, not just writing code. In summary, coding is a part of programming, but programming involves a wider scope of activities beyond just writing code.
Intergrated Development Environment (IDE)
An IDE, or Integrated Development Environment, is a software application that provides comprehensive tools for software development. It typically includes a code editor, a debugger, and build automation tools, all integrated into a single interface to streamline the development process. IDEs enhance productivity by offering features like syntax highlighting, code completion, version control integration, and project management capabilities, making it easier for developers to write, test, and debug their code efficiently.
Did you install Visual Studio Code (VSCode)?
Let’s use the web version of VSCode: https://vscode.dev/
Major and Trending Tools in AI-Assisted Coding
There are many emerging tools in the AI-Assisted Coding space. We will cover a few of them here.
GitHub Copilot
- GitHub Copilot is an AI-powered code completion and coding assistant for GitHub.
- It has two extensions for IDEs: “GitHub Copilot” and “GitHub Copilot Chat”. You can search them in the Extensions section of VSCode.
- The GitHub Copilot extension is for code completion and inline suggestions.
- The GitHub Copilot Chat extension is for chat-based code generation.
Cursors
- Cursors is an AI-powered IDE based on VSCode.
- Cursors is a subcrption-based service, so you need to pay for it ($20/month).
Cline
- Cline is a free extension for VSCode.
- To access LLM usage, you will need API keys.
- Cline documentation provides a lot of good ideas and templates: Cline Documentation.
- We will explore Cline in our future lectures.
Replit & Project IDX
- Replit and Project IDX is are online IDEs that runs on cloud servers. You can access them from any machine with modern browsers and internet connection.
- Both Replit and Project IDX have a free tier and a paid tier.
Windsurf
Windsurf is an AI-powered IDE based on VSCode. It operates on a subscription model, costing $15 per month. However, Codeium, the creators of Windsurf, are offering us a one-month free trial. Additionally, Windsurf provides a 50% discount for students after the free trial period. The EALC Department will cover the subscription costs until the end of this semester. For the remainder of today’s class, we will set up Windsurf and arrange for the bill payment.
- Codeium: https://codeium.com/
- Windsurf Documentation: https://docs.codeium.com/