r44cx / GPT-Codemaster

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

Create file idea.md #15

Open r44cx opened 1 year ago

r44cx commented 1 year ago

add a step b step prompt build script that creates a context for an language model request which only allows certain things. the ai should onl print what it is told to and or use given option with replacment patterns like templates

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: Create file idea.md add a step b step prompt build script that creates a context for an language model request which only allows certain things. the ai should onl print what it is told to and or use given option with replacment patterns like templates


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::

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


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

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: Create file idea.md add a step b step prompt build script that creates a context for an language model request which only allows certain things. the ai should onl print what it is told to and or use given option with replacment patterns like templates


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

Current file path: AiProgrammer/Solving/GithubIssue/GithubIssueContextProvider.cs

Current file content:

using AiProgrammer.Solving.Model;

namespace AiProgrammer.Solving.GithubIssue;

public class GithubIssueContextProvider : IGithubIssueContextProvider, IDisposable
{
    private GithubIssueContext? _context;
    private bool _isDisposed;

    public GithubIssueContext Get()
    {
        if (_isDisposed)
        {
            throw new Exception("Tried to get Github Issue context after the scope has been disposed");
        }

        if (_context == null)
        {
            throw new Exception("Github Issue Context is not set. Are you trying to access functionality exclusive to Github Issue " +
                                "from a context without Github Issue?");
        }

        return _context;
    }

    public void Set(GithubIssueContext context)
    {
        _context = context ?? throw new ArgumentNullException(nameof(context));
    }

    public void Dispose()
    {
        _context = null;
        _isDisposed = true;
    }
}

Select one command with this parameters to execute:

n

github-actions[bot] commented 1 year ago

AI Response

replace_file

using AiProgrammer.Solving.Model;

namespace AiProgrammer.Solving.GithubIssue;

public class GithubIssueContextProvider : IGithubIssueContextProvider, IDisposable
{
    private GithubIssueContext? _context;
    private bool _isDisposed;

    public GithubIssueContext Get()
    {
        if (_isDisposed)
        {
            throw new Exception("Tried to get Github Issue context after the scope has been disposed");
        }

        if (_context == null)
        {
            throw new Exception("Github Issue Context is not set. Are you trying to access functionality exclusive to Github Issue " +
                                "from a context without Github Issue?");
        }

        return _context;
    }

    public void Set(GithubIssueContext context)
    {
        _context = context ?? throw new ArgumentNullException(nameof(context));
    }

    public void Dispose()
    {
        _context = null;
        _isDisposed = true;
    }

    public void BuildScript()
    {
        // Step-by-step prompt build script that creates a context for a language model request which only allows certain things.
        // The AI should only print what it is told to and/or use given options with replacement patterns like templates.
        // TODO: Implement the build script
    }
}

Added a new method BuildScript to the GithubIssueContextProvider class that will contain the step-by-step prompt build script to create a context for a language model request which only allows certain things. The implementation of the script is still pending.

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: Create file idea.md add a step b step prompt build script that creates a context for an language model request which only allows certain things. the ai should onl print what it is told to and or use given option with replacment patterns like templates


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/Solving/GithubIssue/GithubIssueContextProvider.cs - modified - Added a new method BuildScript to the GithubIssueContextProvider class that will contain the step-by-step prompt build script to create a context for a language model request which only allows certain things. The implementation of the script is still pending.

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

Current file path: AiProgrammer/Solving/GithubIssue/GithubIssueSolverWithMethodSelection.cs

Current file content:

using AiProgrammer.Solving.Steps.EntrySteps;
using AiProgrammer.Solving.Steps.Helpers;

namespace AiProgrammer.Solving.GithubIssue;

public record GithubIssueSolverWithMethodSelection(
    StepSolveGithubIssueWithMethodSelection SolveStep, 
    ICurrentStepsHolder CurrentStepsHolder
    ) : IGithubIssueSolver
{
    public async Task SolveGithubIssue()
    {
        try
        {
            CurrentStepsHolder.SetCurrentSteps(SolveStep);

            await SolveStep.SolveGithubIssue();
        }
        finally
        {
            CurrentStepsHolder.ClearCurrentSteps();
        }
    }
}

Select one command with this parameters to execute:

n

github-actions[bot] commented 1 year ago

AI Response

replace_file

using AiProgrammer.Solving.Steps.EntrySteps;
using AiProgrammer.Solving.Steps.Helpers;
using System;

namespace AiProgrammer.Solving.GithubIssue
{
    public record GithubIssueSolverWithMethodSelection(
        StepSolveGithubIssueWithMethodSelection SolveStep,
        ICurrentStepsHolder CurrentStepsHolder
        ) : IGithubIssueSolver
    {
        public async Task SolveGithubIssue()
        {
            try
            {
                CurrentStepsHolder.SetCurrentSteps(SolveStep);

                await SolveStep.SolveGithubIssue();
            }
            finally
            {
                CurrentStepsHolder.ClearCurrentSteps();
            }
        }

        public string BuildScript()
        {
            return @"Step-by-step prompt build script to create a context for a language model request which only allows certain things:

1. Define the context for the language model request.
2. Define the allowed things in the context.
3. Define the templates for the replacement patterns.
4. Define the input text for the language model request.
5. Replace the patterns in the input text with the templates.
6. Print the resulting text.

Example implementation:

var context = new Dictionary<string, string>();
context.Add(""allowedThing1"", ""value1"");
context.Add(""allowedThing2"", ""value2"");

var templates = new Dictionary<string, string>();
templates.Add(""template1"", ""{allowedThing1} is replaced with its value: {allowedThing1}"");
templates.Add(""template2"", ""{allowedThing2} is replaced with its value: {allowedThing2}"");

var inputText = ""This is a {allowedThing1} and this is a {allowedThing2}."";

foreach (var allowedThing in context.Keys)
{
    if (!inputText.Contains(""{" + allowedThing + ""}""))
    {
        throw new Exception(""Input text does not contain the allowed thing: "" + allowedThing);
    }
}

foreach (var template in templates.Values)
{
    foreach (var allowedThing in context.Keys)
    {
        if (!template.Contains(""{" + allowedThing + ""}""))
        {
            throw new Exception(""Template does not contain the allowed thing: "" + allowedThing);
        }
    }
}

foreach (var allowedThing in context.Keys)
{
    inputText = inputText.Replace(""{" + allowedThing + ""}"", context[allowedThing]);
}

foreach (var template in templates.Values)
{
    foreach (var allowedThing in context.Keys)
    {
        template = template.Replace(""{" + allowedThing + ""}"", context[allowedThing]);
    }

    Console.WriteLine(template);
}

";
        }
    }
}

Added a new method BuildScript to the GithubIssueSolverWithMethodSelection class that contains the step-by-step prompt build script to create a context for a language model request which only allows certain things. The implementation of the script is based on the user request and includes the use of replacement patterns with templates.

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: Create file idea.md add a step b step prompt build script that creates a context for an language model request which only allows certain things. the ai should onl print what it is told to and or use given option with replacment patterns like templates


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/Solving/GithubIssue/GithubIssueContextProvider.cs - modified - Added a new method BuildScript to the GithubIssueContextProvider class that will contain the step-by-step prompt build script to create a context for a language model request which only allows certain things. The implementation of the script is still pending. AiProgrammer/Solving/GithubIssue/GithubIssueSolverWithMethodSelection.cs - modified - Added a new method BuildScript to the GithubIssueSolverWithMethodSelection class that contains the step-by-step prompt build script to create a context for a language model request which only allows certain things. The implementation of the script is based on the user request and includes the use of replacement patterns with templates.

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

Current file path: AiProgrammer/Solving/GithubIssue/GithubIssueSolverFileByFile.cs

Current file content:

using AiProgrammer.Solving.Steps.EntrySteps;
using AiProgrammer.Solving.Steps.Helpers;

namespace AiProgrammer.Solving.GithubIssue;

public record GithubIssueSolverFileByFile(
    StepSolveGithubIssueFileByFile SolveStep, 
    ICurrentStepsHolder CurrentStepsHolder
    ) : IGithubIssueSolver
{
    public async Task SolveGithubIssue()
    {
        try
        {
            CurrentStepsHolder.SetCurrentSteps(SolveStep);

            await SolveStep.SolveGithubIssue();
        }
        finally
        {
            CurrentStepsHolder.ClearCurrentSteps();
        }
    }
}

Select one command with this parameters to execute:

n

github-actions[bot] commented 1 year ago

Exception caught while GPT-Codemaster tried to solve the issue:


System.Net.Http.HttpRequestException: Error at chat/completions (https://api.openai.com/v1/chat/completions) with HTTP status code: TooManyRequests. Content: {
  "error": {
    "message": "That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID be0b1f03b39b4a5119231b7b5e279482 in your message.)",
    "type": "server_error",
    "param": null,
    "code": null
  }
}

   at OpenAI_API.EndpointBase.HttpRequestRaw(String url, HttpMethod verb, Object postData, Boolean streaming)
   at OpenAI_API.EndpointBase.HttpRequest[T](String url, HttpMethod verb, Object postData)
   at OpenAI_API.EndpointBase.HttpPost[T](String url, Object postData)
   at OpenAI_API.Chat.ChatEndpoint.CreateChatCompletionAsync(ChatRequest request)
   at OpenAI_API.Chat.Conversation.GetResponseFromChatbot()
   at AiProgrammer.AiInterface.ChatCompletions.GetResponseFromChatbotUnsafe(String systemMessage, String userMessage) in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/AiInterface/ChatCompletions.cs:line 97
   at AiProgrammer.AiInterface.ChatCompletions.GetResponseFromChatbot(String systemMessage, String userMessage) in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/AiInterface/ChatCompletions.cs:line 40
   at AiProgrammer.AiInterface.ChatCompletions.GetResponseFromChatbot(String systemMessage, String userMessage) in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/AiInterface/ChatCompletions.cs:line 61
   at AiProgrammer.AiInterface.ChatCompletions.GetResponseForChat(String systemMessage, String chatMessage) in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/AiInterface/ChatCompletions.cs:line 26
   at AiProgrammer.AiInterface.ChatCompletions.GetCompletion(String systemMessage, String messageToComplete) in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/AiInterface/ChatCompletions.cs:line 21
   at AiProgrammer.Solving.Steps.Helpers.FollowNextStepExecutor.ExecuteStep(String stepDescription, String prompt) in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/Solving/Steps/Helpers/FollowNextStepExecutor.cs:line 50
   at AiProgrammer.Solving.Steps.ConcreteSteps.StepModifyExistingFilesOneByOne.ExecuteForSingleFile(FilePath currentFile, List`1 alreadyReviewedFilesTexts, IReadOnlyCollection`1 filesLeftToReview) in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/Solving/Steps/ConcreteSteps/StepModifyExistingFilesOneByOne.cs:line 95
   at AiProgrammer.Solving.Steps.ConcreteSteps.StepModifyExistingFilesOneByOne.GetChangedFiles(IReadOnlyList`1 filesToPreview) in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/Solving/Steps/ConcreteSteps/StepModifyExistingFilesOneByOne.cs:line 33
   at AiProgrammer.Solving.Steps.EntrySteps.StepSolveGithubIssueFileByFile.SolveGithubIssue() in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/Solving/Steps/EntrySteps/StepSolveGithubIssueFileByFile.cs:line 94
   at AiProgrammer.Solving.GithubIssue.GithubIssueSolverFileByFile.SolveGithubIssue() in /home/runner/work/GPT-Codemaster/GPT-Codemaster/AiProgrammer/Solving/GithubIssue/GithubIssueSolverFileByFile.cs:line 17
   at GithubIssueListener.IssueSolvingStarter.Solve(GithubIssueContext requestContext) in /home/runner/work/GPT-Codemaster/GPT-Codemaster/GithubIssueListener/IssueSolvingStarter.cs:line 57```