From 7e9cf66d01a82df3557083682c4be4b2450900a6 Mon Sep 17 00:00:00 2001 From: Gk0Wk Date: Sun, 7 Apr 2024 17:21:15 +0800 Subject: [PATCH] fix --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 1 + backend/AgentCoord/LLMAPI/LLMAPI.py | 6 ++-- backend/Dockerfile | 3 +- backend/requirements.txt | 2 +- docker-compose.yml | 4 ++- frontend/.dockerignore | 31 ++++++++++++++++++ .../src/components/AgentAssignment/index.tsx | 4 +-- .../src/components/PlanModification/index.tsx | 2 +- .../ProcessRehearsal/RehearsalSvg.tsx | 7 +++- .../src/components/TaskModification/index.tsx | 2 +- frontend/src/icons/checkIcon.tsx | 4 +-- 12 files changed, 52 insertions(+), 14 deletions(-) delete mode 100644 .DS_Store create mode 100644 .gitignore create mode 100644 frontend/.dockerignore diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index b3aea4fc7a2650b9057b919316fd03b036a34068..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T0$T-BN@e6nYGJEm&*u2QQ)47cim+m718Sp)p(1)Er77XMG``#OHBl zcPsYCt4O;8v)}B_Ou~Fwb~6CLIwOA{pauXOm9S93VTq8RbU_MwrG&`jGXjXg_p;%@ zix#5I!hd9dzFiqSaNz;^@Z3gyv(gKPm1 z={Hge+SE%>j-}Dom@7mN3R9_wDwXLLgQ;{}w{)DXF;}S4f$8Rh={Gaop)mP&e7+^a zf!PYpXc#aI%ra0^(;D6X=fC&=vq@%V7%&X16a%c(b-EoaN#Cst#nD}Bq28mCP+YF? mI|U7S6=N)2#dTCExNebwXlu+B;tGoS5s);P!7%Wr4157|`irIj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/backend/AgentCoord/LLMAPI/LLMAPI.py b/backend/AgentCoord/LLMAPI/LLMAPI.py index 0ce3aa4..b4121a8 100644 --- a/backend/AgentCoord/LLMAPI/LLMAPI.py +++ b/backend/AgentCoord/LLMAPI/LLMAPI.py @@ -3,9 +3,6 @@ import openai import yaml from termcolor import colored import os -from groq import AsyncGroq -from mistralai.client import MistralClient -from mistralai.models.chat_completion import ChatMessage # load config (apikey, apibase, model) yaml_file = os.path.join(os.getcwd(), "config", "config.yaml") @@ -73,6 +70,7 @@ def LLM_Completion( async def _achat_completion_stream_groq(messages: list[dict]) -> str: + from groq import AsyncGroq client = AsyncGroq(api_key=GROQ_API_KEY) max_attempts = 5 @@ -103,6 +101,8 @@ async def _achat_completion_stream_groq(messages: list[dict]) -> str: async def _achat_completion_stream_mixtral(messages: list[dict]) -> str: + from mistralai.client import MistralClient + from mistralai.models.chat_completion import ChatMessage client = MistralClient(api_key=MISTRAL_API_KEY) # client=AsyncGroq(api_key=GROQ_API_KEY) max_attempts = 5 diff --git a/backend/Dockerfile b/backend/Dockerfile index 7cc4675..9748d6e 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11.8-alpine3.18 +FROM python:3.9.19-bookworm WORKDIR /app EXPOSE 8000/tcp @@ -16,5 +16,4 @@ ENV OPENAI_API_MODEL=gpt-4-turbo-preview ENV USE_CACHE=False ENV FAST_DESIGN_MODE=True ENV GROQ_API_KEY= -ENV MISTRAL_API_KEY= CMD ["python", "server.py", "--port", "8000"] diff --git a/backend/requirements.txt b/backend/requirements.txt index 5555a3e..f60023e 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,5 +1,5 @@ Flask==3.0.2 -openai==1.14.2 +openai==0.28.1 PyYAML==6.0.1 termcolor==2.4.0 groq==0.4.2 diff --git a/docker-compose.yml b/docker-compose.yml index 9a270e3..7d9baad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,9 +21,11 @@ services: ports: - "8000:8000" environment: - - OPENAI_API_BASE=https://api.openai.com + - OPENAI_API_BASE=htts://api.openai.com - OPENAI_API_KEY= - OPENAI_API_MODEL=gpt-4-turbo-preview + - FAST_DESIGN_MODE=True + - GROQ_API_KEY= networks: - agentcoord-network diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..c3337c1 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,31 @@ +.DS_Store + +.pnp +.pnp.js +.env.local +.env.*.local +.history +*.log* + +node_modules/ +.yarn-integrity +.pnpm-store/ +*.tsbuildinfo +.eslintcache +.changeset/pre.json + +dist/ +coverage/ +release/ +output/ +output_resource/ +log/ + +.vscode/**/* +!.vscode/settings.json +!.vscode/extensions.json +.idea/ + +**/*/typings/auto-generated + +modern.config.local.* diff --git a/frontend/src/components/AgentAssignment/index.tsx b/frontend/src/components/AgentAssignment/index.tsx index f71c8d1..433da5f 100644 --- a/frontend/src/components/AgentAssignment/index.tsx +++ b/frontend/src/components/AgentAssignment/index.tsx @@ -17,10 +17,10 @@ import _ from 'lodash'; // fakeAgentSelections, // fakeCurrentAgentSelection, // } from './data/fakeAgentAssignment'; -import CheckIcon from '@/icons/checkIcon'; +import CheckIcon from '@/icons/CheckIcon'; import AgentIcon from '@/components/AgentIcon'; import { globalStorage } from '@/storage'; -import SendIcon from '@/icons/sendIcon'; +import SendIcon from '@/icons/SendIcon'; const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => ( diff --git a/frontend/src/components/PlanModification/index.tsx b/frontend/src/components/PlanModification/index.tsx index c6f87a1..0cc8cad 100644 --- a/frontend/src/components/PlanModification/index.tsx +++ b/frontend/src/components/PlanModification/index.tsx @@ -18,7 +18,7 @@ import { usePlanModificationContext, } from './context'; import { IPlanTreeNode, globalStorage } from '@/storage'; -import SendIcon from '@/icons/sendIcon'; +import SendIcon from '@/icons/SendIcon'; const RequirementNoteNode: React.FC<{ data: { diff --git a/frontend/src/components/ProcessRehearsal/RehearsalSvg.tsx b/frontend/src/components/ProcessRehearsal/RehearsalSvg.tsx index 9da3fb6..98bb270 100644 --- a/frontend/src/components/ProcessRehearsal/RehearsalSvg.tsx +++ b/frontend/src/components/ProcessRehearsal/RehearsalSvg.tsx @@ -235,7 +235,12 @@ export default observer( () => importantLineRects .sort((a, b) => { - return a.to === b.to ? 0 : a.to === actionIsHovered ? 1 : -1; + // eslint-disable-next-line no-nested-ternary + return a[0].to === b[0].to + ? 0 + : a[0].to === actionIsHovered + ? 1 + : -1; }) .map(([line, from, to]) => { const key = `${line.from}.${line.to}`; diff --git a/frontend/src/components/TaskModification/index.tsx b/frontend/src/components/TaskModification/index.tsx index 2f08fbb..09ce616 100644 --- a/frontend/src/components/TaskModification/index.tsx +++ b/frontend/src/components/TaskModification/index.tsx @@ -17,7 +17,7 @@ import { useTaskModificationContext, } from './context'; import { IAgentActionTreeNode, globalStorage } from '@/storage'; -import SendIcon from '@/icons/sendIcon'; +import SendIcon from '@/icons/SendIcon'; import { ActionType } from '@/storage/plan'; const RequirementNoteNode: React.FC<{ diff --git a/frontend/src/icons/checkIcon.tsx b/frontend/src/icons/checkIcon.tsx index 698ec8a..37b592a 100644 --- a/frontend/src/icons/checkIcon.tsx +++ b/frontend/src/icons/checkIcon.tsx @@ -9,7 +9,7 @@ interface CustomIconProps { } // 创建你的自定义SVG图标组件 -const checkIcon: React.FC = ({ +const CheckIcon: React.FC = ({ size = '100%', color = 'currentColor', }) => { @@ -30,4 +30,4 @@ const checkIcon: React.FC = ({ ); }; -export default checkIcon; +export default CheckIcon;