ian-kent / gptchat

A GPT-4 client which gives your favourite AI a memory and tools for self-improvement

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gpt chat with Gpt4 unable to compete basic tasks

Nbtguyoriginal opened this issue · comments

As it stands Gptchat cant do go code or python and essentially just wastes tokens attempting nonsense also while i like the idea of the application and the implementation of the api key I find its important to make it simple and straight forward for adding the api key os var are imo messy and cause issues so I added
this allows fetching of api key from a .env file in the same dir as the main.go

cool concept but something about the code has changed since your video on yt as the test case fails

file named .env in the same dir as the main.go
OPENAI_API_KEY=Your key here

"""
github.com/joho/godotenv

func init() {
// Try to load the API key from the environment variable first
openaiAPIKey := strings.TrimSpace(os.Getenv("OPENAI_API_KEY"))

// If not found in the environment variable, try the .env file
if openaiAPIKey == "" {
    // Attempt to load the .env file from the current directory
    err := godotenv.Load()
    if err != nil {
        // If there's an error loading the .env file, log it
        fmt.Printf("Error loading .env file: %v\n", err)
    } else {
        // If .env file is loaded successfully, try to get the API key again
        openaiAPIKey = strings.TrimSpace(os.Getenv("OPENAI_API_KEY"))
    }
}

"""

**_The full issue conversation

"""test case failure"""_**
WARNING: You haven't configured an OpenAI API model, defaulting to GPT4
Welcome to the GPT client.

You can talk directly to GPT, or you can use /commands to interact with the client.

Use /help to see a list of available commands.

APP:

Setting up the chat environment, please wait for GPT to respond - this may take a few moments.

AI:

Sure, let's start this process.

AI:

Thank you for the guide. Let's familiarise myself further by understanding what these commands can do.

First the /memory command.

AI:

Got it, the /memory command enables storing and recalling of certain memories. This would be useful in maintaining certain contexts throughout our conversation.

Now let's explore the second command, /plugin.

AI:

Thank you for the detailed explanation. The /plugin command allows me to create new plugins written in Go programming language. The plugin consists of an ID, example, and Execute function. It's important to remember that the appropriate data types should be used while returning either a value or an error in Execute function.

Now that I'm familiar with /memory and /plugin commands, I'm ready for our conversation. What would you like to discuss?

USER:

can you add a few numbers together and multiply the output by a new number hmm maybe create a few plugins for this

**AI:

Sure, I can create two plugins for this task. One for adding numbers, and another for multiplying.

Let's start by creating our "add" plugin.

AI:

I apologize for the error. It seems that I need to remember that the input type should be float64 in Go when working with numbers. Let's correct the add plugin.

AI:

My apologies for the continued complications. It seems there was a mistake in the implementation of the plugin. In Go, don't forget that when dealing with JSON the numbers are generally treated as float64, which is why the type is not simply []int. Let's attempt to correct the add plugin again, this time being more careful with the types.**

**AI:

I sincerely apologize for the error. Let's correct the problem by making sure data type precision and compatibility are right. In Go, the input of Execute function is treated as float64 and the slice of interfaces ([]interface{}) should be properly derived from it for a correct implementation. Let's try again:

AI:

I'm sorry for the confusion earlier. Let's try to correct the add plugin.**

**AI:

I apologize for the previous errors. Let's try a simpler approach and create two separate plugins for adding and multiplying. Let's first create the "add-two-numbers" plugin, which will handle the addition of two numbers.**

**AI:

My sincere apologies for the errors. It seems I'm encountering some challenges in creating these plugins. It could be that I am misusing the Go syntax or that there are compatibility issues with the JSON data and the Go code handling it. Maybe we can try with an easier problem or another approach.**

USER:

try the same problem but with python

**AI:

I'm sorry for the misunderstanding, but I'm an AI developed by OpenAI and I currently don't support running Python code or creating plugins using Python. My functionalities are mostly based on pre-programmed commands, generating human-like text based on the input given to me, and learning from the conversation history for better responses. I'd be glad to assist you with any other information or conversation you want to have!**

USER:/exit