From 3836ee50095b92989d3cbda5bb1b91fbf92ed9de Mon Sep 17 00:00:00 2001 From: Hunter Date: Sun, 1 Sep 2024 23:09:53 -0400 Subject: [PATCH] added override extension --- extensions/chatgpt/chatgpt.py | 148 ++++++++++++++--------------- extensions/claude/claude.py | 3 - extensions/hackaday/hackaday.py | 27 +++--- extensions/npr/npr.py | 4 +- extensions/override/override.py | 48 ++++++++++ extensions/wiby/wiby.py | 152 +++++++++++++++++++++++------- extensions/wikipedia/wikipedia.py | 2 +- html_utils.py | 54 +++++------ proxy.py | 30 +++++- 9 files changed, 306 insertions(+), 162 deletions(-) create mode 100644 extensions/override/override.py diff --git a/extensions/chatgpt/chatgpt.py b/extensions/chatgpt/chatgpt.py index b920709..b99c373 100644 --- a/extensions/chatgpt/chatgpt.py +++ b/extensions/chatgpt/chatgpt.py @@ -1,7 +1,6 @@ from flask import request, render_template_string from openai import OpenAI import extensions.config as config -from html_utils import transcode_html # Initialize the OpenAI client with your API key client = OpenAI(api_key=config.open_ai_api_key) @@ -13,97 +12,94 @@ previous_model = selected_model system_prompts = [ - {"role": "system", "content": "Please provide your response in plain text using only ASCII characters. " - "Never use any special or esoteric characters that might not be supported by older systems. "}, - {"role": "system", "content": "Your responses will be presented to the user within " - "the body of an html document. Be aware that any html tags you respond with will be interpreted and rendered as html. " - "Therefore, when discussing an html tag, do not wrap it in <>, as it will be rendered as html. Instead, wrap the name " - "of the tag in tags to emphasize it, for example \"the a tag\". " - "You do not need to provide a tag. " - "When responding with a list, ALWAYS format it using
    or