diff --git a/dev_gpt/apis/gpt.py b/dev_gpt/apis/gpt.py index 5063344..c6ad1be 100644 --- a/dev_gpt/apis/gpt.py +++ b/dev_gpt/apis/gpt.py @@ -182,7 +182,7 @@ def ask_gpt(prompt_template: str, parser=identity_parser, **kwargs): kwargs[key] = json.dumps(value, indent=4) prompt = prompt_template.format(**kwargs) conversation = GPTSession._instance.get_conversation( - [], + [SystemMessage(content='You are a helpful AI assistant that follows instructions from the user exactly.')], print_stream=os.environ['VERBOSE'].lower() == 'true', print_costs=False ) diff --git a/dev_gpt/options/generate/chains/auto_refine_description.py b/dev_gpt/options/generate/chains/auto_refine_description.py index b5b5920..abaf289 100644 --- a/dev_gpt/options/generate/chains/auto_refine_description.py +++ b/dev_gpt/options/generate/chains/auto_refine_description.py @@ -59,4 +59,5 @@ Write an updated microservice description by incorporating information about the Note: You must not mention any details about algorithms or the technical implementation. Note: You must not mention that there is a request and response JSON schema Note: You must not use any formatting like triple backticks. -Note: If an external API is mentioned in the description, then you must mention the API in the updated description as well.''' +Note: If Google Custom Search or gpt-3.5-turbo is mentioned in the description, then you must mention them in the updated description as well. +Note: If an external API besides Google Custom Search and gpt-3.5-turbo is mentioned in the description, then you must mention the API in the updated description as well.''' diff --git a/dev_gpt/options/generate/chains/question_answering.py b/dev_gpt/options/generate/chains/question_answering.py index 6216200..582756f 100644 --- a/dev_gpt/options/generate/chains/question_answering.py +++ b/dev_gpt/options/generate/chains/question_answering.py @@ -38,9 +38,11 @@ Note: You must not answer the question. Instead, give up to 5 bullet points (10 question_prompt = '''\ # Context {text} -# Question -{question} + # Pros and Cons {pros_and_cons} -Note: You must answer "yes" or "no". + +# Question +Based on the pros and cons, answer the following question: {question} +Note: You must answer the question correctly by saying "yes" or "no". ''' diff --git a/dev_gpt/options/generate/pm/pm.py b/dev_gpt/options/generate/pm/pm.py index 83a3d98..3c5a525 100644 --- a/dev_gpt/options/generate/pm/pm.py +++ b/dev_gpt/options/generate/pm/pm.py @@ -52,15 +52,19 @@ Description of the microservice: ) test_description += self.user_input_extension_if_needed( - context, - microservice_description, + { + 'Microservice description': microservice_description, + 'Request schema': context['request_schema'], + 'Response schema': context['response_schema'], + }, condition_question='Does the request schema provided include a property that represents a file?', question_gen='Generate a question that requests for an example file url.', extension_name='Input Example', ) microservice_description += self.user_input_extension_if_needed( - context, - microservice_description, + { + 'Microservice description': microservice_description, + }, condition_question='''\ Does the microservice send requests to an API beside the Google Custom Search API and gpt-3.5-turbo?''', question_gen='Generate a question that asks for the endpoint of the external API and an example of a request and response when interacting with the external API.', @@ -72,18 +76,13 @@ Does the microservice send requests to an API beside the Google Custom Search AP def user_input_extension_if_needed( self, context, - microservice_description, condition_question, question_gen, extension_name, post_transformation_fn=None ): user_answer = get_user_input_if_needed( - context={ - 'Microservice description': microservice_description, - 'Request schema': context['request_schema'], - 'Response schema': context['response_schema'], - }, + context=context, conditions=[ is_question_true(condition_question), ], diff --git a/dev_gpt/options/generate/tools/tools.py b/dev_gpt/options/generate/tools/tools.py index 02eebda..a658372 100644 --- a/dev_gpt/options/generate/tools/tools.py +++ b/dev_gpt/options/generate/tools/tools.py @@ -4,6 +4,6 @@ import os def get_available_tools(): tools = ['gpt-3.5-turbo (for any kind of text processing like summarization, paraphrasing, etc.)'] if os.environ.get('GOOGLE_API_KEY') and os.environ.get('GOOGLE_CSE_ID'): - tools.append('Google Custom Search API') + tools.append('Google Custom Search') chars = 'abcdefghijklmnopqrstuvwxyz' return '\n'.join([f'{char}) {tool}' for tool, char in zip(tools, chars)]) \ No newline at end of file