Metadata-Version: 2.1
Name: wildered
Version: 0.2.1
Summary: 
Home-page: https://github.com/outday29/wildered
License: MIT
Author: engkheng
Author-email: ongengkheng929@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: ast-comments (>=1.0.1,<2.0.0)
Requires-Dist: guidance (>=0.0.64,<0.0.65)
Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
Requires-Dist: langchain (>=0.0.198,<0.0.199)
Requires-Dist: libcst (>=1.0.0,<2.0.0)
Requires-Dist: loguru (>=0.7.0,<0.8.0)
Requires-Dist: pydantic (>=1.10.8,<2.0.0)
Requires-Dist: pyperclip (>=1.8.2,<2.0.0)
Requires-Dist: typer (>=0.9.0,<0.10.0)
Requires-Dist: wander (>=0.1.0,<0.2.0)
Project-URL: Repository, https://github.com/outday29/wildered
Description-Content-Type: text/markdown

# Wildered

`wildered` is a personal, over-engineered, toy project for integrating your project code and other related information into your LLM prompt without having to copy-paste manually.

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

```python
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`:
```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])
```

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

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

```bash
wildered test.py
```

`wildered` will format a prompt for you ready to be used for chatbot:

````
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.
