From 41e3c4f6bdf3076bbded57067fca71d1fb5fb624 Mon Sep 17 00:00:00 2001 From: Toran Bruce Richards Date: Thu, 26 Sep 2024 15:20:05 +0100 Subject: [PATCH 1/6] Feat(Builder): Enhance AITextSummarizerBlock with configurable summary style and focus (#8165) * feat(platform): Enhance AITextSummarizerBlock with configurable summary style and focus The AITextSummarizerBlock in the autogpt_platform/backend/backend/blocks/llm.py file has been enhanced to include the following changes: - Added a new enum class, SummaryStyle, with options for concise, detailed, bullet points, and numbered list styles. - Added a new input parameter, focus, to specify the topic of the summary. - Modified the _summarize_chunk method to include the style and focus in the prompt. - Modified the _combine_summaries method to include the style and focus in the prompt. These changes allow users to customize the style and focus of the generated summaries, providing more flexibility and control. * run formatting and linting --- autogpt_platform/backend/backend/blocks/llm.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/autogpt_platform/backend/backend/blocks/llm.py b/autogpt_platform/backend/backend/blocks/llm.py index bafbaba0f..f510d680f 100644 --- a/autogpt_platform/backend/backend/blocks/llm.py +++ b/autogpt_platform/backend/backend/blocks/llm.py @@ -362,6 +362,13 @@ class AITextGeneratorBlock(Block): yield "error", str(e) +class SummaryStyle(Enum): + CONCISE = "concise" + DETAILED = "detailed" + BULLET_POINTS = "bullet points" + NUMBERED_LIST = "numbered list" + + class AITextSummarizerBlock(Block): class Input(BlockSchema): text: str @@ -370,6 +377,8 @@ class AITextSummarizerBlock(Block): default=LlmModel.GPT4_TURBO, description="The language model to use for summarizing the text.", ) + focus: str = "general information" + style: SummaryStyle = SummaryStyle.CONCISE api_key: BlockSecret = SecretField(value="") # TODO: Make this dynamic max_tokens: int = 4000 # Adjust based on the model's context window @@ -440,7 +449,7 @@ class AITextSummarizerBlock(Block): raise ValueError("Failed to get a response from the LLM.") def _summarize_chunk(self, chunk: str, input_data: Input) -> str: - prompt = f"Summarize the following text concisely:\n\n{chunk}" + prompt = f"Summarize the following text in a {input_data.style} form. Focus your summary on the topic of `{input_data.focus}` if present, otherwise just provide a general summary:\n\n```{chunk}```" llm_response = self.llm_call( AIStructuredResponseGeneratorBlock.Input( @@ -454,13 +463,10 @@ class AITextSummarizerBlock(Block): return llm_response["summary"] def _combine_summaries(self, summaries: list[str], input_data: Input) -> str: - combined_text = " ".join(summaries) + combined_text = "\n\n".join(summaries) if len(combined_text.split()) <= input_data.max_tokens: - prompt = ( - "Provide a final, concise summary of the following summaries:\n\n" - + combined_text - ) + prompt = f"Provide a final summary of the following section summaries in a {input_data.style} form, focus your summary on the topic of `{input_data.focus}` if present:\n\n ```{combined_text}```\n\n Just respond with the final_summary in the format specified." llm_response = self.llm_call( AIStructuredResponseGeneratorBlock.Input( From beedc4b9714c68d9a662615e44f585ab5982860f Mon Sep 17 00:00:00 2001 From: Swifty Date: Thu, 26 Sep 2024 17:09:01 +0200 Subject: [PATCH 2/6] tweak(platform): Updated onOpenChange code style (#8187) --- .../frontend/src/components/edit/control/BlocksControl.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx b/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx index e09017fef..cfea58996 100644 --- a/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx +++ b/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx @@ -77,11 +77,7 @@ export const BlocksControl: React.FC = ({ return ( { - if (!open) { - resetFilters(); - } - }} + onOpenChange={(open) => open || resetFilters()} > From 351fdcef3281bb75492d736547808ecac9d4bd51 Mon Sep 17 00:00:00 2001 From: Toran Bruce Richards Date: Thu, 26 Sep 2024 16:25:12 +0100 Subject: [PATCH 3/6] Update broken link in setup.md --- docs/content/server/setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/server/setup.md b/docs/content/server/setup.md index 3a33fc781..af05b4d97 100644 --- a/docs/content/server/setup.md +++ b/docs/content/server/setup.md @@ -9,7 +9,7 @@ This guide will help you setup the server and builder for the project. -We also offer this in video format. You can check it out [here](https://github.com/Significant-Gravitas/AutoGPT#how-to-get-started). +We also offer this in video format. You can check it out [here](https://github.com/Significant-Gravitas/AutoGPT?tab=readme-ov-file#how-to-setup-for-self-hosting). !!! warning **DO NOT FOLLOW ANY OUTSIDE TUTORIALS AS THEY WILL LIKELY BE OUT OF DATE** From 007a773296435c335c90d424c207d252965d48fc Mon Sep 17 00:00:00 2001 From: Aarushi <50577581+aarushik93@users.noreply.github.com> Date: Thu, 26 Sep 2024 16:56:36 +0100 Subject: [PATCH 4/6] fix(infra): Add missing quotes in helm values (#8193) fix missing quotes --- autogpt_platform/infra/helm/autogpt-server/values.dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogpt_platform/infra/helm/autogpt-server/values.dev.yaml b/autogpt_platform/infra/helm/autogpt-server/values.dev.yaml index 8d80932ae..5d17aa407 100644 --- a/autogpt_platform/infra/helm/autogpt-server/values.dev.yaml +++ b/autogpt_platform/infra/helm/autogpt-server/values.dev.yaml @@ -85,7 +85,7 @@ env: NUM_NODE_WORKERS: 5 REDIS_HOST: "redis-dev-master.redis-dev.svc.cluster.local" REDIS_PORT: "6379" - BACKEND_CORS_ALLOW_ORIGINS: ["https://dev-builder.agpt.co"] + BACKEND_CORS_ALLOW_ORIGINS: '["https://dev-builder.agpt.co"]' SUPABASE_SERVICE_ROLE_KEY: "" GITHUB_CLIENT_ID: "" GITHUB_CLIENT_SECRET: "" From 0d8dfaf31243bbbf1b0c831e4f029b435c8e30c8 Mon Sep 17 00:00:00 2001 From: Toran Bruce Richards Date: Thu, 26 Sep 2024 16:57:17 +0100 Subject: [PATCH 5/6] tweak(docs): Update setup.md with git instructions. (#8192) Update setup.md with git instructions. --- docs/content/server/setup.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/content/server/setup.md b/docs/content/server/setup.md index af05b4d97..d6ffa7842 100644 --- a/docs/content/server/setup.md +++ b/docs/content/server/setup.md @@ -20,6 +20,7 @@ To setup the server, you need to have the following installed: - [Node.js](https://nodejs.org/en/) - [Docker](https://docs.docker.com/get-docker/) +- [Git](https://git-scm.com/downloads) ### Checking if you have Node.js & NPM installed @@ -59,6 +60,16 @@ docker-compose -v Once you have Docker and Docker Compose installed, you can proceed to the next step. +## Cloning the Repository +The first step is cloning the AutoGPT repository to your computer. +To do this, open a terminal window in a folder on your computer and run: +``` +git clone https://github.com/Significant-Gravitas/AutoGPT.git +``` +If you get stuck, follow [this guide](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository). + +Once that's complete you can close this terminal window. + ## Running the backend services To run the backend services, follow these steps: From 9fd6d3df423477e32921ec705af398da3241aea8 Mon Sep 17 00:00:00 2001 From: Aarushi <50577581+aarushik93@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:02:08 +0100 Subject: [PATCH 6/6] tweak(platform): Remove unused supabase services in docker compose (#8178) remove unused supabase services --- autogpt_platform/docker-compose.yml | 30 ----------------------------- 1 file changed, 30 deletions(-) diff --git a/autogpt_platform/docker-compose.yml b/autogpt_platform/docker-compose.yml index be6f1f49e..dcde6567f 100644 --- a/autogpt_platform/docker-compose.yml +++ b/autogpt_platform/docker-compose.yml @@ -96,36 +96,6 @@ services: file: ./supabase/docker/docker-compose.yml service: rest - realtime: - <<: *supabase-services - extends: - file: ./supabase/docker/docker-compose.yml - service: realtime - - storage: - <<: *supabase-services - extends: - file: ./supabase/docker/docker-compose.yml - service: storage - - imgproxy: - <<: *supabase-services - extends: - file: ./supabase/docker/docker-compose.yml - service: imgproxy - - meta: - <<: *supabase-services - extends: - file: ./supabase/docker/docker-compose.yml - service: meta - - functions: - <<: *supabase-services - extends: - file: ./supabase/docker/docker-compose.yml - service: functions - analytics: <<: *supabase-services extends: