dex3r / GPT-Codemaster

Automatic programming by creating Pull Requests from Issues using LLMs
GNU General Public License v3.0
55 stars 5 forks source link

Change namespace AiProgrammer.Logging to AiProgrammer.Loggingv1 #1

Closed dex3r closed 1 year ago

github-actions[bot] commented 1 year ago

Hello, GPT-Codemaster here. I'm starting to work on the issue, give me a moment...

Job progress

github-actions[bot] commented 1 year ago

Sending request to the AI using Chat interface

System message:

You are an AI system that does programming tasks by reading the issue specification and modifying the existing code by changing it or adding new code to resolve the user request. You minimize changes to the code and make sure not to modify anything that the user has not requested. Do not remove classes, methods, or fields - only add or modify existing ones. You will be doing the work in steps. The results of your work will be automatically put on Github. Always print the whole source, never the 'The rest of the class remains unchanged' comment

User Request:

The user request: Change namespace AiProgrammer.Logging to AiProgrammer.Loggingv1


Do this in steps:

  1. From a list of files select ones that will be needed to see or modify to program the user request. You will be shown content of those files. You have a limited memory so you will only see the selected ones.
  2. Modify selected existing files one by one
  3. Create needed new files one by one

Here is a hierarchical view of files in the project::

GithubIssueListener/IInputProvider.cs GithubIssueListener/ListenerEntryPoint.cs GithubIssueListener/SolverExceptionNotifier.cs GithubIssueListener/ISolverExceptionNotifier.cs GithubIssueListener/IssueSolvingStarter.cs GithubIssueListener/InputProviderFromEnvironmentVariables.cs GithubIssueListener/GithubIssueListener.csproj GithubIssueListener/IssueListenerInput.cs AiProgrammerTests/AiProgrammerTests.csproj AiProgrammerTests/DependenciesTest.cs AiProgrammerTests/ChatMessageRoleTests.cs AiProgrammerTests/StringExtensionsSubstringSafeTests.cs AiProgrammerTests/ClassExtractorTests.cs AiProgrammer/Logging/ISolverProgressLogger.cs AiProgrammer/Logging/SolverProgressLoggerInIssue.cs AiProgrammer/Solving/Utils/UnexpectedAiOutputException.cs AiProgrammer/Solving/GithubIssue/IGithubIssueSolver.cs AiProgrammer/Solving/GithubIssue/GithubIssueSolverWithMethodSelection.cs AiProgrammer/Solving/GithubIssue/InIssueNoChangesNotifier.cs AiProgrammer/Solving/GithubIssue/GithubIssueSolverFileByFile.cs AiProgrammer/Solving/GithubIssue/IIssueDescriptionProvider.cs AiProgrammer/Solving/GithubIssue/GithubIssueContextProvider.cs AiProgrammer/Solving/GithubIssue/IGithubIssueContextProvider.cs AiProgrammer/Solving/GithubIssue/IssueDescriptionProvider.cs AiProgrammer/Solving/Steps/Helpers/CurrentStepsHolder.cs AiProgrammer/Solving/Steps/Helpers/FollowNextStepExecutor.cs AiProgrammer/Solving/Steps/Helpers/ICurrentStepsHolder.cs AiProgrammer/Solving/Steps/EntrySteps/StepSolveGithubIssueWithMethodSelection.cs AiProgrammer/Solving/Steps/EntrySteps/StepSolveGithubIssueFileByFile.cs AiProgrammer/Solving/Steps/ConcreteSteps/StepNotifyAboutPullRequest.cs AiProgrammer/Solving/Steps/ConcreteSteps/StepModifyExistingFilesOneByOne.cs AiProgrammer/Solving/Steps/ConcreteSteps/StepChangeFilesUsingCommands.cs AiProgrammer/Solving/Steps/ConcreteSteps/StepCreateChangesCommands.cs AiProgrammer/Solving/Steps/ConcreteSteps/StepCreatePullRequest.cs AiProgrammer/Solving/Steps/ConcreteSteps/StepSelectMethodsToPreview.cs AiProgrammer/Solving/Steps/ConcreteSteps/StepCreateNewFilesOneByOne.cs AiProgrammer/Solving/Steps/ConcreteSteps/StepSelectFilesToPreview.cs AiProgrammer/Solving/Steps/ISolverStep.cs AiProgrammer/Solving/Steps/IStepsCollection.cs AiProgrammer/Solving/Steps/ISolverStepWithSubsteps.cs AiProgrammer/Solving/Model/FileAndMethodName.cs AiProgrammer/Solving/Model/GithubIssueContext.cs AiProgrammer/Solving/Commands/IModifyCodebaseCommand.cs AiProgrammer/Github/Issues/IIssueUrlParser.cs AiProgrammer/Github/Issues/IssueUrlParser.cs AiProgrammer/Github/Model/IssueInfo.cs AiProgrammer/Github/Model/RepoInfo.cs AiProgrammer/Github/Model/RepoName.cs AiProgrammer/Github/Model/RepoOwner.cs AiProgrammer/Github/PullRequests/PullRequestCreator.cs AiProgrammer/Github/GithubServices.cs AiProgrammer/Github/GithubClientProviderForToken.cs AiProgrammer/Github/GithubContextClientProvider.cs AiProgrammer/Github/IGithubClientProviderForToken.cs AiProgrammer/Github/IGithubContextClientProvider.cs AiProgrammer/Core/CodeStatics.cs AiProgrammer/CodeProcessing/IClassExtractor.cs AiProgrammer/CodeProcessing/ClassExtractorCSharp.cs AiProgrammer/Extensions/StringExtensions.cs AiProgrammer/IO/FileContent.cs AiProgrammer/IO/ProjectContentReader.cs AiProgrammer/IO/IProjectContentReader.cs AiProgrammer/IO/FilePath.cs AiProgrammer/AiInterface/ChatCompletions.cs AiProgrammer/AiInterface/IChat.cs AiProgrammer/AiInterface/ICompletions.cs AiProgrammer/AiProgrammer.csproj.DotSettings AiProgrammer/AiProgrammerServices.cs AiProgrammer/AiProgrammer.csproj LICENSE global.json .gitignore AiProgrammer.sln Readme.md AiProgrammer.sln.DotSettings


You are currently in step one (1). Please provide a list of files you think will help you the most when solving the problem. List them from most likely to help solve to problem to least likely. Print each path in new line without numerating them. Make sure to always print a full path. n

github-actions[bot] commented 1 year ago

AI Response

AiProgrammer/Logging/ISolverProgressLogger.cs AiProgrammer/Logging/SolverProgressLoggerInIssue.cs

github-actions[bot] commented 1 year ago

Sending request to the AI using Chat interface

System message:

You are an AI system that does programming tasks by reading the issue specification and modifying the existing code by changing it or adding new code to resolve the user request. You minimize changes to the code and make sure not to modify anything that the user has not requested. Do not remove classes, methods, or fields - only add or modify existing ones. You will be doing the work in steps. The results of your work will be automatically put on Github. Always print the whole source, never the 'The rest of the class remains unchanged' comment

User Request:

The user request: Change namespace AiProgrammer.Logging to AiProgrammer.Loggingv1


Do this in steps:

  1. From a list of files select ones that will be needed to see or modify to program the user request. You will be shown content of those files. You have a limited memory so you will only see the selected ones.
  2. Modify selected existing files one by one
  3. Create needed new files one by one

You are currently in step 'Modify selected existing files one by one'

Already reviewed files with your own description of what happened:

Files left to review: AiProgrammer/Logging/SolverProgressLoggerInIssue.cs

Current file path: AiProgrammer/Logging/ISolverProgressLogger.cs

Current file content:

using AiProgrammer.Solving;
using OpenAI_API.Chat;

namespace AiProgrammer.Logging;

public interface ISolverProgressLogger
{
    Task LogChatRequest(Conversation conversation);
    Task LogChatResponse(string response);
}

Select one command with this parameters to execute:

n

github-actions[bot] commented 1 year ago

AI Response

replace_file

using AiProgrammer.Solving;
using OpenAI_API.Chat;

namespace AiProgrammer.Loggingv1;

public interface ISolverProgressLogger
{
    Task LogChatRequest(Conversation conversation);
    Task LogChatResponse(string response);
}

Changed namespace AiProgrammer.Logging to AiProgrammer.Loggingv1

github-actions[bot] commented 1 year ago

Sending request to the AI using Chat interface

System message:

You are an AI system that does programming tasks by reading the issue specification and modifying the existing code by changing it or adding new code to resolve the user request. You minimize changes to the code and make sure not to modify anything that the user has not requested. Do not remove classes, methods, or fields - only add or modify existing ones. You will be doing the work in steps. The results of your work will be automatically put on Github. Always print the whole source, never the 'The rest of the class remains unchanged' comment

User Request:

The user request: Change namespace AiProgrammer.Logging to AiProgrammer.Loggingv1


Do this in steps:

  1. From a list of files select ones that will be needed to see or modify to program the user request. You will be shown content of those files. You have a limited memory so you will only see the selected ones.
  2. Modify selected existing files one by one
  3. Create needed new files one by one

You are currently in step 'Modify selected existing files one by one'

Already reviewed files with your own description of what happened: AiProgrammer/Logging/ISolverProgressLogger.cs - modified - Changed namespace AiProgrammer.Logging to AiProgrammer.Loggingv1

Files left to review:

Current file path: AiProgrammer/Logging/SolverProgressLoggerInIssue.cs

Current file content:

using AiProgrammer.Github;
using AiProgrammer.Solving;
using AiProgrammer.Solving.GithubIssue;
using AiProgrammer.Solving.Model;
using OpenAI_API.Chat;

namespace AiProgrammer.Logging;

public class SolverProgressLoggerInIssue : ISolverProgressLogger
{
    private readonly object _sync = new();

    private readonly IGithubContextClientProvider _githubClientProvider;
    private readonly IGithubIssueContextProvider _contextProvider;

    public SolverProgressLoggerInIssue(IGithubContextClientProvider githubClientProvider, IGithubIssueContextProvider contextProvider)
    {
        _githubClientProvider = githubClientProvider;
        _contextProvider = contextProvider;
    }

    public async Task LogChatRequest(Conversation conversation)
    {
        string comment = $"# Sending request to the AI using Chat interface\n" +
                         $"## System message:\n" +
                         $"{conversation.Messages.FirstOrDefault(x => x.Role == "system")?.Content}\n" +
                         $"\n" +
                         $"## User Request:\n" +
                         $"{conversation.Messages.FirstOrDefault(x => x.Role == "user")?.Content}\n" +
                         $"\bn";

        lock (_sync)
        {
            //TODO: Instead of logging to Console here, it should log to ILogger in separate class. ILogger should then log to console.
            Console.WriteLine($"Creating a new issue comment:\n{comment}");
        }

        GithubIssueContext context = _contextProvider.Get();

        //TODO: This should be logged here always. Decision if this logger is used should be done at DI level
        await _githubClientProvider.Get().Issue.Comment.Create(context.RepoOwnerName, context.RepoName, context.SourceIssue.Number,
            comment);
    }

    public async Task LogChatResponse(string response)
    {
        string comment = $"## AI Response\n" +
                         $"{response}";

        GithubIssueContext context = _contextProvider.Get();

        //TODO: This should be logged here always. Decision if this logger is used should be done at DI level
        await context.GitHubClient.Issue.Comment.Create(context.RepoOwnerName, context.RepoName, context.SourceIssue.Number,
            comment);

        lock (_sync)
        {
            //TODO: Instead of logging to Console here, it should log to ILogger in separate class. ILogger should then log to console.
            Console.WriteLine($"Creating a new issue comment:\n{comment}");
        }
    }
}

Select one command with this parameters to execute:

n

github-actions[bot] commented 1 year ago

AI Response

replace_file

using AiProgrammer.Github;
using AiProgrammer.Solving;
using AiProgrammer.Solving.GithubIssue;
using AiProgrammer.Solving.Model;
using OpenAI_API.Chat;

namespace AiProgrammer.Loggingv1;

public class SolverProgressLoggerInIssue : ISolverProgressLogger
{
    private readonly object _sync = new();

    private readonly IGithubContextClientProvider _githubClientProvider;
    private readonly IGithubIssueContextProvider _contextProvider;

    public SolverProgressLoggerInIssue(IGithubContextClientProvider githubClientProvider, IGithubIssueContextProvider contextProvider)
    {
        _githubClientProvider = githubClientProvider;
        _contextProvider = contextProvider;
    }

    public async Task LogChatRequest(Conversation conversation)
    {
        string comment = $"# Sending request to the AI using Chat interface\n" +
                         $"## System message:\n" +
                         $"{conversation.Messages.FirstOrDefault(x => x.Role == "system")?.Content}\n" +
                         $"\n" +
                         $"## User Request:\n" +
                         $"{conversation.Messages.FirstOrDefault(x => x.Role == "user")?.Content}\n" +
                         $"\bn";

        lock (_sync)
        {
            //TODO: Instead of logging to Console here, it should log to ILogger in separate class. ILogger should then log to console.
            Console.WriteLine($"Creating a new issue comment:\n{comment}");
        }

        GithubIssueContext context = _contextProvider.Get();

        //TODO: This should be logged here always. Decision if this logger is used should be done at DI level
        await _githubClientProvider.Get().Issue.Comment.Create(context.RepoOwnerName, context.RepoName, context.SourceIssue.Number,
            comment);
    }

    public async Task LogChatResponse(string response)
    {
        string comment = $"## AI Response\n" +
                         $"{response}";

        GithubIssueContext context = _contextProvider.Get();

        //TODO: This should be logged here always. Decision if this logger is used should be done at DI level
        await context.GitHubClient.Issue.Comment.Create(context.RepoOwnerName, context.RepoName, context.SourceIssue.Number,
            comment);

        lock (_sync)
        {
            //TODO: Instead of logging to Console here, it should log to ILogger in separate class. ILogger should then log to console.
            Console.WriteLine($"Creating a new issue comment:\n{comment}");
        }
    }
}

Changed namespace AiProgrammer.Logging to AiProgrammer.Loggingv1

github-actions[bot] commented 1 year ago

Sending request to the AI using Chat interface

System message:

You are an AI system that does programming tasks by reading the issue specification and modifying the existing code by changing it or adding new code to resolve the user request. You minimize changes to the code and make sure not to modify anything that the user has not requested. Do not remove classes, methods, or fields - only add or modify existing ones. You will be doing the work in steps. The results of your work will be automatically put on Github. Always print the whole source, never the 'The rest of the class remains unchanged' comment

User Request:

The user request: Change namespace AiProgrammer.Logging to AiProgrammer.Loggingv1


Do this in steps:

  1. From a list of files select ones that will be needed to see or modify to program the user request. You will be shown content of those files. You have a limited memory so you will only see the selected ones.
  2. Modify selected existing files one by one
  3. Create needed new files one by one

You are currently in step 'Create needed new files one by one'

Already reviewed files with your own description of what happened: AiProgrammer/Logging/ISolverProgressLogger.cs - modified - Changed namespace AiProgrammer.Logging to AiProgrammer.Loggingv1 AiProgrammer/Logging/SolverProgressLoggerInIssue.cs - modified - Changed namespace AiProgrammer.Logging to AiProgrammer.Loggingv1

New files you created:

Select one command with parameters to execute:

n

github-actions[bot] commented 1 year ago

AI Response

do_not_create_more_files

github-actions[bot] commented 1 year ago

Pull Request created: https://github.com/dex3r/GPT-Codemaster/pull/2