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 all 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,6 @@ pnpm-lock.yaml

docker/volumes
agent_universe.db


packages/magent-ui/src/magent_ui/static
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
2 changes: 1 addition & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// language - current active spelling language
"language": "en",
// words - list of words to be always considered correct
"words": ["ahooks", "difizen", "dumi", "dumirc", "magent"],
"words": ["ahooks", "aiofiles", "difizen", "dumi", "dumirc", "magent"],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// For example "hte" should be "the"
Expand Down
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@
"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
},

"search.exclude": {
"packages/**/dist": true,
"packages/**/es": true,
"packages/**/lib": true,
"web-packages/**/dist": true,
"web-packages/**/es": true,
"web-packages/**/lib": true,
"web-apps/**/dist": true,
"web-apps/**/es": true,
"web-apps/**/lib": true
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "never",
Expand Down
15 changes: 9 additions & 6 deletions 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 All @@ -10,17 +10,20 @@

与 [agentUniverse](https://github.com/alipay/agentUniverse) 联合推出本地研发产品化方案,详见[产品化文档](https://github.com/alipay/agentUniverse/blob/master/docs/guidebook/zh/10_1_1_%E4%BA%A7%E5%93%81%E5%8C%96%E5%B9%B3%E5%8F%B0%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B.md)

智能体工作流编排
![智能体工作流编排](./docs/assets/au-flow.jpg)

智能体编排
![智能体编排](./docs/assets/au-react-dev.jpg)

PEER 多智能体对话
![PEER 多智能体对话](./docs/assets/au-peer-chat.jpg)

ReAct 智能体开发
![ReAct 智能体开发](./docs/assets/au-react-dev.jpg)

#### 后续计划

- 9 月
- [ ] 支持 agent/tool/knowledge 产品化创建
- [ ] 支持 flow 方式研发 agent
- [x] 支持 agent/tool/knowledge 产品化创建
- [x] 支持 flow 方式研发 agent
- [ ] 支持 peer 多智能体的表单编排

#### 配置
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
Binary file added docs/assets/au-flow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion packages/magent-ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ wheels/
# venv
.venv

static
12 changes: 7 additions & 5 deletions packages/magent-ui/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[project]
name = "magent-ui"
version = "0.1.16"
version = "0.1.17"
description = ""
authors = [
{ name = "shiyu", email = "[email protected]" },
{ name = "brokun", email = "[email protected]" },
{ name = "shiyu", email = "[email protected]" },
{ name = "sunshinesmilelk", 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",
"aiofiles>=24.1.0",
]
readme = "README.md"
requires-python = ">= 3.10"
Expand Down
11 changes: 7 additions & 4 deletions packages/magent-ui/src/magent_ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from fastapi.templating import Jinja2Templates
from contextlib import asynccontextmanager
import webbrowser
from magent_ui.utils import AsyncTask
import uvicorn
import logging
from magent_ui.routers.main import api_router
Expand All @@ -13,7 +14,7 @@
from uvicorn.config import LOGGING_CONFIG

# Use uvicorn's default logging configuration
logging.config.dictConfig(LOGGING_CONFIG) # type: ignore
logging.config.dictConfig(LOGGING_CONFIG) # type: ignore

# Get the uvicorn logger
logger = logging.getLogger("uvicorn")
Expand All @@ -26,6 +27,7 @@

templates = Jinja2Templates(directory=templates_dir)


def launch(**kwargs):
logger.info("Current log level is")
project_root_path = get_project_root_path()
Expand All @@ -35,7 +37,8 @@ def launch(**kwargs):
if app_config.log_level is not None:
logger.setLevel(app_config.log_level)


if app_config.thread_worker is not None:
AsyncTask.set_max_worker(app_config.thread_worker)

@asynccontextmanager
async def lifespan(app: FastAPI):
Expand All @@ -54,7 +57,7 @@ async def lifespan(app: FastAPI):
# static
if os.path.exists(static_dir):
app.mount(app_config.full_static_path, StaticFiles(directory=static_dir,
html=True), name="static")
html=True), name="static")
else:
logger.info('Can not find static directory. ', static_dir)

Expand All @@ -65,7 +68,7 @@ async def lifespan(app: FastAPI):
os.makedirs(app_config.resource_dir_path)

app.mount(app_config.full_resource_path, StaticFiles(directory=app_config.resource_dir_path,
html=True))
html=True))

# auto redirect to app url
@app.get(app_config.root_path, response_class=HTMLResponse)
Expand Down
109 changes: 62 additions & 47 deletions packages/magent-ui/src/magent_ui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
logger = logging.getLogger("uvicorn")

default_config = {
'thread_worker': 20,
'host': '0.0.0.0',
'port': 8888,
'base_url': None,
Expand All @@ -27,6 +28,8 @@ def to_uvicorn_config(config: dict):
# root path has already taken effect
del uvicorn_config['root_path']

if uvicorn_config.get('thread_worker', None) is not None:
del uvicorn_config['thread_worker']

return uvicorn_config

Expand Down Expand Up @@ -116,54 +119,66 @@ def load_config(config=default_config, project_root_path=None):
resource_path = 'resources'
app_path = 'app'


config_count = 0


class AppConfig():
config: dict
project_root_path:Path
resource_dir_path: Path

port: int
root_path: str
base_url: str
open_browser: bool
log_level: str

full_api_path: str
full_static_path: str
full_resource_path: str

api_url: str
static_url: str
resource_url: str
app_url: str

def load_config(self, project_root_path:Path, **kwargs):
config = load_config(kwargs, project_root_path)
self.project_root_path = project_root_path
self.resource_dir_path = project_root_path / 'app' / 'resources'
self.config = config
self.port = config.get('port', 8888)
base_root_path = '/'
root_path = config.get('root_path', base_root_path)
self.root_path = root_path
self.base_url = config.get('base_url', None)
self.open_browser = config.get('open_browser', True)
self.log_level = config.get('log_level', None)
if self.base_url is None:
self.base_url = root_path

if not root_path.startswith('/'):
logger.info('[magent] root_path should start with "/" ', root_path)
root_path = f'/{root_path}'
config['root_path'] = root_path

self.full_api_path = os.path.join(root_path, api_path)
self.full_static_path = os.path.join(root_path, static_path)
self.full_resource_path = os.path.join(root_path, resource_path)

self.api_url = os.path.join(self.base_url, api_path)
self.static_url = os.path.join(self.base_url, static_path)
self.resource_url = os.path.join(self.base_url, resource_path)
self.app_url = os.path.join(self.base_url, app_path)
config: dict
project_root_path: Path
resource_dir_path: Path

port: int
root_path: str
base_url: str
open_browser: bool
log_level: str

full_api_path: str
full_static_path: str
full_resource_path: str

api_url: str
static_url: str
resource_url: str
app_url: str

thread_worker: int

def __init__(self):
global config_count
config_count += 1
print('config:', config_count)

def load_config(self, project_root_path: Path, **kwargs):
config = load_config(kwargs, project_root_path)
self.project_root_path = project_root_path
self.resource_dir_path = project_root_path / 'app' / 'resources'
self.config = config
self.port = config.get('port', 8888)
base_root_path = '/'
root_path = config.get('root_path', base_root_path)
self.root_path = root_path
self.base_url = config.get('base_url', None)
self.open_browser = config.get('open_browser', True)
self.log_level = config.get('log_level', None)
self.thread_worker = config.get('thread_worker', None)
if self.base_url is None:
self.base_url = root_path

if not root_path.startswith('/'):
logger.info('[magent] root_path should start with "/" ', root_path)
root_path = f'/{root_path}'
config['root_path'] = root_path

self.full_api_path = os.path.join(root_path, api_path)
self.full_static_path = os.path.join(root_path, static_path)
self.full_resource_path = os.path.join(root_path, resource_path)

self.api_url = os.path.join(self.base_url, api_path)
self.static_url = os.path.join(self.base_url, static_path)
self.resource_url = os.path.join(self.base_url, resource_path)
self.app_url = os.path.join(self.base_url, app_path)


app_config = AppConfig()
20 changes: 0 additions & 20 deletions packages/magent-ui/src/magent_ui/models/agent.py

This file was deleted.

9 changes: 0 additions & 9 deletions packages/magent-ui/src/magent_ui/models/knowledge.py

This file was deleted.

10 changes: 0 additions & 10 deletions packages/magent-ui/src/magent_ui/models/llm.py

This file was deleted.

11 changes: 0 additions & 11 deletions packages/magent-ui/src/magent_ui/models/message.py

This file was deleted.

8 changes: 0 additions & 8 deletions packages/magent-ui/src/magent_ui/models/planner.py

This file was deleted.

Loading
Loading