Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bing Search and Chat to basic training #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion M1-intro/L2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ <h2>How to Google</h2>

<blockquote>I would rather be more knowledgeable at searching in general than knowledgeable about what I am searching for. If I am more efficient at searching, I can find anything. If I am more knowledgeable about a single subject, I am only good at searching within that subject.</blockquote>

<p>This cannot be emphasized enough. Senior engineers often use search engines to find answers to their software questions. If senior devs do it, why wouldn't you?</p>
<p>This cannot be emphasized enough. Senior engineers often use search engines to find answers to their software questions. If senior devs do it, why wouldn't you?</p>

<p>Note: If you prefer to leverage Bing search or Bing Chat then scroll down to the "How to Bing and Chat" section.</p>

<p>Here are some tips for using Google effectively to find an answer to your problem. We'll then walk through an example.</p>

Expand Down Expand Up @@ -111,6 +113,57 @@ <h4>Search Operators: <code>* | - before: after:</code></h4>
<li><a href="https://www.oreilly.com/library/view/google-power-search/9781449311940/" target="_blank" rel="noopener noreferrer">Book: Google Power Search (O'Reilly)</a></li>
</ul>

<h2>How to Bing and Chat (with ChatGPT)</h2>
<p>Microsoft has enabled much of the same syntax that Google uses and then some more. In addition with the advent of ChatGPT and its inclusion in <a href="https://chat.bing.com/" target="_blank" rel="noopener noreferrer">Bing Chat.</a> Examples of <b>Bing Search</b> features include:</p>

<ul>
<li><b><code>+</code></b> Finds pages that contain all the terms preceded by the + symbol. E.g., <code>vs code +consensys +truffle</code></li>
<li><b><code>" "</code></b> Finds the exact words in a phrase. E.g., <code>"ConsenSys academy" truffle</code></li>
<li><b><code>site:</code></b> Targets the specified site for the search results. E.g., <code>site:consensys.net ganache</code></li>
<li><b><code>( )</code></b> includes the contained words in the results. Note: inserting a – symbol before the brackets will exclude the grouped words from the search. E.g., <code>site:consensys.net ganache -(product suite)</code></li>
<li><b><code>AND</code></b> / <b><code>OR</code></b> Using AND will return results that contain all the words (default search behavior) whereas OR will return results that contain either of the words specified. NOTE: AND / OR need to be capitalized. E.g., <code>site:consensys.net ganache AND zkevm</code></li>
<li><b><code>contains:</code></b> Results contain sites that have links to the specified file types. E.g., <code>zkevm contains:xlsx</code></li>
<li><b><code>ext:</code></b> Results contain only sites with links to the specified extension. E.g., <code>zkevm ext:pdf</code></li>
<li><b><code>filetype:</code></b> Results contain only pages with the specified file type. E.g., <code>zkevm filetype:pdf</code></li>
<li><b><code>inanchor:</code></b>, <b><code>inbody:</code></b>, <b><code>intitle:</code></b> Results contain sites where the meta data is filled with the specified terms. E.g., <code>zkevm inbody:EVM</code></li>
<li><b><code>language:</code></b> Results contain only sites in the specified language (<a href="http://help.bing.microsoft.com/#apex/18/en-US/10004/-1" target="_blank" rel="noopener noreferrer">Language code</a>)</li>
<li><b><code>loc:</code></b>, <b><code>location:</code></b> Results contain only sites from a specific region (<a href="http://help.bing.microsoft.com/#apex/18/en-US/10004/-1" target="_blank" rel="noopener noreferrer">Country / Region Code</a>)</li>
<li><b><code>prefer:</code></b> Results are focused on the emphasized search term. E.g., <code>zkevm prefer:polygon</code></li>
<li><b><code>feed:</code></b>Returns RSS or Atom feeds on the search term. <b><code>hasfeed:</code></b> returns sites that contain an RSS or Atom feed specified. E.g., <code>site:consensys.net hasfeed:zkevm</code></li>
</ul>

<p>For more information on Bing Search, check out the <a href="https://docs.microsoft.com/en-us/bing/search-operators" target="_blank" rel="noopener noreferrer">Bing Search Operators</a> documentation. (PS: This HTML response code was auto-generated by <a href="https://github.com/features/copilot" target="_blank" rel="noopener noreferrer">GitHub Co-Pilot</a> based on the previous section. This is another tool to help a developer with respect to speed and quality.)</p>

To leverage <b>Bing Chat</b> to investigate / research issues and starting points use the URL <a href="https://chat.bing.com/" target="_blank" rel="noopener noreferrer">https://chat.bing.com/</a>.

<p>Bing Chat is so much more than just a search tool. LEarning to leverage its power can greatly increase your ability to deliver quality code quickly. Take this example of the networking error described in the following section.</p>

<p>Using the prompt: <code>I want you to be a solidity smart contract programmer. I am getting the following Truffle error "Something went wrong while attempting to connect to the network. Check your network configuration. Could not connect to your Ethereum client with the following parameters: - host > 127.0.0.1, - port > undefined, - network_id > *". What is the reason for the bug?</code></p>

<p>Chat returns 3 areas to review with 4 links to the sites that provided some of the details. Click through to read the repsonses in more detail.</p>

<div class="img-wrapper">
<img src="../../img/bing-chat-contract-1.png" alt="screenshot of google search with range operator">
</div>

<p>One of the suggestions was to check if my Ethereum client was running. Simply clicking it gives me the next auto-generated response.</p>

<div class="img-wrapper">
<img src="../../img/bing-chat-contract-2.png" alt="screenshot of google search with range operator">
</div>

<p></p>This makes it really simple to hone in on the issue and navigate to the detail to show how to resolve your issues. In time, and with a great prompt, you can get it to auto-generate the code to fix the issue (if it's a bug.) You can also leverage it to check for security vulnerabilities in your smart contract .SOL file.</p>

<p>Here are a few other links to refer to with regard to ChatGPT:</p>

<ul>
<li><a href="https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/chatgpt?pivots=programming-language-chat-completions" target="_blank" rel="noopener noreferrer">Learn how to work with the ChatGPT and GPT-4 models</a></li>
<li><a href="https://medium.com/geekculture/the-one-prompt-to-generate-them-all-the-ultimate-chatgpt-tool-for-developers-say-goodbye-to-ba699936062e" target="_blank" rel="noopener noreferrer">The One Prompt to Generate Them All</a> - The Ultimate ChatGPT Tool for Developers, Say Goodbye to Language Barriers.</li>
<li><a href="https://www.datacamp.com/cheat-sheet/chatgpt-cheat-sheet-data-science" target="_blank" rel="noopener noreferrer">ChatGPT Cheat Sheet for Data Science</a></li>
</ul>

<hr>

<p>Now that you've learned some basic search techniques, let's walk through the thought process when trying to solve a programming error message on our own.</p>

<h3>The error message is your friend</h3>
Expand Down
Binary file added img/bing-chat-contract-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/bing-chat-contract-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.