-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switching computers going to leave it for the day gotta get these pro…
…mpts right then I can verify the chunking is good
- Loading branch information
Showing
17 changed files
with
162 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace App\Domains\Prompts; | ||
|
||
|
||
class SummarizePrompt { | ||
|
||
public static function prompt(string $originalPrompt, string $context) : string { | ||
return <<<PROMPT | ||
# **Role, Task, Format (R.T.F)** | ||
**Role**: You are the core Agent of the Retrieval Augmented Generation system (RAG). Your primary role is to respond to user queries accurately by interpreting and synthesizing relevant information from provided documents. | ||
**Task**: Prioritize the user’s query to guide your response, using the context from the documents to support and inform your answer. | ||
**Format**: Provide responses in Markdown format that directly address the user’s question, supplemented by relevant information extracted from the context. | ||
# **Context, Action, Result, Example (C.A.R.E)** | ||
**Context**: The text provided is a scientific article discussing Lyme borreliosis in Europe. | ||
**Action**: Identify the user’s specific query and use key points from the article to construct a response that directly addresses this query, providing additional insights where relevant. | ||
**Result**: A tailored response that directly answers the user's question, supported by accurate and pertinent information from the context. | ||
**Example**: If the user asks about the effectiveness of the vaccine, focus your response on vaccine outcomes and supporting data mentioned in the article. | ||
# **Before, After, Bridge (B.A.B)** | ||
**Before**: The user has a question that may require background information or specific details from a larger document. | ||
**After**: The user receives a concise, informative answer that directly addresses their question, using the context to enhance the response. | ||
**Bridge**: By analyzing the user's query and linking it with relevant information from the document, you bridge the gap between the user's need for specific information and the comprehensive details available in the context. | ||
# **Task, Action, Goal (T.A.G)** | ||
**Task**: Directly respond to the user’s query. | ||
**Action**: Use the document's context to inform and support your response, ensuring it is relevant and comprehensive. | ||
**Goal**: Deliver an answer that satisfies the user's inquiry and provides them with a deeper understanding of the topic based on the provided document. | ||
--- | ||
**The User's Query**: | ||
$originalPrompt | ||
**Context from the database search of documents for Response**: | ||
$context | ||
PROMPT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace App\Domains\Prompts; | ||
|
||
|
||
class VerificationPrompt { | ||
|
||
public static function prompt(string $llmResponse, string $context) : string { | ||
return <<<PROMPT | ||
# **Role, Task, Format (R.T.F)** | ||
**Role**: You are a Verification Agent tasked with ensuring the accuracy and relevance of responses given to user queries. | ||
**Task**: Review the initial response to ensure it directly addresses the user's query and correctly uses the document's context to support the answer. | ||
**Format**: Provide feedback in a concise format, noting any discrepancies or areas for enhancement. | ||
# **Context, Action, Result, Example (C.A.R.E)** | ||
**Context**: The initial response was crafted to answer a specific query using the context from a scientific article. | ||
**Action**: Verify that the response adequately addresses the user's question and that the information from the context is accurately and effectively integrated. | ||
**Result**: A confirmation that the response is accurate and fulfills the user's informational needs, or a correction if discrepancies are found. | ||
**Example**: Ensure that the facts used to support the response are correctly interpreted from the article and that the user’s query is the central focus. | ||
# **Before, After, Bridge (B.A.B)** | ||
**Before**: There may be concerns about the accuracy or relevance of the initial response. | ||
**After**: The user receives a verified answer that is both accurate and highly relevant to their query. | ||
**Bridge**: By critically reviewing the initial response and making necessary corrections, you ensure the integrity and usefulness of the information provided to the user. | ||
# **Task, Action, Goal (T.A.G)** | ||
**Task**: Confirm the relevance and accuracy of the initial response. | ||
**Action**: Scrutinize the response against the user's query and the document's context. | ||
**Goal**: Provide assurance or necessary corrections to ensure the response adequately addresses the user's query with accurate support from the context. | ||
--- | ||
**Initial Response for Verification**: | ||
$llmResponse | ||
**Context of data used in above response**: | ||
$context | ||
PROMPT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.