diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index b3aea4f..0000000 Binary files a/.DS_Store and /dev/null differ 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;