From 073b38d48d0e9889d6849e040444482dbe6cae47 Mon Sep 17 00:00:00 2001 From: "Ian Christopher B. de Jesus" <3683356+iandjx@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:36:19 +0800 Subject: [PATCH 01/28] Convert humaninput checkbox to select --- webapp/src/components/TaskForm.tsx | 82 +++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 23 deletions(-) diff --git a/webapp/src/components/TaskForm.tsx b/webapp/src/components/TaskForm.tsx index 86582f78..326c53d9 100644 --- a/webapp/src/components/TaskForm.tsx +++ b/webapp/src/components/TaskForm.tsx @@ -133,6 +133,12 @@ export default function TaskForm({ const toolIds = toolState ? toolState.map(x => x?.value) : []; const datasourceIds = datasourceState ? datasourceState.map(x => x?.value) : []; const dedupedCombinedToolIds = [...new Set([...toolIds, ...datasourceIds])]; + + const displayOnlyFinalOutput = + taskState?.requiresHumanInput && (!formFields || formFields.length === 0) + ? false + : taskState.displayOnlyFinalOutput; + const body: any = { _csrf: e.target._csrf.value, resourceSlug, @@ -142,10 +148,10 @@ export default function TaskForm({ toolIds: dedupedCombinedToolIds || [], agentId: taskState?.agentId || null, asyncExecution: false, //e.target.asyncExecution.checked, - requiresHumanInput: e.target.requiresHumanInput.checked, + requiresHumanInput: taskState?.requiresHumanInput || null, context: taskState?.context || [], formFields: formFields || [], - displayOnlyFinalOutput: e.target.displayOnlyFinalOutput.checked, + displayOnlyFinalOutput, storeTaskOutput: e.target.storeTaskOutput.checked, taskOutputFileName: e.target.taskOutputFileName?.value, isStructuredOutput @@ -612,7 +618,6 @@ export default function TaskForm({ */} - {/* human_input tool checkbox */}
+
From 571c4f67686a77a2af54ad71589f1b401fae0f8f Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Tue, 10 Sep 2024 12:46:37 +1000 Subject: [PATCH 10/28] reduce vector-db-proxy logging verbosity in docker --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 16bb8679..ae164db5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -221,7 +221,7 @@ services: - WEBAPP_HOST=webapp_next - THREAD_PERCENTAGE_UTILISATION=0.8 - USE_GPU=false - - LOGGING_LEVEL=debug + - LOGGING_LEVEL=warn volumes: - datasource_files:/tmp From 1ff51bf7fe8e49defe928e69551a9d29c21e8b83 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Tue, 10 Sep 2024 12:52:10 +1000 Subject: [PATCH 11/28] Flatten source defined primary key so it doesnt get an extra nesting. Not actually the correct behaviour but we don't support multiple arrays of nested keys for primary keys anyway, so its OK for now. --- webapp/src/components/DatasourceStream.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/DatasourceStream.tsx b/webapp/src/components/DatasourceStream.tsx index ca38bc92..d0c42a57 100644 --- a/webapp/src/components/DatasourceStream.tsx +++ b/webapp/src/components/DatasourceStream.tsx @@ -36,7 +36,9 @@ export function StreamRow({ const containsNestedFields = sourceDefinedPrimaryKey?.length > 1 || defaultCursorField?.length > 1; const [cursorField, setCursorField] = useState(streamState?.cursorField || defaultCursorField); //Note: is an array for nested fields which we dont yet fully support - const [primaryKey, setPrimaryKey] = useState(streamState?.primaryKey || sourceDefinedPrimaryKey); + const [primaryKey, setPrimaryKey] = useState( + streamState?.primaryKey || sourceDefinedPrimaryKey?.flat() || [] + ); const initialSyncMode = streamProperty?.syncModes.find(m => m?.includes('incremental')) || streamProperty?.syncModes[0]; const [syncMode, setSyncMode] = useState(streamState?.syncMode || initialSyncMode); From f9414dceeb5f249ef82aa6d77cca292be021d1e0 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Tue, 10 Sep 2024 17:12:25 +1000 Subject: [PATCH 12/28] Add unstructured api to docker env for vector-db-proxy --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index ae164db5..c9b07a16 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -222,6 +222,7 @@ services: - THREAD_PERCENTAGE_UTILISATION=0.8 - USE_GPU=false - LOGGING_LEVEL=warn + - UNSTRUCTURED_API_URL=http://unstructured-api:9500/general/v0/general volumes: - datasource_files:/tmp From c5fcb1141869ddb42eb7c2ef2fc89221c7bd4a4d Mon Sep 17 00:00:00 2001 From: Charles John <1017170+charl3sj@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:07:55 +0530 Subject: [PATCH 13/28] #544 Pretty print crew attributes after instantiation --- agent-backend/src/crew/build_crew.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/agent-backend/src/crew/build_crew.py b/agent-backend/src/crew/build_crew.py index fa9439d0..2be2ec50 100644 --- a/agent-backend/src/crew/build_crew.py +++ b/agent-backend/src/crew/build_crew.py @@ -1,9 +1,8 @@ import json import logging from io import BytesIO -import os -from pathlib import Path import uuid +from pprint import pprint from typing import Any, List, Set, Type from datetime import datetime @@ -286,7 +285,10 @@ def build_crew(self): agentcloud_socket=self.socket, agentcloud_session_id=self.session_id ) - print(f"CrewAI Crew(): {self.crew}") + print('---') + print('Crew attributes:') + pprint(self.crew.__dict__) + print('---') except ValidationError as ve: self.send_to_sockets(text=f"""Validation Error: ``` From fdf9a859deb857649888198d6ce8138e8094a261 Mon Sep 17 00:00:00 2001 From: "Ian Christopher B. de Jesus" <3683356+iandjx@users.noreply.github.com> Date: Thu, 12 Sep 2024 08:39:22 +0800 Subject: [PATCH 14/28] Allow requiresHumanInput to be null --- webapp/src/controllers/task.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/controllers/task.ts b/webapp/src/controllers/task.ts index ebfcfd4e..e596c127 100644 --- a/webapp/src/controllers/task.ts +++ b/webapp/src/controllers/task.ts @@ -132,7 +132,7 @@ export async function addTaskApi(req, res, next) { [ { field: 'name', validation: { notEmpty: true, ofType: 'string' } }, { field: 'description', validation: { notEmpty: true, ofType: 'string' } }, - { field: 'requiresHumanInput', validation: { notEmpty: true, ofType: 'boolean' } }, + { field: 'requiresHumanInput', validation: { ofType: 'boolean' } }, { field: 'expectedOutput', validation: { ofType: 'string' } }, { field: 'toolIds', From 22d5aece8418f3cb8f35b1df63ef6f276959630c Mon Sep 17 00:00:00 2001 From: "Ian Christopher B. de Jesus" <3683356+iandjx@users.noreply.github.com> Date: Thu, 12 Sep 2024 08:44:19 +0800 Subject: [PATCH 15/28] Make expected output mandatory --- webapp/src/components/TaskForm.tsx | 2 +- webapp/src/controllers/task.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/src/components/TaskForm.tsx b/webapp/src/components/TaskForm.tsx index 86582f78..8407e1a8 100644 --- a/webapp/src/components/TaskForm.tsx +++ b/webapp/src/components/TaskForm.tsx @@ -358,7 +358,7 @@ export default function TaskForm({ htmlFor='expectedOutput' className='block text-sm font-medium leading-6 text-gray-900 dark:text-slate-400' > - Expected Output + Expected Output *
diff --git a/webapp/src/controllers/task.ts b/webapp/src/controllers/task.ts index ebfcfd4e..2ef50a2c 100644 --- a/webapp/src/controllers/task.ts +++ b/webapp/src/controllers/task.ts @@ -133,7 +133,7 @@ export async function addTaskApi(req, res, next) { { field: 'name', validation: { notEmpty: true, ofType: 'string' } }, { field: 'description', validation: { notEmpty: true, ofType: 'string' } }, { field: 'requiresHumanInput', validation: { notEmpty: true, ofType: 'boolean' } }, - { field: 'expectedOutput', validation: { ofType: 'string' } }, + { field: 'expectedOutput', validation: { notEmpty: true, ofType: 'string' } }, { field: 'toolIds', validation: { From 59437a741dece6195dfc5edb67716adaa1f36dab Mon Sep 17 00:00:00 2001 From: Nader Date: Thu, 12 Sep 2024 11:57:51 +1000 Subject: [PATCH 16/28] lint --- webapp/src/components/ChatAppForm.tsx | 38 +++++++++++++++------------ 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/webapp/src/components/ChatAppForm.tsx b/webapp/src/components/ChatAppForm.tsx index 04c5d197..1b211f9e 100644 --- a/webapp/src/components/ChatAppForm.tsx +++ b/webapp/src/components/ChatAppForm.tsx @@ -22,6 +22,7 @@ import { App, AppType } from 'struct/app'; import { ChatAppAllowedModels, ModelType } from 'struct/model'; import { SharingMode } from 'struct/sharing'; import { ToolType } from 'struct/tool'; + import ConfirmModal from './ConfirmModal'; export default function ChatAppForm({ @@ -48,9 +49,9 @@ export default function ChatAppForm({ const { step, setStep }: any = useStepContext(); const [accountContext]: any = useAccountContext(); const { account, csrf, teamName } = accountContext as any; - const [ outsideOrg, setOutsideOrg ] = useState(false); - const [ shareEmail, setShareEmail ]= useState(false); - const [ saveButtonType, setSaveButtonType ] = useState('button') + const [outsideOrg, setOutsideOrg] = useState(false); + const [shareEmail, setShareEmail] = useState(false); + const [saveButtonType, setSaveButtonType] = useState('button'); const router = useRouter(); const { resourceSlug } = router.query; const [icon, setIcon]: any = useState(app?.icon); @@ -335,18 +336,21 @@ export default function ChatAppForm({ break; case 'confirmOutsideOrg': modal = ( - { - setOutsideOrg(false); - setModalOpen(false); - }} - cancelFunction={() => { - setModalOpen(false); - }} - title={"Sharing Outside Team"} - message={"You are sharing this app with people outside your team. After confirming pressing 'save' will save the app."}/> + { + setOutsideOrg(false); + setModalOpen(false); + }} + cancelFunction={() => { + setModalOpen(false); + }} + title={'Sharing Outside Team'} + message={ + "You are sharing this app with people outside your team. After confirming pressing 'save' will save the app." + } + /> ); break; default: @@ -642,9 +646,9 @@ export default function ChatAppForm({