From 4b1dad96cd4a7d90af5d85fc4aae0ac0dcc53343 Mon Sep 17 00:00:00 2001 From: Ayan Joshi Date: Sun, 8 Oct 2023 12:42:56 +0530 Subject: [PATCH 1/3] Commit --- application/prompts/custom_prompt.txt | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 application/prompts/custom_prompt.txt diff --git a/application/prompts/custom_prompt.txt b/application/prompts/custom_prompt.txt new file mode 100644 index 0000000..054da1e --- /dev/null +++ b/application/prompts/custom_prompt.txt @@ -0,0 +1,34 @@ +Welcome to the custom prompt file. You can use this file to create prompts for various tasks or experiments. Below are some examples of prompts you can use: + +1. *Summarization Task:* + + Prompt: Summarize the following article in 3-4 sentences. + Input: [Insert article here] + Output: Summarized article + +2. *Translation Task:* + + Prompt: Translate the English text into French. + Input: "Hello, how are you?" + Output: "Bonjour, comment ça va ?" + +3. *Coding Task:* + + Prompt: Write a Python function that calculates the factorial of a given number. + Input: (Provide any specific number) + Output: (Gives factorial of the number) + +4. *Question-Answering Task:* + + Prompt: Answer the following question based on the given passage. + Input: [Insert passage here] + Question: [Insert question here] + Output: [Provided answer of the question] + +5. *Story Generation Task:* + + Prompt: Generate a short story about a detective solving a mystery. + Input: [Provide any additional context or details] + Output: [Gives short summary of the story] + +Feel free to customize and add your own prompts to this file. Each section includes a prompt and optional input. Happy Coding ! \ No newline at end of file From c688656607a6be2cbdf57038a75bf533556fb4ab Mon Sep 17 00:00:00 2001 From: Ayan Joshi Date: Mon, 9 Oct 2023 14:27:59 +0530 Subject: [PATCH 2/3] Commit --- application/prompts/custom_prompt.txt | 34 -------------------- docs/pages/Guides/Customising-prompts.md | 40 ++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 36 deletions(-) delete mode 100644 application/prompts/custom_prompt.txt diff --git a/application/prompts/custom_prompt.txt b/application/prompts/custom_prompt.txt deleted file mode 100644 index 054da1e..0000000 --- a/application/prompts/custom_prompt.txt +++ /dev/null @@ -1,34 +0,0 @@ -Welcome to the custom prompt file. You can use this file to create prompts for various tasks or experiments. Below are some examples of prompts you can use: - -1. *Summarization Task:* - - Prompt: Summarize the following article in 3-4 sentences. - Input: [Insert article here] - Output: Summarized article - -2. *Translation Task:* - - Prompt: Translate the English text into French. - Input: "Hello, how are you?" - Output: "Bonjour, comment ça va ?" - -3. *Coding Task:* - - Prompt: Write a Python function that calculates the factorial of a given number. - Input: (Provide any specific number) - Output: (Gives factorial of the number) - -4. *Question-Answering Task:* - - Prompt: Answer the following question based on the given passage. - Input: [Insert passage here] - Question: [Insert question here] - Output: [Provided answer of the question] - -5. *Story Generation Task:* - - Prompt: Generate a short story about a detective solving a mystery. - Input: [Provide any additional context or details] - Output: [Gives short summary of the story] - -Feel free to customize and add your own prompts to this file. Each section includes a prompt and optional input. Happy Coding ! \ No newline at end of file diff --git a/docs/pages/Guides/Customising-prompts.md b/docs/pages/Guides/Customising-prompts.md index 1d3a7d4..e2e2613 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -1,4 +1,40 @@ -## To customize a main prompt navigate to `/application/prompt/combine_prompt.txt` +# Customizing the Main Prompt -You can try editing it to see how the model responses. +To customize the main prompt for DocsGPT, follow these steps: + +1. Navigate to `/application/prompt/combine_prompt.txt`. + +2. Edit the `combine_prompt.txt` file to modify the prompt text. You can experiment with different phrasings and structures to see how the model responds. + +## Example Prompt Modification + +**Original Prompt:** +```markdown +QUESTION: How to merge tables in pandas? +========= +Content: pandas provides various facilities for easily combining together Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. +Source: 28-pl +Content: pandas provides a single function, merge(), as the entry point for all standard database join operations between DataFrame or named Series objects: \n\npandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, indicator=False, validate=None) +Source: 30-pl +========= +FINAL ANSWER: To merge two tables in pandas, you can use the pd.merge() function. The basic syntax is: \n\npd.merge(left, right, on, how) \n\nwhere left and right are the two tables to merge, on is the column to merge on, and how is the type of merge to perform. \n\nFor example, to merge the two tables df1 and df2 on the column 'id', you can use: \n\npd.merge(df1, df2, on='id', how='inner') +SOURCES: 28-pl 30-pl + + +## Modified Prompt (for illustration): + +QUESTION: Explain the concept of pandas merge in Python. +========= +Content: The pandas merge function in Python allows you to combine DataFrame objects by performing SQL-style joins. It is a powerful tool for data manipulation and analysis. +Source: Official pandas documentation +Content: You can use the merge function with various options such as 'how,' 'on,' 'left_on,' and 'right_on' to control how the merging is done. +Source: Data science tutorial blog +========= +FINAL ANSWER: To perform a pandas merge in Python, use the `pd.merge()` function. This function takes two DataFrames as input and merges them based on the specified columns. For example, to merge DataFrames `df1` and `df2` on the 'key' column, you can use: `pd.merge(df1, df2, on='key', how='inner')`. +SOURCES: Official pandas documentation, Data science tutorial blog + + +## Conclusion + +Customizing the main prompt for DocsGPT allows you to tailor the AI's responses to your unique requirements. Whether you need in-depth explanations, code examples, or specific insights, you can achieve it by modifying the main prompt. Remember to experiment and fine-tune your prompts to get the best results. From d7b28a35867e5751aa4f735d5af0bbbf120dca2a Mon Sep 17 00:00:00 2001 From: Ayan Joshi Date: Tue, 10 Oct 2023 19:10:24 +0530 Subject: [PATCH 3/3] Update Customising-prompts.md --- docs/pages/Guides/Customising-prompts.md | 32 ++++++++---------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/docs/pages/Guides/Customising-prompts.md b/docs/pages/Guides/Customising-prompts.md index e2e2613..2426974 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -10,28 +10,16 @@ To customize the main prompt for DocsGPT, follow these steps: **Original Prompt:** ```markdown -QUESTION: How to merge tables in pandas? -========= -Content: pandas provides various facilities for easily combining together Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. -Source: 28-pl -Content: pandas provides a single function, merge(), as the entry point for all standard database join operations between DataFrame or named Series objects: \n\npandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, indicator=False, validate=None) -Source: 30-pl -========= -FINAL ANSWER: To merge two tables in pandas, you can use the pd.merge() function. The basic syntax is: \n\npd.merge(left, right, on, how) \n\nwhere left and right are the two tables to merge, on is the column to merge on, and how is the type of merge to perform. \n\nFor example, to merge the two tables df1 and df2 on the column 'id', you can use: \n\npd.merge(df1, df2, on='id', how='inner') -SOURCES: 28-pl 30-pl - - -## Modified Prompt (for illustration): - -QUESTION: Explain the concept of pandas merge in Python. -========= -Content: The pandas merge function in Python allows you to combine DataFrame objects by performing SQL-style joins. It is a powerful tool for data manipulation and analysis. -Source: Official pandas documentation -Content: You can use the merge function with various options such as 'how,' 'on,' 'left_on,' and 'right_on' to control how the merging is done. -Source: Data science tutorial blog -========= -FINAL ANSWER: To perform a pandas merge in Python, use the `pd.merge()` function. This function takes two DataFrames as input and merges them based on the specified columns. For example, to merge DataFrames `df1` and `df2` on the 'key' column, you can use: `pd.merge(df1, df2, on='key', how='inner')`. -SOURCES: Official pandas documentation, Data science tutorial blog +You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible. +Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses. +You have access to chat history, and can use it to help answer the question. +When using code examples, use the following format: + +(code) +{summaries} + +Thank you + ## Conclusion