-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add additional step with the agent to figure out if the query i…
…s related to the dconversation
- Loading branch information
Showing
11 changed files
with
140 additions
and
52 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
9 changes: 9 additions & 0 deletions
9
pandasai/assets/prompt_templates/check_if_relevant_to_conversation.tmpl
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,9 @@ | ||
<conversation> | ||
{conversation} | ||
</conversation> | ||
|
||
<query> | ||
{query} | ||
</query> | ||
|
||
Is the query related to the conversation? Answer only "true" or "false" (lowercase). |
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,9 @@ | ||
# TODO import all the dependencies required | ||
{default_import} | ||
|
||
def analyze_data(dfs: list[{engine_df_name}]) -> dict: | ||
""" | ||
{instructions} | ||
At the end, return a dictionary of: | ||
{output_type_hint} | ||
""" |
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,19 @@ | ||
""" Prompt to check if the query is related to the previous conversation | ||
<conversation> | ||
{conversation} | ||
</conversation> | ||
<query> | ||
{query} | ||
</query> | ||
Is the query related to the conversation? Answer only "true" or "false" (lowercase). | ||
""" | ||
from .file_based_prompt import FileBasedPrompt | ||
|
||
|
||
class CheckIfRelevantToConversationPrompt(FileBasedPrompt): | ||
"""Prompt to check if the query is related to the previous conversation""" | ||
|
||
_path_to_template = "assets/prompt_templates/check_if_relevant_to_conversation.tmpl" |
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