This commit is contained in:
Gk0Wk 2024-04-07 17:21:15 +08:00
parent d46785cb68
commit 7e9cf66d01
12 changed files with 52 additions and 14 deletions

BIN
.DS_Store vendored

Binary file not shown.

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.DS_Store

View File

@ -3,9 +3,6 @@ import openai
import yaml import yaml
from termcolor import colored from termcolor import colored
import os import os
from groq import AsyncGroq
from mistralai.client import MistralClient
from mistralai.models.chat_completion import ChatMessage
# load config (apikey, apibase, model) # load config (apikey, apibase, model)
yaml_file = os.path.join(os.getcwd(), "config", "config.yaml") 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: async def _achat_completion_stream_groq(messages: list[dict]) -> str:
from groq import AsyncGroq
client = AsyncGroq(api_key=GROQ_API_KEY) client = AsyncGroq(api_key=GROQ_API_KEY)
max_attempts = 5 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: 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 = MistralClient(api_key=MISTRAL_API_KEY)
# client=AsyncGroq(api_key=GROQ_API_KEY) # client=AsyncGroq(api_key=GROQ_API_KEY)
max_attempts = 5 max_attempts = 5

View File

@ -1,4 +1,4 @@
FROM python:3.11.8-alpine3.18 FROM python:3.9.19-bookworm
WORKDIR /app WORKDIR /app
EXPOSE 8000/tcp EXPOSE 8000/tcp
@ -16,5 +16,4 @@ ENV OPENAI_API_MODEL=gpt-4-turbo-preview
ENV USE_CACHE=False ENV USE_CACHE=False
ENV FAST_DESIGN_MODE=True ENV FAST_DESIGN_MODE=True
ENV GROQ_API_KEY= ENV GROQ_API_KEY=
ENV MISTRAL_API_KEY=
CMD ["python", "server.py", "--port", "8000"] CMD ["python", "server.py", "--port", "8000"]

View File

@ -1,5 +1,5 @@
Flask==3.0.2 Flask==3.0.2
openai==1.14.2 openai==0.28.1
PyYAML==6.0.1 PyYAML==6.0.1
termcolor==2.4.0 termcolor==2.4.0
groq==0.4.2 groq==0.4.2

View File

@ -21,9 +21,11 @@ services:
ports: ports:
- "8000:8000" - "8000:8000"
environment: environment:
- OPENAI_API_BASE=https://api.openai.com - OPENAI_API_BASE=htts://api.openai.com
- OPENAI_API_KEY= - OPENAI_API_KEY=
- OPENAI_API_MODEL=gpt-4-turbo-preview - OPENAI_API_MODEL=gpt-4-turbo-preview
- FAST_DESIGN_MODE=True
- GROQ_API_KEY=
networks: networks:
- agentcoord-network - agentcoord-network

31
frontend/.dockerignore Normal file
View File

@ -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.*

View File

@ -17,10 +17,10 @@ import _ from 'lodash';
// fakeAgentSelections, // fakeAgentSelections,
// fakeCurrentAgentSelection, // fakeCurrentAgentSelection,
// } from './data/fakeAgentAssignment'; // } from './data/fakeAgentAssignment';
import CheckIcon from '@/icons/checkIcon'; import CheckIcon from '@/icons/CheckIcon';
import AgentIcon from '@/components/AgentIcon'; import AgentIcon from '@/components/AgentIcon';
import { globalStorage } from '@/storage'; import { globalStorage } from '@/storage';
import SendIcon from '@/icons/sendIcon'; import SendIcon from '@/icons/SendIcon';
const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => ( const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (
<Tooltip {...props} classes={{ popper: className }} /> <Tooltip {...props} classes={{ popper: className }} />

View File

@ -18,7 +18,7 @@ import {
usePlanModificationContext, usePlanModificationContext,
} from './context'; } from './context';
import { IPlanTreeNode, globalStorage } from '@/storage'; import { IPlanTreeNode, globalStorage } from '@/storage';
import SendIcon from '@/icons/sendIcon'; import SendIcon from '@/icons/SendIcon';
const RequirementNoteNode: React.FC<{ const RequirementNoteNode: React.FC<{
data: { data: {

View File

@ -235,7 +235,12 @@ export default observer(
() => () =>
importantLineRects importantLineRects
.sort((a, b) => { .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]) => { .map(([line, from, to]) => {
const key = `${line.from}.${line.to}`; const key = `${line.from}.${line.to}`;

View File

@ -17,7 +17,7 @@ import {
useTaskModificationContext, useTaskModificationContext,
} from './context'; } from './context';
import { IAgentActionTreeNode, globalStorage } from '@/storage'; import { IAgentActionTreeNode, globalStorage } from '@/storage';
import SendIcon from '@/icons/sendIcon'; import SendIcon from '@/icons/SendIcon';
import { ActionType } from '@/storage/plan'; import { ActionType } from '@/storage/plan';
const RequirementNoteNode: React.FC<{ const RequirementNoteNode: React.FC<{

View File

@ -9,7 +9,7 @@ interface CustomIconProps {
} }
// 创建你的自定义SVG图标组件 // 创建你的自定义SVG图标组件
const checkIcon: React.FC<CustomIconProps> = ({ const CheckIcon: React.FC<CustomIconProps> = ({
size = '100%', size = '100%',
color = 'currentColor', color = 'currentColor',
}) => { }) => {
@ -30,4 +30,4 @@ const checkIcon: React.FC<CustomIconProps> = ({
); );
}; };
export default checkIcon; export default CheckIcon;