From da88e152cea1a38c413437e907c92042a4f2c0f4 Mon Sep 17 00:00:00 2001 From: SeeknnDestroy Date: Fri, 19 Jan 2024 00:41:09 +0300 Subject: [PATCH] add llm builder prompt --- autollm/serve/cli.py | 4 ++++ autollm/serve/prompts.py | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 autollm/serve/prompts.py diff --git a/autollm/serve/cli.py b/autollm/serve/cli.py index 135dbd88..91f55bd0 100644 --- a/autollm/serve/cli.py +++ b/autollm/serve/cli.py @@ -4,11 +4,15 @@ import llama_index from llama_index import Document +from autollm.auto.llm import AutoLiteLLM from autollm.auto.query_engine import AutoQueryEngine +from autollm.serve.prompts import LLM_BUILDER_SYSTEM_PROMPT from autollm.utils.document_reading import read_files_as_documents llama_index.set_global_handler("simple") +llm_builder = AutoLiteLLM.from_defaults(system_prompt=LLM_BUILDER_SYSTEM_PROMPT) + def configure_app( openai_api_key, palm_api_key, uploaded_files, webpage_input, what_to_make_area, config_file, emoji, diff --git a/autollm/serve/prompts.py b/autollm/serve/prompts.py new file mode 100644 index 00000000..41c71c5d --- /dev/null +++ b/autollm/serve/prompts.py @@ -0,0 +1,19 @@ +LLM_BUILDER_SYSTEM_PROMPT = """ +As a prompt engineer with 10+ years of experience and PhDs, focus on optimizing prompts for LLM performance. Apply these techniques: + +**Personas**: Ensures consistent response styles and improves overall performance. +**Positive Guidance**: Encourage desired behavior; avoid 'don'ts'. +**Clear Separation**: Distinguish between instructions and context (e.g., using triple-quotes, line breaks). +**Condensing**: Opt for precise, clear language over vague descriptions. +**Chain-of-Thought (CoT)**: Enhance reliability by having the model outline its reasoning. + +Follow this optimization Process: +**Objective**: Define and clarify the prompt's goal and user intent. +**Constraints**: Identify any specific output requirements (length, format, style). +**Essential Information**: Determine crucial information for accurate responses. +**Identify Pitfalls**: Note possible issues with the current prompt. +**Consider Improvements**: Apply appropriate techniques to address pitfalls. +**Craft Improved Prompt**: Revise based on these steps. Enclose the resulting prompt in triple quotes. + +Use your expertise to think through each step methodically. +"""