Test driving "Gemini Code Assist"

in technology •  10 hours ago  (edited)

Today, I saw the article, Google’s free Gemini Code Assist arrives with sky-high usage limits.

The article goes on to say,

At launch, Gemini Code Assist pricing started at $45 per month per user. Now, it costs nothing for individual developers, and the limits on the free tier are generous. Google says the product offers 180,000 code completions per month, which it claims is enough that even prolific professional developers won't run out. This is in stark contrast to Microsoft's GitHub Copilot, which offers similar features with a limit of just 2,000 code completions and 50 Copilot chat messages per month. Google did the math to point out Gemini Code Assist offers 90 times the completions of Copilot.

And, it includes this YouTube embed:


So, I didn't bother reading the rest of the article, but I had to try it out.

First I downloaded and installed the plugin into vscode from here.

Next, I deactivated the Copilot and ChatGPT - EasyCode plugins.

After that, I restarted vscode to remove any confusing remnants of Copilot or EasyCode.

Finally, I opened my Steem Conversation Accelerator repo, opened one of its files in an editor tab, and fired up Gemini Code Assist.

Here's my first interaction:

Me:

What does this repo do?

Gemini Code Assist:

Okay, let's break down what this JavaScript code repository does. Based on the files you've provided, it appears to be a Chrome extension designed to enhance the user experience on a Steem-based social media platform (like Hive, which is a fork of Steem). The extension, called "Steem Conversation Accelerator" (SCA), focuses on tracking and highlighting new activity from accounts that a user follows.

Here's a summary of its key functionalities:

Core Purpose:

  • Activity Tracking: Monitors the Steem blockchain for new posts, comments, and replies from accounts the user follows.
  • Conversation Highlighting: Highlights new activity within conversations, making it easier for users to stay updated.
  • Tag-Based Filtering: Allows users to filter and view comments based on specific tags.
  • Notification System: Notifies users of new activity.
  • Storage and Retrieval: Stores user data, preferences, and activity history in the browser's local storage.

Key Components and Their Roles:

  1. background.js (The Brains):

    • Event Handling:
      • onInstalled: Handles the extension's installation and update processes, clearing storage, and setting up initial configurations.
      • onChanged: Listens for changes in local storage (like username or polling interval) and resets alarms accordingly.
      • onIdle/onStateChanged: Manages browser idle states to pause/resume activity checking, conserving resources.
      • onAlarm: Executes scheduled tasks (like checking for new activity).
      • onNotificationClicked: Handles user clicks on notifications.
      • onStartup: sets up alarms when the browser starts.
    • Polling Logic (checkForNewActivitySinceLastNotification):
      • The main function for periodically checking the blockchain for new activity.
      • Uses commentFetcher.js and functions from other files to find new posts, comments, and replies.
      • Tracks the last time activity was checked for each followed account.
      • Uses getActivityTimeWithRetry to robustly fetch activity data.
      • Manages locks to prevent multiple checks from running simultaneously.
    • Alarm Management: Sets up, clears, and shows alarms to trigger activity checks at set intervals.
    • Storage Management: Interacts with Chrome storage to save and retrieve user data, activity history, and settings.
    • API Interaction: Uses steemHelpers.js and contentFetcher.js to interact with the Steem blockchain through API nodes.
  2. commentFetcher.js (The Data Miner):

    • Fetching Comments:
      • fetchComments: Retrieves recent comments from the Steem blockchain using the database_api.list_comments method.
      • Iterates through comments, tracks the latest comment processed, and handles pagination (fetching in batches).
      • Excludes old comments or comments it has already seen.
      • Uses ContentFetcher to get post and category tags.
    • Filtering Comments (filterCommentsByTag):
      • Filters comments based on a user-defined list of tags.
    • Metrics Collection: Gathers statistics like the distribution of comment depths and the number of unique authors.
    • Storage Management: Saves fetched and filtered comments to the browser's local storage.
    • comment logging: logs the comments to taggedCommentsBuffer, for later saving.
    • comment saving: saves the comments to local storage, with a lock.
  3. contentFetcher.js (The Steem Helper):

    • Fetching Content:
      • getContent: Fetches data about a specific post or comment from the Steem blockchain using the database_api.find_content method.
      • Provides information like author, permlink, body, metadata, etc.
    • Tag Extraction (getTags): Extracts tags from a post's metadata.
    • not shown other calls to the API, and other helper functions.
  4. activityList.js (The User Interface):

    • Displaying Activity:
      • Fetches the list of accounts with new activity from local storage.
      • Dynamically generates HTML to display posts, comments, and replies from those accounts.
      • Formats dates and times.
      • Creates clickable links to Steem content.
    • Filtering: removes ignored accounts, based on the 'ignore' list.
    • Content Processing (processAllItems, processItems, createContentItem):
      • Handles the formatting and display of individual posts, comments, and replies.
      • Retrieves and displays thread information (root post details).
      • Extracts snippets of content.
      • Manages "details" and "summary" HTML elements to allow collapsing/expanding content.
    • Tagged Comments Display: displays the tagged comments that have been fetched, filtered, and saved.
    • Tag-lock handling: manages a tag lock so that only one of background or activity list can be managing the tag comments.
  5. commonUtils.js (Helper Utilities):

    • Locking: Contains the acquireLock and releaseLock functions, ensuring that critical operations (like checking for new activity) don't conflict with each other.
    • Other Utilities: Likely contains other helper functions used throughout the extension.
  6. localStorageUtils.js

    • Storage management: many helper functions for reading and writing to local storage.
    • Lock management: acquire and release locks, to prevent multiple parts of the code from writing to storage at the same time.
  7. steemHelpers.js

    • API communication: helper functions to communicate with the API.
    • Following list: get the list of people a user is following.
    • Activity Times: get the most recent activity time.

Workflow:

  1. Initialization: The extension is installed or the browser is started.
  2. User Setup: The user enters their Steem username and sets preferences in the extension's popup.
  3. Alarm Set: Alarms are scheduled to trigger checkForNewActivitySinceLastNotification at set intervals.
  4. Activity Check:
    • checkForNewActivitySinceLastNotification gets the list of followed accounts.
    • It iterates through each followed account, getting their last activity time.
    • It uses commentFetcher to get new comments and ContentFetcher to check posts.
    • If comments contain a tag that is being watched, it's recorded.
    • New activity is added to an array (accountsWithNewActivity).
    • If new activity is found, a notification is shown.
  5. Notification: If new activity is detected, the user gets a notification.
  6. Activity List: When the user clicks the notification, activityList.js generates an HTML page to display the new activity.
  7. Comment Fetcher commentFetcher periodically collects comments, filters for tags, and then, stores the matching comments.
  8. Comment Display: the comments are displayed in the activity list.
  9. Locks: Locks are placed on both tagged comments and the account activity list, so that these can be processed one at a time.

In Essence:

This Chrome extension is a sophisticated tool for Steem/Hive users to stay on top of the conversations and content being created by the people they follow. It effectively turns a decentralized blockchain platform into a more user-friendly experience by providing personalized activity tracking and notifications. It filters content based on tags, and manages time and locks, to reduce the chance of data loss or corruption.

(For the record, the "Hive" parts are wrong. I'm sure it could be adapted for Hive, but it won't run there, as written.)

Key takeaway: It called my code, "sophisticated"😁😁. I'm not sure I'd agree with that, but you should believe the LLM😉.

I really hate to put more eggs in the Google basket, but on first impression, I'd give it 5 stars: ⭐⭐⭐⭐⭐. I don't plan to turn EasyCode or Copilot back on until I've given Gemini Code Assist some more exercise. Steem developers might want to give this a try - especially since they claim to have very generous free-tier usage limits.


Thank you for your time and attention.

As a general rule, I up-vote comments that demonstrate "proof of reading".




Steve Palmer is an IT professional with three decades of professional experience in data communications and information systems. He holds a bachelor's degree in mathematics, a master's degree in computer science, and a master's degree in information systems and technology management. He has been awarded 3 US patents.


image.png

Pixabay license, source

Reminder


Visit the /promoted page and #burnsteem25 to support the inflation-fighters who are helping to enable decentralized regulation of Steem token supply growth.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Your post is manually rewarded by the
World of Xpilar Community Curation Trail

BottoSTEEM OPERATED AND MAINTAINED BY XPILAR TEAM

BottoSteem
Robust Automations on STEEM Blockchain using the Power of AI

https://steemit.com/~witnesses vote xpilar.witness

"Become successful with @wox-helpfund!"
If you want to know more click on the link
https://steemit.com/@wox-helpfund ❤️

Thank you, @adeljose.