/yapping

Verbosity control for AI agents

Primary LanguagePythonMIT LicenseMIT

Absolutely! Here's the updated README:


YAPPING - Yet Another Prompted Phrasing and INteraction Guidance tool

YAPPING (Yet Another Prompted Phrasing and INteraction Guidance) is a tool designed to control and enhance the verbosity of language model responses. By providing detailed guidance and interaction management, YAPPING ensures that the outputs from language models are either delightfully verbose or succinctly brief as needed.

Features

  • Prompted Phrasing: Customize the verbosity of responses to match specific requirements.
  • Speculative Shushing: A proprietary technique to predictively reduce verbosity before it happens.
  • Exuberant Elaboration: Ensures responses are enriched with additional, often unnecessary, details.

Installation

To install YAPPING, use pip:

pip install yapping

Getting Started

Here's a quick example to get you started with YAPPING:

Making Responses Verbose

from yapping import Yapping, make_verbose

yapping = Yapping(verbosity_level="high")

# Use Yapping decorator to make a response verbose
@make_verbose(yapping)
def get_response():
    return "This is the raw response from the language model."

verbose_response = get_response()
print(verbose_response)

Making Responses Brief

from yapping import Yapping, make_brief

# Initialize Yapping with a detailed and extensive configuration for brevity
config = {
    "verbosity_level_configuration_parameters": {
        "desired_verbosity_level": "low",
        "verbosity_control_strategy": "aggressive_reduction",
        "additional_reduction_parameters": {
            "max_length": 50,
            "minimize_redundancy": True,
            "enforce_conciseness": True
        },
        "speculative_shushing_mode": True,
        "anti-verbosity_neural_shrinkage": "enabled"
    }
}
yapping = Yapping(config)

# Use Yapping decorator to make a response brief
@make_brief(yapping)
def get_response():
    return "This is the raw response from the language model."

brief_response = get_response()
print(brief_response)

Configuration

YAPPING uses configuration files to define verbosity control rules. Here are examples of what these files might look like:

verbose_rules.json

{
    "rules_list": [
        {
            "pattern": ".*",
            "replacement": "To truly enhance and enrich the explanation of the topic at hand, it is imperative to incorporate a substantial amount of additional details and a plethora of diverse and illustrative examples. By delving deeply into the intricacies and nuances of the subject matter, we can ensure that the reader attains a comprehensive and multifaceted understanding. This extensive elaboration should encompass a broad spectrum of information, touching upon various dimensions and perspectives to provide a well-rounded and exhaustive exploration."
        }
    ]
}

brief_rules.json

{
    "rules_list": [
        {
            "pattern": ".*",
            "replacement": "No yapping."
        }
    ]
}

Contributing

Contributions are welcome! Please read our CONTRIBUTING.md file for guidelines on how to contribute to this project. Currently looking for typescript, rust, and CUDA contributions.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Special thanks to all the contributors and the open-source community for their support and collaboration.