Giter Site home page Giter Site logo

Comments (4)

Sponge-bink avatar Sponge-bink commented on July 28, 2024 1

I want this too! Would be great to switch between several system prompts by just typing something like cfswitch to choose from results from Script Filter and add a custom one by adding an argument to it. After which you invoke a typical query with the system prompts.

Would also be great if you can name each prompt (Code explanation, Translate engine) and show the name as a part of the subtext during a typical query…

I may want to work on this someday :P

from chatfred.

gleitz avatar gleitz commented on July 28, 2024

Now that I look at the extension, wondering what the difference between the "jailbreak prompt" and and a system prompt might be.

from chatfred.

chrislemke avatar chrislemke commented on July 28, 2024

Hey @gleitz!
Very good question ;-).
To be precise, the jailbreak prompt is actually just another user prompt. check out the code:

def create_message(prompt: str) -> List[Dict[str, str]]:
    """Creates a message to be sent to the model.

    Args:
        prompt (str): The prompt to be included in the message.

    Returns:
        List[Dict[str, str]]: A list of dictionaries representing the message,
            with each dictionary containing the role and content of the message.
    """
    transformation_pre_prompt = """You are a helpful assistant who interprets every input as raw
    text unless instructed otherwise. Your answers do not include a description unless prompted to do so.
    Also drop any "`" characters from the your response."""

    if __text_transformation_prompt:
        return [
            {"role": "system", "content": transformation_pre_prompt},
            {
                "role": "user",
                "content": f"{__text_transformation_prompt} Don't add any comments: {prompt}",
            },
        ]

    messages = [{"role": "system", "content": "You are a helpful assistant"}]
    for user_text, assistant_text in read_from_log():
        if user_text == __jailbreak_prompt:
            continue
        messages.append({"role": "user", "content": user_text})
        messages.append({"role": "assistant", "content": assistant_text})

    if __jailbreak_prompt and __unlocked == 1:
        messages.append({"role": "user", "content": __jailbreak_prompt})
        messages.append({"role": "assistant", "content": "Okay! How can I help?"})

    messages.append({"role": "user", "content": prompt})
    return messages

Feel free to create a pull request in case you want to contribute!

from chatfred.

chrislemke avatar chrislemke commented on July 28, 2024

Nice idea. I will move this "issue" into the discussions. @Sponge-bink feel free to create a PR. Thanks in advance.

from chatfred.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.