Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 0.1.17 #57

Merged
merged 78 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
c25cc9d
chore(flow): initialize
BroKun Aug 27, 2024
2ae15d3
chore(flow): migrate to nodenext code style
BroKun Aug 27, 2024
134e1f8
feat(ui): add flow page
BroKun Aug 27, 2024
d910bb6
feat(ui): add agent & workflow creation api
BroKun Aug 27, 2024
05bab7a
feat(ui): model icon & import path alias
BroKun Aug 27, 2024
6c04d83
feat(ui): performance of llm temperature slider
BroKun Aug 27, 2024
09ce590
refactor(ui): use short reference paths,and remove base module export…
BroKun Aug 27, 2024
f750528
feat(ui): optmize flow dag style
BroKun Aug 27, 2024
fd81dff
feat(ui): modify the font smoothing strategy to be more eye-friendly
BroKun Aug 27, 2024
70ab780
refactor: reorganize the project front-end directory
BroKun Aug 27, 2024
b85a6b1
chore: upgrade certifi to version 2024.07.04 or later
BroKun Aug 27, 2024
2c36df7
feat(ui): agent creation
BroKun Aug 28, 2024
87f22f8
feat(ui): agent id validate
BroKun Aug 28, 2024
cf9bc45
feat: update node template in flow
coetzeexu Aug 27, 2024
0f491b4
feat: update flow node ModelSelector & KnowledgeSelector
coetzeexu Aug 28, 2024
d1a3b7a
fix(ui): migrate util api
BroKun Aug 28, 2024
b418dd7
fix(ui): remaining issues with code merging
BroKun Aug 28, 2024
052d01b
feat(ui): project settings are more convenient for development and op…
BroKun Aug 28, 2024
7bcdcae
feat(ui): support error message
BroKun Aug 29, 2024
d293443
feat(ui): optmize error message
BroKun Aug 29, 2024
0937689
feat(flow): padding style improvement
BroKun Aug 29, 2024
5857a31
feat(ui): model selector performance improvement
BroKun Aug 29, 2024
e194552
feat(ui): migrate llm model selector
BroKun Aug 29, 2024
a86a691
fix(ui): au until api migrate
BroKun Aug 29, 2024
af2d2dd
feat: add flowdata init&output
coetzeexu Aug 29, 2024
7db1a5f
feat: magent-ui support knowledge curd operation
october-rain Aug 29, 2024
8d1d1f5
feat(ui): add plugin
BroKun Aug 29, 2024
2881454
fix: workflow save and read
BroKun Aug 29, 2024
3d267a9
fix(ui): knowledge
BroKun Aug 30, 2024
5d78c1a
fix: node icon
coetzeexu Aug 29, 2024
0f1a042
feat: support tooluse in flow
coetzeexu Aug 29, 2024
6089edd
feat: support agent use in flow
coetzeexu Aug 29, 2024
870ed9e
feat: support tooluse in flow
coetzeexu Aug 29, 2024
1152cac
fix: handler type
coetzeexu Aug 30, 2024
316b10f
fix(ui): tool creation btn
BroKun Aug 30, 2024
288710c
fix: node inputparam reference
coetzeexu Aug 30, 2024
0e018e6
fix: ModelSelector models
coetzeexu Aug 30, 2024
eadb193
chore(ui): bugbatch
BroKun Aug 30, 2024
9ca5a07
fix(ui): tool & knowledge
BroKun Aug 30, 2024
238b8de
feat(flow): optimized the component display styles during interactions
BroKun Aug 30, 2024
41db9ec
feat(ui): optimization of styles such as edges and node cards
BroKun Sep 2, 2024
ce8cd2c
feat(ui): plugins list update
BroKun Sep 2, 2024
be0a015
feat(ui): tools modal
BroKun Sep 2, 2024
7c439a9
feat: 结束节点支持选择多个变量
xujingli Sep 2, 2024
b8d465d
fix: 创建智能体的模型选择不生效
xujingli Sep 2, 2024
28b7ab1
fix(ui): remove knowledge modify & remove action
BroKun Sep 2, 2024
f47f9fa
fix(flow): endnode prompt change
coetzeexu Sep 2, 2024
8e82faf
fix: custom edge
coetzeexu Sep 2, 2024
58b1c60
fix: 无法添加工具
xujingli Sep 3, 2024
155105e
fix(ui): prompt initialize value
BroKun Sep 2, 2024
e38ce5e
chore: file exclude
BroKun Sep 2, 2024
668504a
feat(ui): page title
BroKun Sep 2, 2024
58ebe59
fix(ui): spelling
BroKun Sep 2, 2024
3d6f1f5
feat(ui): last modify time in title
BroKun Sep 2, 2024
ecffef6
feat(ui): github link
BroKun Sep 2, 2024
2d7bc54
feat(ui): move graph main operation to toolbar in header
BroKun Sep 3, 2024
6ee83d0
fix(ui): refetch agent info when graph saved
BroKun Sep 3, 2024
b8d8fdf
feat(ui): agents card
BroKun Sep 3, 2024
3c1a72b
chore(ui): pyproject
BroKun Sep 3, 2024
e6fcecd
fix(ui): refetch info
BroKun Sep 3, 2024
6d32242
fix: 在会话消息返回过程中,用户手动上滑后关闭自动下滑
xujingli Sep 3, 2024
1120fdf
fix: umi版本较低时流失输出无效
xujingli Sep 4, 2024
8e9c116
feat: peer多智能体组多轮对话的展示;
xujingli Sep 4, 2024
cf20c8d
chore(flow): typo fix
BroKun Sep 8, 2024
d48687c
fix(flow): lint
BroKun Sep 8, 2024
e6bd5ee
fix: ci
BroKun Sep 8, 2024
38b1408
feat(ui): support setting the number of threads and asynchronous calls
BroKun Sep 9, 2024
93c59ab
chore: magent-ui 0.1.16.dev7
BroKun Sep 9, 2024
8eb3802
chore: update config
sunshinesmilelk Sep 10, 2024
56598cb
fix(ui): model initialization
BroKun Sep 12, 2024
8878001
fix(flow): unexpected node
BroKun Sep 12, 2024
832b1d3
feat(ui): use the asynchronous interface provided by the base package
BroKun Sep 12, 2024
f87be3d
fix(ui): data status processing when switching tools on the flow
BroKun Sep 12, 2024
9a1517b
fix(ui): tool may have no parameters
BroKun Sep 12, 2024
be8fd01
fix(ui): add variable
BroKun Sep 12, 2024
642e4ef
docs: update docs
BroKun Sep 12, 2024
11106d1
fix(ui): variables & references edit
BroKun Sep 12, 2024
20fe409
chore: publish 0.1.17
BroKun Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
**/dist/**/*.js
**/dist/**/*.cjs
**/dist/**/*.mjs

tailwind.out.css
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ save-workspace-protocol=rolling

# pnpm deploy workaround https://github.com/pnpm/pnpm/issues/6437#issuecomment-1549409913
dedupe-peer-dependents=false

link-workspace-packages=deep
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ pnpm-lock.yaml
**/dist
**/coverage
**/es
packages/**/static

# generated code
**/.dumi/tmp
**/.dumi/tmp-production
**/.umi-production
**/.docusaurus
**/.umi

Expand All @@ -27,3 +29,5 @@ tinyColor.less
.changeset

docker

tailwind.out.css
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tinyColor.less
tailwind.out.css
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
"yaml.schemas": {
"https://json.schemastore.org/github-issue-config.json": ".github/ISSUE_TEMPLATE/config.yml"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "never",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <img src="./docs/assets//logo.svg" width="30"> magent

为智能体研发提供专业产品方案
智能体研发产品方案

## magent-ui

Expand Down
2 changes: 1 addition & 1 deletion api/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ anyio==4.4.0
# via httpx
# via starlette
# via watchfiles
certifi==2024.6.2
certifi==2024.7.4
# via httpcore
# via httpx
click==8.1.7
Expand Down
8 changes: 4 additions & 4 deletions packages/magent-ui/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[project]
name = "magent-ui"
version = "0.1.16"
version = "0.1.16.dev6"
description = ""
authors = [
{ name = "shiyu", email = "[email protected]" },
{ name = "brokun", email = "[email protected]" },
]

dependencies = [
"sse-starlette>=2.1.2",
"jinja2>=3.1.4",
"python-multipart>=0.0.9",
"sse-starlette>=2.1.2",
"jinja2>=3.1.4",
"python-multipart>=0.0.9",
]
readme = "README.md"
requires-python = ">= 3.10"
Expand Down
16 changes: 16 additions & 0 deletions packages/magent-ui/src/magent_ui/routers/agents/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from typing import AsyncIterable, List
from fastapi import APIRouter
from agentuniverse_product.service.agent_service.agent_service import AgentService
from agentuniverse_product.service.workflow_service.workflow_service import WorkflowService
from agentuniverse_product.service.model.agent_dto import AgentDTO
from agentuniverse_product.service.model.workflow_dto import WorkflowDTO
from agentuniverse_product.service.model.planner_dto import PlannerDTO
from pydantic import BaseModel
from sse_starlette import EventSourceResponse, ServerSentEvent

Expand All @@ -26,6 +29,19 @@ async def get_agent_detail(agent_id):
async def update_agent(agent_id, agent: AgentDTO):
return AgentService.update_agent(agent)

@router.post("/agents", response_model=str)
async def create_agent(agent: AgentDTO):
return AgentService.create_agent(agent)


@router.post("/agents/workflow", response_model=str)
async def create_workflow_agent(agent: AgentDTO):
workflow_id = f"{agent.id}_workflow"
workflow_name = f"{agent.nickname}_workflow"
workflow = WorkflowDTO(id=workflow_id, name=workflow_name)
workflow_id = WorkflowService.create_workflow(workflow)
agent.planner = PlannerDTO(id='workflow_planner', workflow_id=workflow_id)
return AgentService.create_agent(agent)

class MessageSenderType(enum.Enum):
AI = "ai"
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions packages/magent-ui/src/magent_ui/routers/common/router.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from fastapi import APIRouter
from agentuniverse_product.base.util.common_util import is_component_id_unique

router = APIRouter()
common_router = router


@router.get("/common/is_id_unique", response_model=bool)
async def is_id_unique(id:str, type:str):
result = is_component_id_unique(id,type)
return result

23 changes: 21 additions & 2 deletions packages/magent-ui/src/magent_ui/routers/knowledge/router.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import List
from fastapi import APIRouter
from typing import Annotated, List
from fastapi import APIRouter, Body, File, UploadFile
from agentuniverse_product.service.model.knowledge_dto import KnowledgeDTO
from agentuniverse_product.service.knowledge_service.knowledge_service import KnowledgeService

Expand All @@ -10,3 +10,22 @@
@router.get("/knowledge", response_model=List[KnowledgeDTO])
async def get_knowledge():
return KnowledgeService.get_knowledge_list()

@router.post("/knowledge", response_model=str)
async def create_knowledge(knowledge: KnowledgeDTO):
return KnowledgeService.create_knowledge(knowledge)

@router.put("/knowledge/{knowledge_id}", response_model=str)
async def update_knowledge(knowledge_id: str, knowledge: KnowledgeDTO):
knowledge.id = knowledge_id
return KnowledgeService.update_knowledge(knowledge)

@router.delete("/knowledge/{knowledge_id}", response_model=bool)
async def delete_knowledge(knowledge_id: str):
return KnowledgeService.delete_knowledge(knowledge_id)

@router.post("/knowledge/upload")
async def upload_knowledge_file(knowledge_id: Annotated[str, Body()], file: UploadFile = File(...)):
print('here')
return KnowledgeService.upload_knowledge_file(knowledge_id, file)

8 changes: 8 additions & 0 deletions packages/magent-ui/src/magent_ui/routers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from magent_ui.routers.sessions.router import sessions_router
from magent_ui.routers.tools.router import tools_router
from magent_ui.routers.resource.router import resource_router
from magent_ui.routers.workflow.router import workflow_router
from magent_ui.routers.common.router import common_router
from magent_ui.routers.plugins.router import plugins_router

api_router = APIRouter()

Expand All @@ -14,3 +17,8 @@
api_router.include_router(sessions_router, prefix="/v1", tags=["session"])
api_router.include_router(tools_router, prefix="/v1", tags=["tool"])
api_router.include_router(resource_router, prefix="/v1", tags=["resource"])
api_router.include_router(workflow_router, prefix="/v1", tags=["workflow"])
api_router.include_router(common_router, prefix="/v1", tags=["common"])
api_router.include_router(plugins_router, prefix="/v1", tags=["plugin"])


16 changes: 16 additions & 0 deletions packages/magent-ui/src/magent_ui/routers/plugins/router.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from typing import List
from fastapi import APIRouter
from agentuniverse_product.service.plugin_service.plugin_service import PluginService
from agentuniverse_product.service.model.plugin_dto import PluginDTO

router = APIRouter()
plugins_router = router


@router.get("/plugins", response_model=List[PluginDTO])
async def get_agents():
return PluginService.get_plugin_list()

@router.post("/plugins/openapi", response_model=str)
async def create_plugin_with_openapi(plugin: PluginDTO):
return PluginService.create_plugin_with_openapi(plugin)
Empty file.
20 changes: 20 additions & 0 deletions packages/magent-ui/src/magent_ui/routers/workflow/router.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from fastapi import APIRouter
from agentuniverse_product.service.workflow_service.workflow_service import WorkflowService
from agentuniverse_product.service.model.workflow_dto import WorkflowDTO

router = APIRouter()
workflow_router = router


@router.get("/workflows/{workflow_id}", response_model=WorkflowDTO | None)
async def get_agent_detail(workflow_id):
return WorkflowService.get_workflow_detail(workflow_id)


@router.put("/workflows/{workflow_id}", response_model=str | None)
async def update_agent(workflow_id, workflow: WorkflowDTO):
return WorkflowService.update_workflow(workflow)

@router.post("/workflows", response_model=WorkflowDTO)
async def create_agent(workflow: WorkflowDTO):
return WorkflowService.create_workflow(workflow)
5 changes: 2 additions & 3 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
packages:
- 'web/platform'
- 'web/ui'
- 'web/packages/*'
- 'web-apps/*'
- 'web-packages/*'
- 'docs/site'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added web-apps/platform/README.md
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ export class Chat extends AsyncModel<Chat, ChatOption> {
const newMessageModel: ChatMessageModel = JSON.parse(e.data);
const message = this.getOrCreateMessage(newMessageModel);
this.messages = [...this.messages, message];
setImmediate(() => this.scrollToBottom(true, false));
setImmediate(() => {
if (!this.showToBottomBtn) {
this.scrollToBottom(true, false);
}
});
}

if (e.event === 'chunk') {
Expand All @@ -241,7 +245,11 @@ export class Chat extends AsyncModel<Chat, ChatOption> {
if (msg) {
this.processingChunk = msg;
msg.appendChunk(chunk);
setImmediate(() => this.scrollToBottom(true, false));
setImmediate(() => {
if (!this.showToBottomBtn) {
this.scrollToBottom(true, false);
}
});
}
}
} catch (e) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions web/ui/config/config.ts → web-apps/ui/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export default defineConfig({
jsMinifier: 'none',
alias: {
'@/modules': path.join(__dirname, '../src/modules'),
'@difizen/magent-flow': path.resolve(
__dirname,
'../../../web-packages/magent-flow/src',
),
'@flow': path.resolve(__dirname, '../../../web-packages/magent-flow/src'),
},
favicons: ['/favicon.ico'],
});
8 changes: 8 additions & 0 deletions web/ui/config/routes.ts → web-apps/ui/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ export default [
path: '/agent/:agentId/dev',
slot: 'magent-agent-dev-slot',
},
{
path: '/agent/:agentId/flow',
slot: 'magent-agent-flow-dev-slot',
},
{
path: '/portal/knowledge/:knowledgeId/upload',
slot: 'magent-knowledge-upload-slot',
},
],
},
];
File renamed without changes.
6 changes: 5 additions & 1 deletion web/ui/package.json → web-apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@difizen/libro-jupyter": "^0.2.1",
"@difizen/libro-lab": "^0.2.1",
"@difizen/libro-markdown": "^0.2.1",
"@difizen/magent-flow": "workspace:^",
"@difizen/mana-app": "^0.1.8",
"@difizen/mana-react": "^0.1.8",
"@rjsf/antd": "^5.18.2",
Expand All @@ -37,6 +38,7 @@
"copy-to-clipboard": "^3.3.3",
"dayjs": "^1.11.10",
"eventsource-parser": "^1.1.2",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"lodash.debounce": "^4.0.8",
"query-string": "^9.0.0",
Expand All @@ -45,14 +47,16 @@
"react-zoom-pan-pinch": "^3.6.1",
"remark-breaks": "^4.0.0",
"remark-gfm": "^4.0.0",
"umi": "^4.1.1"
"timeago.js": "^4.0.2",
"umi": "^4.3.18"
},
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.23.7",
"@babel/plugin-transform-class-properties": "^7.23.3",
"@babel/plugin-transform-flow-strip-types": "^7.23.3",
"@babel/plugin-transform-private-methods": "^7.23.3",
"@babel/plugin-transform-private-property-in-object": "^7.23.4",
"@types/js-yaml": "^4.0.9",
"@types/lodash.debounce": "^4.0.9",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions web-apps/ui/src/common/component/component-model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { prop, transient } from '@difizen/mana-app';

import { AsyncModel } from '../async-model.js';

import type { ComponentMeta } from './protocol.js';

@transient()
export abstract class ComponentModel<T, O extends ComponentMeta> extends AsyncModel<
T,
O
> {
id: string;

@prop()
avatar?: string;

@prop()
nickname: string;

@prop()
description: string;

get name(): string {
return this.nickname;
}
set name(v: string) {
this.nickname = v;
}

protected override fromMeta(option: O): void {
this.id = option.id;
if (option.nickname) {
this.nickname = option.nickname;
}
if (option.description) {
this.description = option.description;
}
if (option.avatar) {
this.avatar = option.avatar;
}
}

updateOption(option: O) {
this.fromMeta(option);
}

toMeta = (): ComponentMeta => {
return {
id: this.id,
nickname: this.nickname,
avatar: this.avatar,
};
};
}
6 changes: 6 additions & 0 deletions web-apps/ui/src/common/component/protocol.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface ComponentMeta {
id: string;
avatar?: string;
nickname?: string;
description?: string;
}
File renamed without changes.
File renamed without changes.
Loading
Loading