agstack 1.0.2__tar.gz → 1.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agstack-1.0.2 → agstack-1.0.4}/PKG-INFO +10 -10
- {agstack-1.0.2 → agstack-1.0.4}/agstack/config/logger.py +22 -6
- {agstack-1.0.2 → agstack-1.0.4}/agstack/infra/db/__init__.py +8 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack.egg-info/PKG-INFO +10 -10
- agstack-1.0.4/agstack.egg-info/requires.txt +18 -0
- {agstack-1.0.2 → agstack-1.0.4}/pyproject.toml +13 -13
- agstack-1.0.2/agstack.egg-info/requires.txt +0 -18
- {agstack-1.0.2 → agstack-1.0.4}/LICENSE +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/README.md +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/__init__.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/config/__init__.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/config/manager.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/config/types.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/decorators.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/events.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/exceptions.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/fastapi/__init__.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/fastapi/exception.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/fastapi/middleware.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/fastapi/offline.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/fastapi/sse.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/infra/es/__init__.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/infra/kg/__init__.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/infra/mq/__init__.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/__init__.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/client.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/__init__.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/agent.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/context.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/events.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/exceptions.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/factory.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/flow.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/loader.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/records.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/registry.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/state.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/flow/tool.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/prompts.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/llm/token.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/registry.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/schema.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/security/__init__.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/security/casbin.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/security/crypt.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack/status.py +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack.egg-info/SOURCES.txt +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack.egg-info/dependency_links.txt +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/agstack.egg-info/top_level.txt +0 -0
- {agstack-1.0.2 → agstack-1.0.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agstack
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Production-ready toolkit for building FastAPI and LLM applications
|
|
5
5
|
Author-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
|
|
6
6
|
Maintainer-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
|
|
@@ -20,24 +20,24 @@ Classifier: Typing :: Typed
|
|
|
20
20
|
Requires-Python: >=3.12
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: ag-ui-protocol>=0.1.
|
|
24
|
-
Requires-Dist: aio-pika>=9.
|
|
23
|
+
Requires-Dist: ag-ui-protocol>=0.1.13
|
|
24
|
+
Requires-Dist: aio-pika>=9.6.1
|
|
25
25
|
Requires-Dist: asyncpg>=0.30.0
|
|
26
|
-
Requires-Dist: elasticsearch[async]>=9.
|
|
27
|
-
Requires-Dist: fastapi>=0.
|
|
26
|
+
Requires-Dist: elasticsearch[async]>=9.3.0
|
|
27
|
+
Requires-Dist: fastapi>=0.133.0
|
|
28
28
|
Requires-Dist: jwcrypto>=1.5.6
|
|
29
29
|
Requires-Dist: loguru>=0.7.3
|
|
30
30
|
Requires-Dist: nebula3-python>=3.8.3
|
|
31
|
-
Requires-Dist: openai>=2.
|
|
31
|
+
Requires-Dist: openai>=2.24.0
|
|
32
32
|
Requires-Dist: passlib[bcrypt]>=1.7.4
|
|
33
|
-
Requires-Dist: pycasbin>=2.
|
|
33
|
+
Requires-Dist: pycasbin>=2.8.0
|
|
34
34
|
Requires-Dist: pydantic>=2.12.4
|
|
35
35
|
Requires-Dist: python-multipart>=0.0.20
|
|
36
36
|
Requires-Dist: requests>=2.32.5
|
|
37
|
-
Requires-Dist: sqlalchemy[asyncio]>=2.0.
|
|
38
|
-
Requires-Dist: sqlobjects>=1.0
|
|
37
|
+
Requires-Dist: sqlalchemy[asyncio]>=2.0.47
|
|
38
|
+
Requires-Dist: sqlobjects>=1.2.0
|
|
39
39
|
Requires-Dist: tiktoken>=0.12.0
|
|
40
|
-
Requires-Dist: uvicorn>=0.
|
|
40
|
+
Requires-Dist: uvicorn>=0.41.0
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
|
|
43
43
|
# AgStack
|
|
@@ -4,8 +4,17 @@ import logging
|
|
|
4
4
|
import sys
|
|
5
5
|
from datetime import time, timedelta
|
|
6
6
|
from pathlib import Path
|
|
7
|
+
from typing import TYPE_CHECKING, Optional
|
|
7
8
|
|
|
8
|
-
from loguru import
|
|
9
|
+
from loguru import logger
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from loguru import RetentionFunction, RotationFunction
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
RotationType = Optional[str | int | time | timedelta | "RotationFunction"] # noqa: UP045
|
|
17
|
+
RetentionType = Optional[str | int | timedelta | "RetentionFunction"] # noqa: UP045
|
|
9
18
|
|
|
10
19
|
|
|
11
20
|
class InterceptHandler(logging.Handler):
|
|
@@ -36,8 +45,8 @@ def setup_logger(
|
|
|
36
45
|
appname: str,
|
|
37
46
|
output: str | Path,
|
|
38
47
|
level: str | int = "INFO",
|
|
39
|
-
rotation:
|
|
40
|
-
retention:
|
|
48
|
+
rotation: RotationType = "1 day",
|
|
49
|
+
retention: RetentionType = "30 days",
|
|
41
50
|
) -> None:
|
|
42
51
|
"""初始化日志系统
|
|
43
52
|
|
|
@@ -75,6 +84,13 @@ def setup_logger(
|
|
|
75
84
|
|
|
76
85
|
# 拦截标准 logging
|
|
77
86
|
logging.basicConfig(handlers=[InterceptHandler()], level=0, force=True)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
|
|
88
|
+
# 清除所有已存在的 logger handlers 并设置传播
|
|
89
|
+
logging.root.handlers = [InterceptHandler()]
|
|
90
|
+
logging.root.setLevel(0)
|
|
91
|
+
|
|
92
|
+
for name in list(logging.root.manager.loggerDict.keys()):
|
|
93
|
+
log = logging.getLogger(name)
|
|
94
|
+
log.handlers = []
|
|
95
|
+
log.propagate = True
|
|
96
|
+
log.setLevel(0)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Copyright (c) 2020-2026 XtraVisions, All rights reserved.
|
|
2
2
|
|
|
3
|
+
import logging
|
|
3
4
|
from typing import Any
|
|
4
5
|
|
|
5
6
|
from sqlobjects.database import close_db, create_tables, drop_tables, get_database, init_db
|
|
@@ -7,6 +8,13 @@ from sqlobjects.database import close_db, create_tables, drop_tables, get_databa
|
|
|
7
8
|
from ...events import EventType, event_bus
|
|
8
9
|
|
|
9
10
|
|
|
11
|
+
# 特殊处理:为 sqlalchemy logger 添加一个 dummy handler
|
|
12
|
+
# 防止 SQLAlchemy 在 echo=True 时自动添加 StreamHandler
|
|
13
|
+
sqlalchemy_logger = logging.getLogger("sqlalchemy.engine.Engine")
|
|
14
|
+
if not sqlalchemy_logger.handlers:
|
|
15
|
+
sqlalchemy_logger.addHandler(logging.NullHandler())
|
|
16
|
+
|
|
17
|
+
|
|
10
18
|
async def setup_db(
|
|
11
19
|
username: str,
|
|
12
20
|
password: str,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agstack
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Production-ready toolkit for building FastAPI and LLM applications
|
|
5
5
|
Author-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
|
|
6
6
|
Maintainer-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
|
|
@@ -20,24 +20,24 @@ Classifier: Typing :: Typed
|
|
|
20
20
|
Requires-Python: >=3.12
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: ag-ui-protocol>=0.1.
|
|
24
|
-
Requires-Dist: aio-pika>=9.
|
|
23
|
+
Requires-Dist: ag-ui-protocol>=0.1.13
|
|
24
|
+
Requires-Dist: aio-pika>=9.6.1
|
|
25
25
|
Requires-Dist: asyncpg>=0.30.0
|
|
26
|
-
Requires-Dist: elasticsearch[async]>=9.
|
|
27
|
-
Requires-Dist: fastapi>=0.
|
|
26
|
+
Requires-Dist: elasticsearch[async]>=9.3.0
|
|
27
|
+
Requires-Dist: fastapi>=0.133.0
|
|
28
28
|
Requires-Dist: jwcrypto>=1.5.6
|
|
29
29
|
Requires-Dist: loguru>=0.7.3
|
|
30
30
|
Requires-Dist: nebula3-python>=3.8.3
|
|
31
|
-
Requires-Dist: openai>=2.
|
|
31
|
+
Requires-Dist: openai>=2.24.0
|
|
32
32
|
Requires-Dist: passlib[bcrypt]>=1.7.4
|
|
33
|
-
Requires-Dist: pycasbin>=2.
|
|
33
|
+
Requires-Dist: pycasbin>=2.8.0
|
|
34
34
|
Requires-Dist: pydantic>=2.12.4
|
|
35
35
|
Requires-Dist: python-multipart>=0.0.20
|
|
36
36
|
Requires-Dist: requests>=2.32.5
|
|
37
|
-
Requires-Dist: sqlalchemy[asyncio]>=2.0.
|
|
38
|
-
Requires-Dist: sqlobjects>=1.0
|
|
37
|
+
Requires-Dist: sqlalchemy[asyncio]>=2.0.47
|
|
38
|
+
Requires-Dist: sqlobjects>=1.2.0
|
|
39
39
|
Requires-Dist: tiktoken>=0.12.0
|
|
40
|
-
Requires-Dist: uvicorn>=0.
|
|
40
|
+
Requires-Dist: uvicorn>=0.41.0
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
|
|
43
43
|
# AgStack
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
ag-ui-protocol>=0.1.13
|
|
2
|
+
aio-pika>=9.6.1
|
|
3
|
+
asyncpg>=0.30.0
|
|
4
|
+
elasticsearch[async]>=9.3.0
|
|
5
|
+
fastapi>=0.133.0
|
|
6
|
+
jwcrypto>=1.5.6
|
|
7
|
+
loguru>=0.7.3
|
|
8
|
+
nebula3-python>=3.8.3
|
|
9
|
+
openai>=2.24.0
|
|
10
|
+
passlib[bcrypt]>=1.7.4
|
|
11
|
+
pycasbin>=2.8.0
|
|
12
|
+
pydantic>=2.12.4
|
|
13
|
+
python-multipart>=0.0.20
|
|
14
|
+
requests>=2.32.5
|
|
15
|
+
sqlalchemy[asyncio]>=2.0.47
|
|
16
|
+
sqlobjects>=1.2.0
|
|
17
|
+
tiktoken>=0.12.0
|
|
18
|
+
uvicorn>=0.41.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "agstack"
|
|
3
|
-
version = "1.0.
|
|
3
|
+
version = "1.0.4"
|
|
4
4
|
description = "Production-ready toolkit for building FastAPI and LLM applications"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -39,36 +39,36 @@ classifiers = [
|
|
|
39
39
|
]
|
|
40
40
|
requires-python = ">=3.12"
|
|
41
41
|
dependencies = [
|
|
42
|
-
"ag-ui-protocol>=0.1.
|
|
43
|
-
"aio-pika>=9.
|
|
42
|
+
"ag-ui-protocol>=0.1.13",
|
|
43
|
+
"aio-pika>=9.6.1",
|
|
44
44
|
"asyncpg>=0.30.0",
|
|
45
|
-
"elasticsearch[async]>=9.
|
|
46
|
-
"fastapi>=0.
|
|
45
|
+
"elasticsearch[async]>=9.3.0",
|
|
46
|
+
"fastapi>=0.133.0",
|
|
47
47
|
"jwcrypto>=1.5.6",
|
|
48
48
|
"loguru>=0.7.3",
|
|
49
49
|
"nebula3-python>=3.8.3",
|
|
50
|
-
"openai>=2.
|
|
50
|
+
"openai>=2.24.0",
|
|
51
51
|
"passlib[bcrypt]>=1.7.4",
|
|
52
|
-
"pycasbin>=2.
|
|
52
|
+
"pycasbin>=2.8.0",
|
|
53
53
|
"pydantic>=2.12.4",
|
|
54
54
|
"python-multipart>=0.0.20",
|
|
55
55
|
"requests>=2.32.5",
|
|
56
|
-
"sqlalchemy[asyncio]>=2.0.
|
|
57
|
-
"sqlobjects>=1.0
|
|
56
|
+
"sqlalchemy[asyncio]>=2.0.47",
|
|
57
|
+
"sqlobjects>=1.2.0",
|
|
58
58
|
"tiktoken>=0.12.0",
|
|
59
|
-
"uvicorn>=0.
|
|
59
|
+
"uvicorn>=0.41.0",
|
|
60
60
|
]
|
|
61
61
|
[dependency-groups]
|
|
62
62
|
dev = [
|
|
63
63
|
"pre-commit>=4.4.0",
|
|
64
64
|
"pyright>=1.1.407",
|
|
65
|
-
"ruff>=0.
|
|
66
|
-
"setuptools>=
|
|
65
|
+
"ruff>=0.15.2",
|
|
66
|
+
"setuptools>=82.0.0",
|
|
67
67
|
]
|
|
68
68
|
|
|
69
69
|
#[[tool.uv.index]]
|
|
70
70
|
#name = "tsinghua"
|
|
71
|
-
#url = "https://
|
|
71
|
+
#url = "https://mirrors.aliyun.com/pypi/simple"
|
|
72
72
|
#default = true
|
|
73
73
|
|
|
74
74
|
[tool.pyright]
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
ag-ui-protocol>=0.1.10
|
|
2
|
-
aio-pika>=9.5.8
|
|
3
|
-
asyncpg>=0.30.0
|
|
4
|
-
elasticsearch[async]>=9.2.1
|
|
5
|
-
fastapi>=0.121.3
|
|
6
|
-
jwcrypto>=1.5.6
|
|
7
|
-
loguru>=0.7.3
|
|
8
|
-
nebula3-python>=3.8.3
|
|
9
|
-
openai>=2.16.0
|
|
10
|
-
passlib[bcrypt]>=1.7.4
|
|
11
|
-
pycasbin>=2.6.0
|
|
12
|
-
pydantic>=2.12.4
|
|
13
|
-
python-multipart>=0.0.20
|
|
14
|
-
requests>=2.32.5
|
|
15
|
-
sqlalchemy[asyncio]>=2.0.46
|
|
16
|
-
sqlobjects>=1.0.16
|
|
17
|
-
tiktoken>=0.12.0
|
|
18
|
-
uvicorn>=0.38.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|