genWizard


NamegenWizard JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/ykim336/genWizard
SummarygenWizard allows for versatile usage of openAI generation and prompting management.
upload_time2023-06-14 15:48:11
maintainer
docs_urlNone
authorIsaac Moon
requires_python
licenseMIT
keywords machine learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            GENWIZARD LIBRARY:

'genWizard' is a complex project aimed at utilizing AI for text generation, particularly using OpenAI's language models. it is designed around the concept of generating content based on provided prompts, and involves a multi-stage process of expanding prompts, evaluating the reliability and validity of generated outputs, and comparing these outputs.

The purpose of the project is the allow anyone with little to no experience in coding AI to utilize the features of OpenAI's LLMs. 

-----------------------------------------------------------------------------------

SETUP:
    -

-----------------------------------------------------------------------------------

DATABASE MANAGER CLASS:
    - `__init__(self)`: The constructor for the `DatabaseManager` class. This initializes the instance with a mapping of paths to different directories in your project.

    - `get_latest_file(self, path, number=1)`: This function retrieves the latest file(s) from a given directory, as determined by the `path` argument. If `number` is greater than 1, it will return the specified number of latest files. The returned files are sorted in descending order of creation time.

    - `write(self, id, content=None, filetype=".txt")`: This function writes content to a file in a directory specified by `id`. The file is named with the current timestamp and the provided `filetype`. If no content is given, it prompts the user to provide content.

    - `read(self, id, filename=None)`: This function reads content from a file in a directory specified by `id`. If no filename is given, it reads from the latest file in the directory. It returns the content of the file.

    - `delete(self, id, filename=None)`: This function deletes a file in a directory specified by `id`. If no filename is given, it deletes the latest file in the directory.

    - `edit(self, id, filename=None, content=None)`: This function edits a file in a directory specified by `id`. If no filename is given, it edits the latest file in the directory. If no content is given, it prompts the user to provide new content.

In essence, the `DatabaseManager` class is a utility for reading from, writing to, editing, and deleting files in specified directories in your project.

-----------------------------------------------------------------------------------

GENERATOR CLASS:
    - `__init__(self, engine="gpt-3.5-turbo", api_key="")`: The constructor for the `Generator` class. Initializes an instance of the `Generator` class with the specified OpenAI engine and API key. It also creates an empty list `conversation_log` for storing the conversation history and an instance of the `DatabaseManager`.

    - `display_info(self)`: This function prints out the details of the `Generator` instance, including the OpenAI engine being used and the API key.

    - `base_generation(self, prompt, memory=False, token=300, temperature=0.5)`: This function makes a request to the OpenAI API using the provided prompt and other optional parameters. If `memory` is set to `True`, it will remember the response from the OpenAI API and store it in `conversation_log`. If `memory` is `False`, it will forget the response. It returns the response content as a string.

    - `multi_generation(self, prompt, number=1, memory=False)`: This function uses the `base_generation` function to generate multiple responses from the OpenAI API. The number of responses is determined by the `number` parameter. It returns a list of responses.

The `Generator` class serves as a wrapper for the OpenAI API, providing utility functions for making requests and handling responses. It also integrates with the `DatabaseManager` class to handle data storage and retrieval.

-----------------------------------------------------------------------------------

EXPANDER CLASS:
    - `__init__(self)`: The constructor for the `Expander` class. This initializes the instance with a `Generator` object and a `DatabaseManager` object.

    - `base_expansion(self, prompt_parts: list) -> str`: This function takes a list of string parts and joins them with two newline characters ("\n\n"). It is used for creating a prompt by joining multiple strings together in a specific format.

    - `expansion_generator(self, user_prompt: str, filename="expansion_generator_prompt.txt") -> list`: This function generates an expanded text based on a user-provided prompt. It reads an "expansion_prompt" from a file (default name "expansion_generator_prompt.txt") located in the directory associated with the ID 2 in the `DatabaseManager`'s path mapping. It then creates a full prompt by joining the "expansion_prompt" and the user's prompt using `base_expansion`. The full prompt is fed into the generator for text generation. The generated text is split by newline characters and returned as a list of strings. 

In essence, the `Expander` class is used to expand a given prompt by adding additional content from a file and then generate text based on the expanded prompt.

===================================================================================

GENWIZARD CHANGELOGS

===================================================================================

0.0.3
-----------------------------------------------------------------------------------
First Release
- Includes the basic functions: Database Manager, Expander, and Generator. 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ykim336/genWizard",
    "name": "genWizard",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "machine learning",
    "author": "Isaac Moon",
    "author_email": "ykim336@ucr.com",
    "download_url": "https://files.pythonhosted.org/packages/20/60/58bb884648e8504acfc95aace2986b58ef067eab025befe6fac7e4144a5c/genWizard-0.0.3.tar.gz",
    "platform": null,
    "description": "GENWIZARD LIBRARY:\n\n'genWizard' is a complex project aimed at utilizing AI for text generation, particularly using OpenAI's language models. it is designed around the concept of generating content based on provided prompts, and involves a multi-stage process of expanding prompts, evaluating the reliability and validity of generated outputs, and comparing these outputs.\n\nThe purpose of the project is the allow anyone with little to no experience in coding AI to utilize the features of OpenAI's LLMs. \n\n-----------------------------------------------------------------------------------\n\nSETUP:\n    -\n\n-----------------------------------------------------------------------------------\n\nDATABASE MANAGER CLASS:\n    - `__init__(self)`: The constructor for the `DatabaseManager` class. This initializes the instance with a mapping of paths to different directories in your project.\n\n    - `get_latest_file(self, path, number=1)`: This function retrieves the latest file(s) from a given directory, as determined by the `path` argument. If `number` is greater than 1, it will return the specified number of latest files. The returned files are sorted in descending order of creation time.\n\n    - `write(self, id, content=None, filetype=\".txt\")`: This function writes content to a file in a directory specified by `id`. The file is named with the current timestamp and the provided `filetype`. If no content is given, it prompts the user to provide content.\n\n    - `read(self, id, filename=None)`: This function reads content from a file in a directory specified by `id`. If no filename is given, it reads from the latest file in the directory. It returns the content of the file.\n\n    - `delete(self, id, filename=None)`: This function deletes a file in a directory specified by `id`. If no filename is given, it deletes the latest file in the directory.\n\n    - `edit(self, id, filename=None, content=None)`: This function edits a file in a directory specified by `id`. If no filename is given, it edits the latest file in the directory. If no content is given, it prompts the user to provide new content.\n\nIn essence, the `DatabaseManager` class is a utility for reading from, writing to, editing, and deleting files in specified directories in your project.\n\n-----------------------------------------------------------------------------------\n\nGENERATOR CLASS:\n    - `__init__(self, engine=\"gpt-3.5-turbo\", api_key=\"\")`: The constructor for the `Generator` class. Initializes an instance of the `Generator` class with the specified OpenAI engine and API key. It also creates an empty list `conversation_log` for storing the conversation history and an instance of the `DatabaseManager`.\n\n    - `display_info(self)`: This function prints out the details of the `Generator` instance, including the OpenAI engine being used and the API key.\n\n    - `base_generation(self, prompt, memory=False, token=300, temperature=0.5)`: This function makes a request to the OpenAI API using the provided prompt and other optional parameters. If `memory` is set to `True`, it will remember the response from the OpenAI API and store it in `conversation_log`. If `memory` is `False`, it will forget the response. It returns the response content as a string.\n\n    - `multi_generation(self, prompt, number=1, memory=False)`: This function uses the `base_generation` function to generate multiple responses from the OpenAI API. The number of responses is determined by the `number` parameter. It returns a list of responses.\n\nThe `Generator` class serves as a wrapper for the OpenAI API, providing utility functions for making requests and handling responses. It also integrates with the `DatabaseManager` class to handle data storage and retrieval.\n\n-----------------------------------------------------------------------------------\n\nEXPANDER CLASS:\n    - `__init__(self)`: The constructor for the `Expander` class. This initializes the instance with a `Generator` object and a `DatabaseManager` object.\n\n    - `base_expansion(self, prompt_parts: list) -> str`: This function takes a list of string parts and joins them with two newline characters (\"\\n\\n\"). It is used for creating a prompt by joining multiple strings together in a specific format.\n\n    - `expansion_generator(self, user_prompt: str, filename=\"expansion_generator_prompt.txt\") -> list`: This function generates an expanded text based on a user-provided prompt. It reads an \"expansion_prompt\" from a file (default name \"expansion_generator_prompt.txt\") located in the directory associated with the ID 2 in the `DatabaseManager`'s path mapping. It then creates a full prompt by joining the \"expansion_prompt\" and the user's prompt using `base_expansion`. The full prompt is fed into the generator for text generation. The generated text is split by newline characters and returned as a list of strings. \n\nIn essence, the `Expander` class is used to expand a given prompt by adding additional content from a file and then generate text based on the expanded prompt.\n\n===================================================================================\n\nGENWIZARD CHANGELOGS\n\n===================================================================================\n\n0.0.3\n-----------------------------------------------------------------------------------\nFirst Release\n- Includes the basic functions: Database Manager, Expander, and Generator. \n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "genWizard allows for versatile usage of openAI generation and prompting management.",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/ykim336/genWizard"
    },
    "split_keywords": [
        "machine",
        "learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76975c9962ee766aa8ed3136a72f2df10bbb562d96fb4dc473a11ff0d3e67503",
                "md5": "384aa1ed5963758eb321d14a2664f3c6",
                "sha256": "b3cba1726a8c3a1e579bfdc7fce160c8d6d4d431a85c8df9787846bea2f3ce23"
            },
            "downloads": -1,
            "filename": "genWizard-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "384aa1ed5963758eb321d14a2664f3c6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5752,
            "upload_time": "2023-06-14T15:48:09",
            "upload_time_iso_8601": "2023-06-14T15:48:09.598265Z",
            "url": "https://files.pythonhosted.org/packages/76/97/5c9962ee766aa8ed3136a72f2df10bbb562d96fb4dc473a11ff0d3e67503/genWizard-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "206058bb884648e8504acfc95aace2986b58ef067eab025befe6fac7e4144a5c",
                "md5": "dcda5ac254eef0eaf589074d3334c77b",
                "sha256": "03317f25bf498a3c52a9bb5ecdf4fe992c1602da150705c315b4458334bac197"
            },
            "downloads": -1,
            "filename": "genWizard-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "dcda5ac254eef0eaf589074d3334c77b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5175,
            "upload_time": "2023-06-14T15:48:11",
            "upload_time_iso_8601": "2023-06-14T15:48:11.267571Z",
            "url": "https://files.pythonhosted.org/packages/20/60/58bb884648e8504acfc95aace2986b58ef067eab025befe6fac7e4144a5c/genWizard-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-14 15:48:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ykim336",
    "github_project": "genWizard",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "genwizard"
}
        
Elapsed time: 0.07835s