Giter Site home page Giter Site logo

debuganddocstringprompt's Introduction

Lambda Function

Setup Repo

git clone https://github.com/Drwaish/DebugAndDocstringPrompt.git
cd DebugAndDocstringPrompt

Install dependencies

pip install openai

Paste openai api key for smooth running of code.

Open Repository in Visual Studio Code.

For locally test lambda function.

python lambda_function.py

For remotely test lambda function.

Follow following steps

  1. Enter url in 'URL' variable
  2. Paste your code in 'code' variable
  3. Uncomment your request choice

Timeout for POST request is 5 seconds. If Internet connection is slow increase timeout span. Then

python script.py

Debug Function

User hit the lambda function with this payload.

Payload

{ 
   "body" : {
      "messages" :
       [
            {
            "role": "system",
            "content": "Your are a very helpful code debbuger. Debug the following code and fix the bugs."
            },
            {
            "role": "user"
            "content: "'''<Enter your code here>'''"
            }
       ] 
    }
}

Write Docstring

Write Docstring in Numpy Style

Payload return the docstring in google style.

{
    "body": {
        "messages" : 
        [
            {
            "role": "system",
            "content": "'Parameters: \\n -------------- \\n Return\\n --------\\n Consider above to write docstring   of following code in  numpy style,  consider only above two arguments in docstring and not write 'Notes' and 'Examples' in docstring."
            },
            {
            "role": "user"
            "content: "'''<Enter your code here>'''"
            }
        ]
   }
}

Write Docstring in Google Style

Payload return the docstring in google style.

{ 
    "body": {
        "messages" :
        [
           {
            "role": "system",
            "content": "Write docstring of following code in  google style. "
            },
            {
            "role": "user",
            "content": "def data():\n return True"
            }
        ]
    }
}

Important Note:

Use script.py to test your lambda.

Deploy on AWS Lambda and automate your work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.