aiforge-framework 0.3.0__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.
- aiforge_framework-0.3.0/PKG-INFO +18 -0
- aiforge_framework-0.3.0/README.md +109 -0
- aiforge_framework-0.3.0/pyproject.toml +34 -0
- aiforge_framework-0.3.0/setup.cfg +4 -0
- aiforge_framework-0.3.0/src/aiforge_framework.egg-info/PKG-INFO +18 -0
- aiforge_framework-0.3.0/src/aiforge_framework.egg-info/SOURCES.txt +56 -0
- aiforge_framework-0.3.0/src/aiforge_framework.egg-info/dependency_links.txt +1 -0
- aiforge_framework-0.3.0/src/aiforge_framework.egg-info/requires.txt +14 -0
- aiforge_framework-0.3.0/src/aiforge_framework.egg-info/top_level.txt +1 -0
- aiforge_framework-0.3.0/src/aipipe/__init__.py +49 -0
- aiforge_framework-0.3.0/src/aipipe/agents/__init__.py +5 -0
- aiforge_framework-0.3.0/src/aipipe/agents/agent.py +547 -0
- aiforge_framework-0.3.0/src/aipipe/agents/runner.py +18 -0
- aiforge_framework-0.3.0/src/aipipe/agents/task.py +9 -0
- aiforge_framework-0.3.0/src/aipipe/core/__init__.py +3 -0
- aiforge_framework-0.3.0/src/aipipe/core/context.py +30 -0
- aiforge_framework-0.3.0/src/aipipe/embeddings/__init__.py +5 -0
- aiforge_framework-0.3.0/src/aipipe/embeddings/client.py +79 -0
- aiforge_framework-0.3.0/src/aipipe/embeddings/config.py +38 -0
- aiforge_framework-0.3.0/src/aipipe/embeddings/factory.py +31 -0
- aiforge_framework-0.3.0/src/aipipe/exceptions.py +34 -0
- aiforge_framework-0.3.0/src/aipipe/llm/__init__.py +5 -0
- aiforge_framework-0.3.0/src/aipipe/llm/client.py +930 -0
- aiforge_framework-0.3.0/src/aipipe/llm/config.py +417 -0
- aiforge_framework-0.3.0/src/aipipe/llm/factory.py +198 -0
- aiforge_framework-0.3.0/src/aipipe/logs/__init__.py +3 -0
- aiforge_framework-0.3.0/src/aipipe/logs/logger.py +17 -0
- aiforge_framework-0.3.0/src/aipipe/mcp/__init__.py +4 -0
- aiforge_framework-0.3.0/src/aipipe/mcp/client.py +38 -0
- aiforge_framework-0.3.0/src/aipipe/mcp/config.py +23 -0
- aiforge_framework-0.3.0/src/aipipe/memory/__init__.py +4 -0
- aiforge_framework-0.3.0/src/aipipe/memory/in_memory.py +58 -0
- aiforge_framework-0.3.0/src/aipipe/memory/memory.py +17 -0
- aiforge_framework-0.3.0/src/aipipe/observability/__init__.py +5 -0
- aiforge_framework-0.3.0/src/aipipe/observability/events.py +22 -0
- aiforge_framework-0.3.0/src/aipipe/observability/trace.py +35 -0
- aiforge_framework-0.3.0/src/aipipe/observability/tracker.py +28 -0
- aiforge_framework-0.3.0/src/aipipe/observibility/__init__.py +3 -0
- aiforge_framework-0.3.0/src/aipipe/security/__init__.py +5 -0
- aiforge_framework-0.3.0/src/aipipe/security/detectors/__init__.py +5 -0
- aiforge_framework-0.3.0/src/aipipe/security/detectors/injection.py +25 -0
- aiforge_framework-0.3.0/src/aipipe/security/detectors/pii.py +25 -0
- aiforge_framework-0.3.0/src/aipipe/security/detectors/secrets.py +21 -0
- aiforge_framework-0.3.0/src/aipipe/security/manager.py +83 -0
- aiforge_framework-0.3.0/src/aipipe/security/policy.py +27 -0
- aiforge_framework-0.3.0/src/aipipe/security/result.py +21 -0
- aiforge_framework-0.3.0/src/aipipe/tools/__init__.py +5 -0
- aiforge_framework-0.3.0/src/aipipe/tools/executor.py +13 -0
- aiforge_framework-0.3.0/src/aipipe/tools/registry.py +39 -0
- aiforge_framework-0.3.0/src/aipipe/tools/tool.py +66 -0
- aiforge_framework-0.3.0/src/aipipe/workflows/__init__.py +3 -0
- aiforge_framework-0.3.0/src/aipipe/workflows/workflow.py +35 -0
- aiforge_framework-0.3.0/tests/test_core.py +23 -0
- aiforge_framework-0.3.0/tests/test_imports.py +8 -0
- aiforge_framework-0.3.0/tests/test_llm_config.py +26 -0
- aiforge_framework-0.3.0/tests/test_ollama.py +210 -0
- aiforge_framework-0.3.0/tests/test_security.py +21 -0
- aiforge_framework-0.3.0/tests/test_tools.py +14 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aiforge-framework
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Provider-independent AI pipeline framework
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Requires-Dist: pydantic>=2.7
|
|
7
|
+
Requires-Dist: pyyaml>=6.0
|
|
8
|
+
Requires-Dist: langchain<2,>=1.0
|
|
9
|
+
Requires-Dist: langchain-core<2,>=1.0
|
|
10
|
+
Requires-Dist: langchain-ollama<2,>=1.0
|
|
11
|
+
Requires-Dist: langchain-openai<2,>=1.0
|
|
12
|
+
Requires-Dist: langchain-google-genai<5,>=4.0
|
|
13
|
+
Requires-Dist: langgraph<2,>=1.0
|
|
14
|
+
Requires-Dist: ollama>=0.6
|
|
15
|
+
Requires-Dist: mcp<3,>=2.0
|
|
16
|
+
Provides-Extra: test
|
|
17
|
+
Requires-Dist: pytest>=8.0; extra == "test"
|
|
18
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "test"
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# aipipe 0.3.0
|
|
2
|
+
|
|
3
|
+
Provider-independent AI framework with modules for:
|
|
4
|
+
|
|
5
|
+
- agents
|
|
6
|
+
- core
|
|
7
|
+
- embeddings
|
|
8
|
+
- llm
|
|
9
|
+
- mcp
|
|
10
|
+
- observability
|
|
11
|
+
- security
|
|
12
|
+
- tools
|
|
13
|
+
- workflows
|
|
14
|
+
- exceptions
|
|
15
|
+
- logs
|
|
16
|
+
- tests
|
|
17
|
+
|
|
18
|
+
## Architecture
|
|
19
|
+
|
|
20
|
+
Application
|
|
21
|
+
|
|
|
22
|
+
v
|
|
23
|
+
aipipe
|
|
24
|
+
|
|
|
25
|
+
+-- llm
|
|
26
|
+
+-- embeddings
|
|
27
|
+
+-- agents
|
|
28
|
+
+-- tools
|
|
29
|
+
+-- memory
|
|
30
|
+
+-- security
|
|
31
|
+
+-- observability
|
|
32
|
+
+-- mcp
|
|
33
|
+
+-- workflows
|
|
34
|
+
+-- logs
|
|
35
|
+
+-- core
|
|
36
|
+
|
|
37
|
+
`aipipe` contains generic infrastructure only. Domain-specific logic such
|
|
38
|
+
as quiz security belongs in the consuming application.
|
|
39
|
+
|
|
40
|
+
## Ollama modes
|
|
41
|
+
|
|
42
|
+
### 1. Local Ollama / signed-in cloud model
|
|
43
|
+
|
|
44
|
+
After:
|
|
45
|
+
|
|
46
|
+
ollama signin
|
|
47
|
+
|
|
48
|
+
you can use cloud-backed models through the local Ollama service:
|
|
49
|
+
|
|
50
|
+
ollama run gemma4:cloud
|
|
51
|
+
|
|
52
|
+
Configuration:
|
|
53
|
+
|
|
54
|
+
provider: ollama
|
|
55
|
+
model: gemma4:cloud
|
|
56
|
+
base_url: http://localhost:11434
|
|
57
|
+
|
|
58
|
+
No API key is sent to localhost.
|
|
59
|
+
|
|
60
|
+
### 2. Direct Ollama Cloud API
|
|
61
|
+
|
|
62
|
+
Configuration:
|
|
63
|
+
|
|
64
|
+
provider: ollama
|
|
65
|
+
model: gemma4:31b
|
|
66
|
+
base_url: https://ollama.com
|
|
67
|
+
api_key_env: OLLAMA_API_KEY
|
|
68
|
+
|
|
69
|
+
Never commit or print the API key.
|
|
70
|
+
|
|
71
|
+
## Basic API
|
|
72
|
+
|
|
73
|
+
from aipipe import LLM
|
|
74
|
+
|
|
75
|
+
llm = LLM.from_config("config/llm.yaml")
|
|
76
|
+
print(llm.generate("Reply with exactly: HELLO"))
|
|
77
|
+
|
|
78
|
+
`LLM.from_config()` accepts:
|
|
79
|
+
|
|
80
|
+
- LLMConfig
|
|
81
|
+
- YAML path
|
|
82
|
+
- dictionary
|
|
83
|
+
|
|
84
|
+
## Tests
|
|
85
|
+
|
|
86
|
+
Run all framework tests:
|
|
87
|
+
|
|
88
|
+
pytest -q
|
|
89
|
+
|
|
90
|
+
Run local signed-in Ollama tests:
|
|
91
|
+
|
|
92
|
+
pytest -q tests/test_ollama.py -m ollama_local
|
|
93
|
+
|
|
94
|
+
Run direct Cloud API tests:
|
|
95
|
+
|
|
96
|
+
pytest -q tests/test_ollama.py -m ollama_api
|
|
97
|
+
|
|
98
|
+
Run core tests only:
|
|
99
|
+
|
|
100
|
+
pytest -q tests/test_core.py tests/test_security.py tests/test_tools.py
|
|
101
|
+
|
|
102
|
+
The direct Cloud API test is intentionally a real inference test. A 401 is
|
|
103
|
+
reported as a failure; model-list access alone is not considered inference
|
|
104
|
+
health.
|
|
105
|
+
|
|
106
|
+
## Logs
|
|
107
|
+
|
|
108
|
+
Runtime logs are written through `aipipe.logs`. Applications can configure
|
|
109
|
+
the logger without exposing prompts, responses, or secrets.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "aiforge-framework"
|
|
7
|
+
version = "0.3.0"
|
|
8
|
+
description = "Provider-independent AI pipeline framework"
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
|
+
|
|
11
|
+
dependencies = [
|
|
12
|
+
"pydantic>=2.7",
|
|
13
|
+
"pyyaml>=6.0",
|
|
14
|
+
"langchain>=1.0,<2",
|
|
15
|
+
"langchain-core>=1.0,<2",
|
|
16
|
+
"langchain-ollama>=1.0,<2",
|
|
17
|
+
"langchain-openai>=1.0,<2",
|
|
18
|
+
"langchain-google-genai>=4.0,<5",
|
|
19
|
+
"langgraph>=1.0,<2",
|
|
20
|
+
"ollama>=0.6",
|
|
21
|
+
"mcp>=2.0,<3",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
test = [
|
|
26
|
+
"pytest>=8.0",
|
|
27
|
+
"pytest-asyncio>=0.23",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[tool.setuptools]
|
|
31
|
+
package-dir = {"" = "src"}
|
|
32
|
+
|
|
33
|
+
[tool.setuptools.packages.find]
|
|
34
|
+
where = ["src"]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aiforge-framework
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Provider-independent AI pipeline framework
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Requires-Dist: pydantic>=2.7
|
|
7
|
+
Requires-Dist: pyyaml>=6.0
|
|
8
|
+
Requires-Dist: langchain<2,>=1.0
|
|
9
|
+
Requires-Dist: langchain-core<2,>=1.0
|
|
10
|
+
Requires-Dist: langchain-ollama<2,>=1.0
|
|
11
|
+
Requires-Dist: langchain-openai<2,>=1.0
|
|
12
|
+
Requires-Dist: langchain-google-genai<5,>=4.0
|
|
13
|
+
Requires-Dist: langgraph<2,>=1.0
|
|
14
|
+
Requires-Dist: ollama>=0.6
|
|
15
|
+
Requires-Dist: mcp<3,>=2.0
|
|
16
|
+
Provides-Extra: test
|
|
17
|
+
Requires-Dist: pytest>=8.0; extra == "test"
|
|
18
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "test"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/aiforge_framework.egg-info/PKG-INFO
|
|
4
|
+
src/aiforge_framework.egg-info/SOURCES.txt
|
|
5
|
+
src/aiforge_framework.egg-info/dependency_links.txt
|
|
6
|
+
src/aiforge_framework.egg-info/requires.txt
|
|
7
|
+
src/aiforge_framework.egg-info/top_level.txt
|
|
8
|
+
src/aipipe/__init__.py
|
|
9
|
+
src/aipipe/exceptions.py
|
|
10
|
+
src/aipipe/agents/__init__.py
|
|
11
|
+
src/aipipe/agents/agent.py
|
|
12
|
+
src/aipipe/agents/runner.py
|
|
13
|
+
src/aipipe/agents/task.py
|
|
14
|
+
src/aipipe/core/__init__.py
|
|
15
|
+
src/aipipe/core/context.py
|
|
16
|
+
src/aipipe/embeddings/__init__.py
|
|
17
|
+
src/aipipe/embeddings/client.py
|
|
18
|
+
src/aipipe/embeddings/config.py
|
|
19
|
+
src/aipipe/embeddings/factory.py
|
|
20
|
+
src/aipipe/llm/__init__.py
|
|
21
|
+
src/aipipe/llm/client.py
|
|
22
|
+
src/aipipe/llm/config.py
|
|
23
|
+
src/aipipe/llm/factory.py
|
|
24
|
+
src/aipipe/logs/__init__.py
|
|
25
|
+
src/aipipe/logs/logger.py
|
|
26
|
+
src/aipipe/mcp/__init__.py
|
|
27
|
+
src/aipipe/mcp/client.py
|
|
28
|
+
src/aipipe/mcp/config.py
|
|
29
|
+
src/aipipe/memory/__init__.py
|
|
30
|
+
src/aipipe/memory/in_memory.py
|
|
31
|
+
src/aipipe/memory/memory.py
|
|
32
|
+
src/aipipe/observability/__init__.py
|
|
33
|
+
src/aipipe/observability/events.py
|
|
34
|
+
src/aipipe/observability/trace.py
|
|
35
|
+
src/aipipe/observability/tracker.py
|
|
36
|
+
src/aipipe/observibility/__init__.py
|
|
37
|
+
src/aipipe/security/__init__.py
|
|
38
|
+
src/aipipe/security/manager.py
|
|
39
|
+
src/aipipe/security/policy.py
|
|
40
|
+
src/aipipe/security/result.py
|
|
41
|
+
src/aipipe/security/detectors/__init__.py
|
|
42
|
+
src/aipipe/security/detectors/injection.py
|
|
43
|
+
src/aipipe/security/detectors/pii.py
|
|
44
|
+
src/aipipe/security/detectors/secrets.py
|
|
45
|
+
src/aipipe/tools/__init__.py
|
|
46
|
+
src/aipipe/tools/executor.py
|
|
47
|
+
src/aipipe/tools/registry.py
|
|
48
|
+
src/aipipe/tools/tool.py
|
|
49
|
+
src/aipipe/workflows/__init__.py
|
|
50
|
+
src/aipipe/workflows/workflow.py
|
|
51
|
+
tests/test_core.py
|
|
52
|
+
tests/test_imports.py
|
|
53
|
+
tests/test_llm_config.py
|
|
54
|
+
tests/test_ollama.py
|
|
55
|
+
tests/test_security.py
|
|
56
|
+
tests/test_tools.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
pydantic>=2.7
|
|
2
|
+
pyyaml>=6.0
|
|
3
|
+
langchain<2,>=1.0
|
|
4
|
+
langchain-core<2,>=1.0
|
|
5
|
+
langchain-ollama<2,>=1.0
|
|
6
|
+
langchain-openai<2,>=1.0
|
|
7
|
+
langchain-google-genai<5,>=4.0
|
|
8
|
+
langgraph<2,>=1.0
|
|
9
|
+
ollama>=0.6
|
|
10
|
+
mcp<3,>=2.0
|
|
11
|
+
|
|
12
|
+
[test]
|
|
13
|
+
pytest>=8.0
|
|
14
|
+
pytest-asyncio>=0.23
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aipipe
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from .exceptions import (
|
|
2
|
+
AIPipeError,
|
|
3
|
+
ConfigurationError,
|
|
4
|
+
ProviderError,
|
|
5
|
+
SecurityError,
|
|
6
|
+
)
|
|
7
|
+
from .core import AIContext
|
|
8
|
+
from .llm import LLM, LLMConfig, LLMResponse
|
|
9
|
+
from .embeddings import Embeddings, EmbeddingConfig
|
|
10
|
+
from .agents import Agent, AgentRunner, Task
|
|
11
|
+
from .tools import Tool, ToolRegistry, ToolExecutor
|
|
12
|
+
from .memory import Memory, InMemoryMemory
|
|
13
|
+
from .mcp import MCPClient, MCPConfig, MCPServerConfig
|
|
14
|
+
from .security import SecurityManager, SecurityPolicy, SecurityResult
|
|
15
|
+
from .observability import Event, Trace, Tracker
|
|
16
|
+
from .workflows import Workflow
|
|
17
|
+
from .logs import get_logger
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"AIPipeError",
|
|
21
|
+
"ConfigurationError",
|
|
22
|
+
"ProviderError",
|
|
23
|
+
"SecurityError",
|
|
24
|
+
"AIContext",
|
|
25
|
+
"LLM",
|
|
26
|
+
"LLMConfig",
|
|
27
|
+
"LLMResponse",
|
|
28
|
+
"Embeddings",
|
|
29
|
+
"EmbeddingConfig",
|
|
30
|
+
"Agent",
|
|
31
|
+
"AgentRunner",
|
|
32
|
+
"Task",
|
|
33
|
+
"Tool",
|
|
34
|
+
"ToolRegistry",
|
|
35
|
+
"ToolExecutor",
|
|
36
|
+
"Memory",
|
|
37
|
+
"InMemoryMemory",
|
|
38
|
+
"MCPClient",
|
|
39
|
+
"MCPConfig",
|
|
40
|
+
"MCPServerConfig",
|
|
41
|
+
"SecurityManager",
|
|
42
|
+
"SecurityPolicy",
|
|
43
|
+
"SecurityResult",
|
|
44
|
+
"Event",
|
|
45
|
+
"Trace",
|
|
46
|
+
"Tracker",
|
|
47
|
+
"Workflow",
|
|
48
|
+
"get_logger",
|
|
49
|
+
]
|