Skip to main content

Wildered

wildered is a personal, over-engineered, toy project for autocompleting your Python code using OpenAI GPT-3.5.

Installation

You can install wildered with pip. You need to have Python version of 3.10 or above to use wildered.

pip install wildered

Basic usage

Suppose that you have two Python scripts:

test.py:

from pydantic import BaseModel
from models import Point

def find_y_intercept(point_1: Point, point_2: Point) -> Point:
    """
    Given two points, find and return the y intercept as Point object
    """
    pass

models.py:

from typing import Any, NamedTuple, TypeAlias
import numpy.typing as npt
import numpy as np

class Point(NamedTuple):
    x: int
    y: int
    
    def as_ndarray(self) -> npt.NDArray:
        return np.array([self.x, self.y])

We wish to implement find_y_intercept in test.py. However, we cannot just copy paste the whole script, as the function depends on the definition of Point object, which is in models.py.

Lets see what wildered can do.

First, we add directives to the test.py.

New test.py:

from pydantic import BaseModel
import wildered # You can choose not to import wildered if you want
from models import Point

@wildered.hint([Point])
@wildered.autocomplete()
def find_y_intercept(point_1: Point, point_2: Point) -> Point:
    """
    Given two points, find and return the y intercept as POint object
    """
    pass

Now we run the wildered cli command:

wildered test.py

wildered will format a prompt for you ready to be used for code completion LLM:

I am writing a Python project and I need your help as a code assistant.
Below are the functions or classes that I am working on:

```python
def find_y_intercept(point_1: Point, point_2: Point) -> Point:
    """
    Given two points, find and return the y intercept as POint object
    """
    pass
```

Below are the tasks you need to accomplish:
'''
## Task 1
Implement find_y_intercept function. Follow instruction from docstrings and comments on how to implement the function. Ensure that your answer has type annotations. 

'''
Below are snippets of code in the current project that you may find useful:
```python
from typing import Any, NamedTuple, TypeAlias
import numpy.typing as npt
import numpy as np

class Point(NamedTuple):
    x: int
    y: int

    def as_ndarray(self) -> npt.NDArray:
        return np.array([self.x, self.y])
```

Your answer should only have the functions or class that you are told to implement. Do not repeat other code in your answer

Note: Actual output may differ as prompt template changes over time.

A more detailed documentation is still under development. Meanwhile you can learn more by running wildered --help

Future works

  • Automatically detect dependencies instead of specifying all of them manually. Also detect the dependencies of the dependencies.
  • Improving automatic integration of the LLM response into your project code.

Release files for wildered 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wildered 0.2.4
File Size Uploaded
wildered-0.2.4.tar.gz 22.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wildered 0.2.4
File Interpreter ABI Platform
wildered-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 52.9 kB

Release files / wildered-0.2.4.tar.gz

Download URL wildered-0.2.4.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
22f0489e37be51156d60f310acd44d8ae7ff1089f360eda6f9398ea23efc6f8c
BLAKE2b-256 checksum
How to use checksums
d17c5a1ef4767ff47fd277d134c70d9c4458bdfed84e0cc1ebe7f22008ca25d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.1 Windows/10

Release files / wildered-0.2.4-py3-none-any.whl

Download URL wildered-0.2.4-py3-none-any.whl
Size 30.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21089a698ee30bb0575d5860da502ca61b94fbaff26585222b7d8950256b4fdc
BLAKE2b-256 checksum
How to use checksums
84d37b3a63c49901567e14a0d1bb5dd3ba4038daf9a1557e0d6ab6f6c4db007a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.1 Windows/10

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page