finae


Namefinae JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryA simple Python library
upload_time2024-04-25 06:46:33
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords setuptools development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ๐Ÿ˜†Finae 

Contact Ning Ren (renning22@gmail.com) for discussion, contribution or โ˜•.

## (Draft)

Finae's vision is to build a AI-powered programming languange and greatly simplify programming.

For now, Finae can be used as a tool to more easily work with LLMs. With simple configurations, LLMs output turns into stable and easy-to-process Python objects.

The key idea is to exploit ๐ŸŒฒ**tree-of-thoughts** and โœ”๏ธ**self-consistency** of LLMs and find the **stable** outputs via heavy/concurrent queries against **multiple** LLMs.

Think about asking the same question in different words or from different angles. The answer will converge if an LLM really knows it (if the fact was well-spread in the training corpus).

This approach works better with multiple LLMs, given that each LLM is a unique representation of its training dataset. And it also works well with smaller models (~7B parameters) as it eliminates hallucinations.

See more ๐Ÿช[vision and mission behind Finae](DESIGN.md).

### Samples


#### Finae class is called concept.


```python
@finae.Concept
class Mountain:
    ...

    @finae.Attribute
    def name(self):
        ...

    @finae.Attribute
    def location(self):
        ...
```

#### Concept Examples

Mountain

```python
m = Mountain('give me any mountain in this world')
print(m.name())

m = Mountain('Highest mountain in the world')
print(m.altitude())

m = Mountain('Mount Everest')
print(m.altitude())

mountains = Mountain.query('Top 50 mountains in the wolrd')
for m in mountains:
    print(m.name())
```

Integer/Float

```python
i = Integer('give me a code generate integer in python')
i = Integer('show me an example of Python integer')
i = Integer('show me an example of Python float')
```

Date
```python
d = Date('independence day of United States')
print(d)

d = Date('1995/03/01')
print(d)

d = Date('03-01-1995')
print(d)

d = Date('year 1995, March, first')
print(d)

d = Date('the day after 1995/03/01')
print(d)

d = Date('the day after ', d)
print(d)
```


Array
```python
a = Array('[1, 2, 3, 4]')
print(a)

a = Array('1, 2, 3, 4')
print(a)

a = Array('1 2 5 6 10')
print(a)

a = Array('1 to 4')
print(a)

a = Array('1 to 4, inclusive')
print(a)

a = Array('give me an array of integer, length less than 20')
print(a)

```


Numpy, pandas
```python
n = Numpy('give me a numpy array, length 10')
print(n)

n = Numpy("""
1 2 3
4 5 6
7 8 9
""")
print(n)

t = PandasTable('Pandas table, columns: name, school, age')
print(t)

t = PandasTable("""
name school age
foo    A    y
bar    B    z
""")
print(t)
```



#### Finae concept memories samples it has processed

E.g. up to 100 for example, and ranked by some scores, keep LRU.

```python
for m in Mountain.samples():
    print(m)
```

#### Finae concept memories/caches the way it parses the input.

The cache is local database file or py that can be checked-in to codebase and version-controlled. (Or delete if want to drop the cache.)


```python
d = Date('independence day of United States')
d = Date('independence day of United States')  # read from cache
d = Date('independence day of United States')  # read from cache
```

## Install

```
> pip install -e .
```


## Owner/maintainer

### Publish to pip hub

```
python3 -m pip install --upgrade build
python3 -m pip install --upgrade twine

rm dist/ -rf
python3 -m build
twine check dist/*
twine upload dist/*
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "finae",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Ning Ren <renning22@gmail.com>",
    "keywords": "setuptools, development",
    "author": null,
    "author_email": "Ning Ren <renning22@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e7/0f/8722b90e92aecc1e15c8346a109440f78c98d0f9aacd9c4b2b69557c4d06/finae-0.0.2.tar.gz",
    "platform": null,
    "description": "# \ud83d\ude06Finae \n\nContact Ning Ren (renning22@gmail.com) for discussion, contribution or \u2615.\n\n## (Draft)\n\nFinae's vision is to build a AI-powered programming languange and greatly simplify programming.\n\nFor now, Finae can be used as a tool to more easily work with LLMs. With simple configurations, LLMs output turns into stable and easy-to-process Python objects.\n\nThe key idea is to exploit \ud83c\udf32**tree-of-thoughts** and \u2714\ufe0f**self-consistency** of LLMs and find the **stable** outputs via heavy/concurrent queries against **multiple** LLMs.\n\nThink about asking the same question in different words or from different angles. The answer will converge if an LLM really knows it (if the fact was well-spread in the training corpus).\n\nThis approach works better with multiple LLMs, given that each LLM is a unique representation of its training dataset. And it also works well with smaller models (~7B parameters) as it eliminates hallucinations.\n\nSee more \ud83e\ude90[vision and mission behind Finae](DESIGN.md).\n\n### Samples\n\n\n#### Finae class is called concept.\n\n\n```python\n@finae.Concept\nclass Mountain:\n    ...\n\n    @finae.Attribute\n    def name(self):\n        ...\n\n    @finae.Attribute\n    def location(self):\n        ...\n```\n\n#### Concept Examples\n\nMountain\n\n```python\nm = Mountain('give me any mountain in this world')\nprint(m.name())\n\nm = Mountain('Highest mountain in the world')\nprint(m.altitude())\n\nm = Mountain('Mount Everest')\nprint(m.altitude())\n\nmountains = Mountain.query('Top 50 mountains in the wolrd')\nfor m in mountains:\n    print(m.name())\n```\n\nInteger/Float\n\n```python\ni = Integer('give me a code generate integer in python')\ni = Integer('show me an example of Python integer')\ni = Integer('show me an example of Python float')\n```\n\nDate\n```python\nd = Date('independence day of United States')\nprint(d)\n\nd = Date('1995/03/01')\nprint(d)\n\nd = Date('03-01-1995')\nprint(d)\n\nd = Date('year 1995, March, first')\nprint(d)\n\nd = Date('the day after 1995/03/01')\nprint(d)\n\nd = Date('the day after ', d)\nprint(d)\n```\n\n\nArray\n```python\na = Array('[1, 2, 3, 4]')\nprint(a)\n\na = Array('1, 2, 3, 4')\nprint(a)\n\na = Array('1 2 5 6 10')\nprint(a)\n\na = Array('1 to 4')\nprint(a)\n\na = Array('1 to 4, inclusive')\nprint(a)\n\na = Array('give me an array of integer, length less than 20')\nprint(a)\n\n```\n\n\nNumpy, pandas\n```python\nn = Numpy('give me a numpy array, length 10')\nprint(n)\n\nn = Numpy(\"\"\"\n1 2 3\n4 5 6\n7 8 9\n\"\"\")\nprint(n)\n\nt = PandasTable('Pandas table, columns: name, school, age')\nprint(t)\n\nt = PandasTable(\"\"\"\nname school age\nfoo    A    y\nbar    B    z\n\"\"\")\nprint(t)\n```\n\n\n\n#### Finae concept memories samples it has processed\n\nE.g. up to 100 for example, and ranked by some scores, keep LRU.\n\n```python\nfor m in Mountain.samples():\n    print(m)\n```\n\n#### Finae concept memories/caches the way it parses the input.\n\nThe cache is local database file or py that can be checked-in to codebase and version-controlled. (Or delete if want to drop the cache.)\n\n\n```python\nd = Date('independence day of United States')\nd = Date('independence day of United States')  # read from cache\nd = Date('independence day of United States')  # read from cache\n```\n\n## Install\n\n```\n> pip install -e .\n```\n\n\n## Owner/maintainer\n\n### Publish to pip hub\n\n```\npython3 -m pip install --upgrade build\npython3 -m pip install --upgrade twine\n\nrm dist/ -rf\npython3 -m build\ntwine check dist/*\ntwine upload dist/*\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple Python library",
    "version": "0.0.2",
    "project_urls": {
        "Bug Reports": "https://github.com/finae/py-finae/issues",
        "Funding": "https://github.com/finae/py-finae",
        "Homepage": "https://github.com/finae/py-finae",
        "Say Thanks!": "https://github.com/finae/py-finae",
        "Source": "https://github.com/finae/py-finae"
    },
    "split_keywords": [
        "setuptools",
        " development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1cf5ac3f60ec18adf450edd390d8412174072308abdfec27ad9f3f982826d741",
                "md5": "e9ea132d386e879c448812268180c63e",
                "sha256": "ece9a618dfacdd9c4083e80e48bbf8c47a7ce4e1a446985fd5d13e3e1f26d399"
            },
            "downloads": -1,
            "filename": "finae-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e9ea132d386e879c448812268180c63e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10742,
            "upload_time": "2024-04-25T06:46:31",
            "upload_time_iso_8601": "2024-04-25T06:46:31.256841Z",
            "url": "https://files.pythonhosted.org/packages/1c/f5/ac3f60ec18adf450edd390d8412174072308abdfec27ad9f3f982826d741/finae-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e70f8722b90e92aecc1e15c8346a109440f78c98d0f9aacd9c4b2b69557c4d06",
                "md5": "08d416bda633cf32584f5ebe21f0685a",
                "sha256": "c9abd8980029329e6c185f355ddafbeb298bbb373e852192afc4a2ff35cfaf96"
            },
            "downloads": -1,
            "filename": "finae-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "08d416bda633cf32584f5ebe21f0685a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12192,
            "upload_time": "2024-04-25T06:46:33",
            "upload_time_iso_8601": "2024-04-25T06:46:33.403718Z",
            "url": "https://files.pythonhosted.org/packages/e7/0f/8722b90e92aecc1e15c8346a109440f78c98d0f9aacd9c4b2b69557c4d06/finae-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-25 06:46:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "finae",
    "github_project": "py-finae",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "finae"
}
        
Elapsed time: 0.25496s