Can ChatGPT replace search engines?

ChatGPT can complete the task perfectly for some simple questions. But when I asked it to write a complete article to see if it could replace me in writing, I was sure that it could not completely replace humans.

But we can use more guidance to make AI work for us in our daily workflow, so this article will discuss how to effectively use ChatGPT. The idea is to start with simple, everyday use cases and then move on to more complex stages. Finally, let us see if ChatGPT can replace search engines and provide us with the information we need every day.

Migrate from Google to ChatGPT

Google is used to show other people similar questions, while ChatGPT is used to answer your exact questions.

Like most people, when I don't know something, I Google it. The standard workflow is to go to Google, click on the top result, and read until you feel like you've got the right answer. If you're lucky, someone has already asked you the same question and we'll be able to get the answer directly. But more often than not, we need to look at many results and stitch the answers together.

Let's ask a very simple question:

These Google search results basically answer the question: "How to delete items from a DynamoDB table." Next, we need to rewrite the search to "How to add items to a DynamoDB table." Then we need to piece together the answers ourselves to get the final result.

So what about ChatGPT?

ChatGPT provides descriptions and exact code for Python and AWS CLI. This is what we said above: Google does its best to return content similar to my question, and ChatGPT does its best to generate answers.

ChatGPT automates the top results and filters out the answers (what it thinks are the answers, of course).

For such a simple question

  • Can I get the same answer via Google? Yes.
  • Can I get answers faster through ChatGPT? No problem.
  • Can artificial intelligence replace my job? No way
  • Can AI increase my speed? Absolutely

What about a more complicated problem?

Pair Programming with ChatGPT

We need to complete the following tasks

Use Databricks to investigate data in S3. Databricks relies heavily on SQL, which means performing multiple table joins, conditions, and complex groupings.

ChatGPT is sure to answer simple questions like "how to join two tables in SQL". But you can do more with ChatGPT, you need to give it contextual information

The response is as follows:

ChatGPT can form a response based on the input provided.

As you can see, ChatGPT tailors its response based on the context provided, which is far beyond what Google can do. No search results will give the above code. So even if we have the answer, we still need to stitch together the content of multiple different articles.

ChatGPT considers the context of the entire conversation when formulating responses, so the deeper we go into a question, the more precise the answer we get:

ChatGPT remembers previous conversations, just like pair programming. Given new input, you can roll back to previous steps, or try an experimental path. But ChatGPT also makes mistakes, just like humans, so we still need to manually make the final judgment and prompt ChatGPT.

If you need to use ChatGPT to build a complex solution. You need to start simple and gradually increase the complexity.

I can now use ChatGPT to answer simple questions or build small code snippets. Can it go further?

Brainstorm with ChatGPT

A great example here is using ChatGPT to provide additional ideas for a project.

For example: How to automatically transfer program license files to a remote development environment

ChatGPT gave a solid answer explaining the process of uploading and downloading files, the AWS IAM policies required to manage AWS Secrets Manager, and more. Each section includes sample code and explanations.

Then I asked ChatGPT a more general question:

It also suggests eight more things to consider: permissions, cost, encryption, key rotation, zones, resource policies, key versioning, and initial account setup. Each article has a paragraph summarizing the topic.

Some of these questions are ones we may not have thought of, so could we use ChatGPT as a brainstorming partner?

 I am a software engineer at a software company with a public REST API.  I want to start stress-testing it, and I am evaluating several frameworks.  What are the important features I should be looking for?
 
 I am a software company that runs a SaaS product.  I need to add SSO to my product so each company can log in with its authentication platform.  I’m trying to compare tools like Auth0 and WorkOS.  What are some important features to consider?
 
 I’m a software engineer at a company building an enterprise (self-hosted) application.  In my case, the customers manage the entire product themselves without me.  I am worried about the maintenance burden of supporting my app long term.  What should I consider?

These questions above return very useful answers, which is a good example since they cannot be searched on Google.

It’s possible to use ChatGPT to brainstorm jobs that we might never see through in a lifetime.

Use ChatGPT to write complex code

ChatGPT is definitely the wrong tool when it comes to writing custom (private) repository code (so I'll use GitHub Copilot instead). But when it comes to writing integrations targeting public APIs, ChatGPT excels.

If you think about it, it makes sense. Because ChatGPT cannot access your custom code base, Copilot will scan local code.

We asked ChatGPT a public API question:

Here is the code it generates:

 import requests
 import os
 
 GITHUB_TOKEN = 'YOUR_GITHUB_TOKEN'
 ASANA_TOKEN = 'YOUR_ASANA_TOKEN'
 ASANA_PROJECT_ID = 'YOUR_ASANA_PROJECT_ID'
 GITHUB_REPOS = ["user/repo1", "user/repo2", ...]  # List your repos here
 
 HEADERS_GITHUB = {
     'Authorization': f'token {GITHUB_TOKEN}',
     'Accept': 'application/vnd.github.v3+json',
 }
 
 HEADERS_ASANA = {
     'Authorization': f'Bearer {ASANA_TOKEN}',
     'Accept': 'application/json',
     'Content-Type': 'application/json',
 }
 
 def fetch_github_issues(repo):
     url = f"https://api.github.com/repos/{repo}/issues"
     response = requests.get(url, headers=HEADERS_GITHUB)
     return response.json()
 
 def find_or_create_asana_section(project_id, name):
     # Check if section exists
     sections_url = f"https://app.asana.com/api/1.0/projects/{project_id}/sections"
     response = requests.get(sections_url, headers=HEADERS_ASANA)
     for section in response.json().get("data", []):
         if section["name"] == name:
             return section["gid"]
     
     # Create new section
     data = {
         "data": {
             "name": name,
         }
     }
     response = requests.post(sections_url, headers=HEADERS_ASANA, json=data)
     return response.json()["data"]["gid"]
 
 def create_asana_task(project_id, section_gid, issue):
     url = f"https://app.asana.com/api/1.0/tasks"
     data = {
         "data": {
             "projects": [project_id],
             "memberships": [
                 {
                     "project": project_id,
                     "section": section_gid,
                 }
             ],
             "name": issue["title"],
             "notes": issue["body"],
         }
     }
     requests.post(url, headers=HEADERS_ASANA, json=data)
 
 def main():
     for repo in GITHUB_REPOS:
         issues = fetch_github_issues(repo)
         section_name = repo.split("/")[-1]  # Assuming you want the repo name as the section name
         section_gid = find_or_create_asana_section(ASANA_PROJECT_ID, section_name)
         for issue in issues:
             create_asana_task(ASANA_PROJECT_ID, section_gid, issue)
 
 if __name__ == "__main__":
     main()

It looks very good. Let’s increase the difficulty and let ChatGPT build a small software program with the following restrictions:

I don't enter any code. Only those generated by ChatGPT can be executed. Then the errors will be corrected by ChatGPT itself.

In the beginning, ChatGPT did a great job. It's easy to write a RESTful client. I told ChatGPT it needed more debugging statements and it added print statements throughout the code. It's also nice to encapsulate function calls in other libraries.

But it occurred to me that downloading and re-uploading large files would take a long time, so I asked ChatGPT if I could visually wrap them with a progress bar on the command line. Here's what it does:

A little bloated, but it works.

When ChatGPT was asked to refactor the code and add abstractions, the answers received contained spelling errors and logical errors. Therefore, it takes a lot of time to communicate and modify with ChatGPT (as mentioned earlier, for testing, all codes are written by ChatGPT)

For this problem, the reason for blind guessing is that ChatGPT only gets limited computation time for each question. The more complicated the situation, ChatGPT cannot fully perfect its response and just throws an unmodified result, possibly due to token size restrictions.

ChatGPT is good at writing single functions, but quickly breaks down when dealing with abstractions or multiple methods.

But for ChatGPT, a very good performance is that it can help us convert codes, such as:

Translate Python code into Typescript. Convert linux shell script to windows cmd script

Summarize

ChatGPT can be used to enhance your capabilities, not replace your job

It's a cool gimmick to incorporate ChatGPT into your daily routine, and maybe it works for other people's workflows, but not mine. Because some jobs are either too complex or too specialized for external AI tools to work.

Finally, there is another problem. The ChatGPT data is updated in 2022, so there is no recent data. This is basically not helpful for industries that often require the latest data.

So back to our title: brainstorming and pairing programmers with simple code is a very good application scenario that can improve our efficiency, but it cannot replace Google. In addition to time, we value some information more. is accuracy.

https://avoid.overfit.cn/post/cb049c14e06441f98063d8d478ff1474

Author: Elliot Graebert

Guess you like

Origin blog.csdn.net/m0_46510245/article/details/133066110