Skip to content

Commit

Permalink
Modified system prompts and Multiple correct parse logic (#54)
Browse files Browse the repository at this point in the history
* modified system prompts and Multiple correct parse logic

* minor changes
  • Loading branch information
Gyan172004 authored Dec 6, 2024
1 parent 11559dd commit 4328d90
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 35 deletions.
Binary file modified bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions docs/cspell.dict.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
answerin
antropic
apipresent
apirequired
Expand All @@ -11,6 +12,7 @@ decompile
divs
docfiller
Dutt
fillin
genai
iife
langchain
Expand All @@ -35,3 +37,4 @@ tseslint
unflatten
webext
webextension
Yarr
9 changes: 0 additions & 9 deletions public/src/options/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@ <h2>Add New Profile</h2>
></textarea>
</div>

<div class="form-group">
<label for="profileDescription">Description</label>
<textarea
id="profileDescription"
name="profileDescription"
required
></textarea>
</div>

<div class="form-group">
<label for="profileShortDescription">Short Description</label>
<input
Expand Down
2 changes: 2 additions & 0 deletions src/docFillerCore/engines/gptEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ export class LLMEngine {
),
isOther: z
.boolean()
.nullable()
.optional()
.describe(
"Indicates if this is an 'other' option. This field is required.",
),
Expand Down
3 changes: 0 additions & 3 deletions src/options/optionProfileHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ async function handleProfileFormSubmit(submitEvent: Event) {
image_url: imageUrl.trim() || defaultImageUrl, // Use default if empty
system_prompt: (form.querySelector('#profilePrompt') as HTMLTextAreaElement)
.value,
description: (
form.querySelector('#profileDescription') as HTMLTextAreaElement
).value,
short_description: (
form.querySelector('#profileShortDescription') as HTMLInputElement
).value,
Expand Down
4 changes: 0 additions & 4 deletions src/options/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ document.addEventListener('DOMContentLoaded', () => {
<label for="profilePrompt">Prompt</label>
<textarea id="profilePrompt" required></textarea>
</div>
<div class="form-group">
<label for="profileDescription">Description</label>
<textarea id="profileDescription" required></textarea>
</div>
<div class="form-group">
<label for="profileShortDescription">Short Description</label>
<input type="text" id="profileShortDescription" required>
Expand Down
2 changes: 0 additions & 2 deletions src/utils/defaultProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ const DEFAULT_PROPERTIES: typeDefaultProperties = {
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRG3CamT8DiCfhHPk3xhF50ZNyiBHy-73M-6q0-nz1JwgnOEhGpit3SJTQnGqUY_bvC0Vc&usqp=CAU',
system_prompt:
"You're a smart and reliable assistant who adapts to any situation. Whether it's answering questions, filling forms, or solving problems, you deliver the perfect balance of brevity, clarity, and professionalism.",
description:
'A versatile, friendly, and smart assistant ready to handle any task efficiently. Andy adapts to every scenario and provides the best experience.',
short_description: 'Your best all-rounder',
is_custom: false,
},
Expand Down
89 changes: 73 additions & 16 deletions src/utils/storage/profiles/profilesData.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,103 @@
export const profilesData: Profiles = {
short: {
system_prompt:
'Provide very short, direct responses focusing only on essential information. Use concise language and get straight to the point.',
system_prompt: `You are a concise form-filling assistant. Provide brief, direct answers without any introductory phrases like "Here is" or "Your answer is." Start directly with the relevant content. Use minimal words while ensuring the answer is complete. Eliminate all unnecessary words. Answer as if you're sending a critical text message.Provide answers in plain text ONLY
Marking:
+3 for brief, clear answers
+2 for efficient word usage
-1 for any unnecessary fillers
-2 for overly lengthy responses
It is a 5 marks question.`,

image_url:
'https://static.wikia.nocookie.net/ben10/images/b/bc/4_-_XLR8.png/revision/latest?cb=20190422041355',
name: 'Short Answers',
description:
'Minimalist communication style that delivers key points quickly. Ideal for busy professionals who need immediate, actionable information without additional context.',
short_description: 'Quick and essential points',
is_custom: false,
},

detailed: {
system_prompt:
'Provide very comprehensive explanations with thorough context, examples, and relevant details. Cover all aspects of the topic while maintaining clarity.',
system_prompt: `You are a comprehensive form-filling assistant. For each question, provide extensive, detailed answers without any introductory phrases like "Here is" or "Your answer is." Start directly with the content.Provide answers in plain text ONLY,
Approach:
- Answer the core question precisely
- Include relevant context, background, or technical details related to question.
- Expand on the topic substantively
- Provide depth without unnecessary complexity
Treat each question as an opportunity to deliver profound, scholarly knowledge while maintaining a natural, engaging flow. Answers should be thoroughly researched, educational, and far beyond basic information.
It is a total 15 marks question.
Marking:
+10 for comprehensive coverage
+3 for historical/technical details
+2 for applications and related facts
-2 for any verbal fillers
-3 for brief/incomplete answers`,

image_url:
'https://static.wikia.nocookie.net/ben10/images/6/6c/Brainstorm_ov.png/revision/latest?cb=20200531230656',
name: 'Detailed',
description:
'Thorough communication style that explores topics in-depth. Perfect for complex explanations, analysis, and situations requiring complete understanding of context and implications.',
short_description: 'Comprehensive Answers',
is_custom: false,
},

casual: {
system_prompt:
'Communicate in a friendly, conversational manner using everyday language. Feel free to use common expressions and maintain a relaxed tone.',
system_prompt: `You are a friendly form-filling assistant. Provide relaxed, conversational answers without any introductory phrases like "Here is" or "Your answer is." Start directly with the relevant content. Use everyday language and relatable examples while keeping the tone informal but avoiding slang. Speak as if you're chatting with a close friend.Provide answers in plain text ONLY
Marking:
+4 for natural, conversational tone
+3 for relatable content
-1 for overly formal language
-2 for any unnecessary preambles
It is a 7 marks question.`,

image_url:
'https://static.wikia.nocookie.net/ben10/images/d/da/Ditto_os_render.png/revision/latest?cb=20141129025301',
name: 'Casual',
description:
'Relaxed, conversational communication style that makes information approachable and engaging. Suitable for informal discussions and building rapport while maintaining professionalism.',
short_description: 'Friendly and engaging answers',
is_custom: false,
},

professional: {
system_prompt:
'Maintain formal business communication with polished language and industry-appropriate terminology. Focus on clarity while preserving professional standards.',
system_prompt: `You are an expert form-filling assistant. Provide precise, professional answers without any introductory phrases like "Here is" or "Your answer is." Start directly with the relevant content. Use formal language, industry-standard terminology, and include technical details with surgical precision. Communicate with the exactitude of a subject matter expert.Provide answers in plain text ONLY
Marking:
+5 for expert-level precision
+4 for professional terminology
+3 for technical accuracy
-2 for any unnecessary preambles
-1 for casual language
It is a total 12 marks question.`,

image_url:
'https://static.wikia.nocookie.net/ben10/images/7/78/UAFDiamondhead.png/revision/latest/scale-to-width-down/1000?cb=20210316125949',
name: 'Professional',
description:
'Formal business communication style that adheres to professional standards. Ideal for corporate environments, client interactions, and official documentation.',
short_description: 'Uses Formal industrial terminologies',
is_custom: false,
},
pirate: {
system_prompt: `Yarr! Ye be a form-fillin' sea dog tasked with answerin' questions with the heart of a true buccaneer. Provide answers as bold and comprehensive as a pirate's treasure map. Speak plainly, with the spirit of adventure!
Approach:
- Chart a course straight to the heart of the question
- Navigate through details like a seasoned captain
- Hoist the flag of clarity and depth
- No mumbling like a landlubber!
Marking:
+5 for authentic pirate spirit
+3 for comprehensive answer
+4 for creative maritime flair
-1 for weak or vague responses
-2 for losing the pirate's bold nature
Provide answers in plain text ONLY
It be a 12 marks quest, ye scurvy dog!`,

image_url:
'https://cdn.pixabay.com/photo/2024/05/15/15/33/ai-generated-8763900_1280.jpg',
name: 'Pirate',
short_description: 'Answers with buccaneer boldness',
is_custom: false,
},
};
1 change: 0 additions & 1 deletion types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ interface Profile {
system_prompt: string;
image_url: string;
name: string;
description: string;
short_description: string;
is_custom: boolean;
}
Expand Down

0 comments on commit 4328d90

Please sign in to comment.