From 1b0c2d54612e025951d002282d456a78e1324d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Ho=CC=88nicke?= Date: Mon, 15 May 2023 10:54:32 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20feat:=20enable=20cors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev_gpt/options/generate/pm/pm.py | 2 +- dev_gpt/options/generate/static_files/gateway/custom_gateway.py | 1 + dev_gpt/options/generate/static_files/gateway/requirements.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dev_gpt/options/generate/pm/pm.py b/dev_gpt/options/generate/pm/pm.py index 7f3dfa5..65a7d43 100644 --- a/dev_gpt/options/generate/pm/pm.py +++ b/dev_gpt/options/generate/pm/pm.py @@ -61,7 +61,7 @@ Description of the microservice: context, microservice_description, condition_question='Does the microservice send requests to an API?', - question_gen='Generate a question that asks for the endpoint and an example of a request and response when interacting with the external API.', + 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.', extension_name='Example of API usage', post_transformation_fn=translation(from_format='api instruction', to_format='python code snippet raw without formatting') ) diff --git a/dev_gpt/options/generate/static_files/gateway/custom_gateway.py b/dev_gpt/options/generate/static_files/gateway/custom_gateway.py index 766a6c4..c84e9f9 100644 --- a/dev_gpt/options/generate/static_files/gateway/custom_gateway.py +++ b/dev_gpt/options/generate/static_files/gateway/custom_gateway.py @@ -79,6 +79,7 @@ class CustomGateway(CompositeGateway): f'Please, let http port ({http_port}) be 8080 for nginx to work' ) kwargs['runtime_args']['port'][http_idx] = 8082 + kwargs['cors'] = True super().__init__(**kwargs) # remove potential clashing arguments from kwargs diff --git a/dev_gpt/options/generate/static_files/gateway/requirements.txt b/dev_gpt/options/generate/static_files/gateway/requirements.txt index 91d328c..a5ab956 100644 --- a/dev_gpt/options/generate/static_files/gateway/requirements.txt +++ b/dev_gpt/options/generate/static_files/gateway/requirements.txt @@ -1,3 +1,4 @@ streamlit==1.16.0 +altair==4.2.2 extra-streamlit-components==0.1.55 jina==3.15.1.dev14 \ No newline at end of file