thinkai-framework 0.2.0__tar.gz → 0.2.2__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.
- {thinkai_framework-0.2.0/thinkai_framework.egg-info → thinkai_framework-0.2.2}/PKG-INFO +10 -5
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/README.md +6 -2
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/pyproject.toml +3 -3
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/tests/test_thinkai.py +1 -1
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/__init__.py +2 -2
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/rag/pipeline.py +5 -4
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2/thinkai_framework.egg-info}/PKG-INFO +10 -5
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai_framework.egg-info/requires.txt +4 -2
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/.env.example +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/LICENSE +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/MANIFEST.in +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/config.example.yaml +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/examples/agent_example.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/examples/basic_usage.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/examples/fastapi_demo.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/examples/rag_example.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/setup.cfg +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/agent/__init__.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/agent/base.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/agent/react.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/agent/tool.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/core/__init__.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/core/client.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/core/config.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/core/models.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/exceptions.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/middleware/__init__.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/middleware/base.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/middleware/logging_middleware.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/middleware/retry_middleware.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/prompt/template.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/__init__.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/base.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/claude.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/deepseek.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/gemini.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/ollama.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/openai.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/openai_compatible.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/qwen.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/registry.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/providers/shortcuts.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/rag/__init__.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/rag/chroma_store.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/rag/document_loader.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/rag/text_splitter.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/rag/vector_store.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/session/__init__.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/session/context.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/session/manager.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/session/memory.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/session/storage.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/streaming.py +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai_framework.egg-info/SOURCES.txt +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai_framework.egg-info/dependency_links.txt +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai_framework.egg-info/entry_points.txt +0 -0
- {thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai_framework.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: thinkai-framework
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Enterprise-grade AI framework for seamless LLM integration
|
|
5
5
|
Author-email: ThinkAi Team <thinkai@example.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -19,13 +19,14 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Requires-Python: >=3.9
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
|
-
Requires-Dist: fastapi>=0.100.0
|
|
23
22
|
Requires-Dist: pydantic>=2.0
|
|
24
23
|
Requires-Dist: pydantic-settings>=2.0
|
|
25
24
|
Requires-Dist: httpx>=0.24.0
|
|
26
25
|
Requires-Dist: pyyaml>=6.0
|
|
27
26
|
Requires-Dist: python-dotenv>=1.0.0
|
|
28
27
|
Requires-Dist: tenacity>=8.0.0
|
|
28
|
+
Provides-Extra: web
|
|
29
|
+
Requires-Dist: fastapi>=0.100.0; extra == "web"
|
|
29
30
|
Provides-Extra: ollama
|
|
30
31
|
Requires-Dist: ollama>=0.1.0; extra == "ollama"
|
|
31
32
|
Provides-Extra: openai
|
|
@@ -52,15 +53,16 @@ Requires-Dist: black>=23.0; extra == "dev"
|
|
|
52
53
|
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
53
54
|
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
54
55
|
Provides-Extra: all
|
|
55
|
-
Requires-Dist: thinkai[agent,claude,deepseek,gemini,ollama,openai,qwen,rag]; extra == "all"
|
|
56
|
+
Requires-Dist: thinkai[agent,claude,deepseek,gemini,ollama,openai,qwen,rag,web]; extra == "all"
|
|
56
57
|
Dynamic: license-file
|
|
57
58
|
|
|
58
59
|
# ThinkAi - Enterprise AI Framework
|
|
59
60
|
|
|
60
|
-
基于
|
|
61
|
+
基于Python异步的企业级AI大模型集成框架 - **开箱即用,简单易用,功能全面**
|
|
61
62
|
|
|
62
63
|
## 特性
|
|
63
64
|
|
|
65
|
+
- **轻量零依赖** - 核心框架不依赖任何Web框架,完全脱离FastAPI
|
|
64
66
|
- **多模型支持** - 支持Ollama、OpenAI、通义千问、DeepSeek、Claude、Gemini等主流大模型
|
|
65
67
|
- **统一接口** - 一次配置,多模型自由切换
|
|
66
68
|
- **开箱即用** - 简单配置即可使用,无需复杂配置
|
|
@@ -75,9 +77,12 @@ Dynamic: license-file
|
|
|
75
77
|
## 安装
|
|
76
78
|
|
|
77
79
|
```bash
|
|
78
|
-
# 基础安装
|
|
80
|
+
# 基础安装 (轻量核心,无任何Web框架依赖)
|
|
79
81
|
pip install thinkai-framework
|
|
80
82
|
|
|
83
|
+
# Web开发支持(安装FastAPI依赖,用于构建API服务)
|
|
84
|
+
pip install thinkai-framework[web]
|
|
85
|
+
|
|
81
86
|
# 安装特定Provider
|
|
82
87
|
pip install thinkai-framework[ollama]
|
|
83
88
|
pip install thinkai-framework[openai]
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# ThinkAi - Enterprise AI Framework
|
|
2
2
|
|
|
3
|
-
基于
|
|
3
|
+
基于Python异步的企业级AI大模型集成框架 - **开箱即用,简单易用,功能全面**
|
|
4
4
|
|
|
5
5
|
## 特性
|
|
6
6
|
|
|
7
|
+
- **轻量零依赖** - 核心框架不依赖任何Web框架,完全脱离FastAPI
|
|
7
8
|
- **多模型支持** - 支持Ollama、OpenAI、通义千问、DeepSeek、Claude、Gemini等主流大模型
|
|
8
9
|
- **统一接口** - 一次配置,多模型自由切换
|
|
9
10
|
- **开箱即用** - 简单配置即可使用,无需复杂配置
|
|
@@ -18,9 +19,12 @@
|
|
|
18
19
|
## 安装
|
|
19
20
|
|
|
20
21
|
```bash
|
|
21
|
-
# 基础安装
|
|
22
|
+
# 基础安装 (轻量核心,无任何Web框架依赖)
|
|
22
23
|
pip install thinkai-framework
|
|
23
24
|
|
|
25
|
+
# Web开发支持(安装FastAPI依赖,用于构建API服务)
|
|
26
|
+
pip install thinkai-framework[web]
|
|
27
|
+
|
|
24
28
|
# 安装特定Provider
|
|
25
29
|
pip install thinkai-framework[ollama]
|
|
26
30
|
pip install thinkai-framework[openai]
|
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "thinkai-framework"
|
|
8
|
-
version = "0.2.
|
|
8
|
+
version = "0.2.2"
|
|
9
9
|
description = "Enterprise-grade AI framework for seamless LLM integration"
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
license = "MIT"
|
|
@@ -25,7 +25,6 @@ classifiers = [
|
|
|
25
25
|
]
|
|
26
26
|
|
|
27
27
|
dependencies = [
|
|
28
|
-
"fastapi>=0.100.0",
|
|
29
28
|
"pydantic>=2.0",
|
|
30
29
|
"pydantic-settings>=2.0",
|
|
31
30
|
"httpx>=0.24.0",
|
|
@@ -35,6 +34,7 @@ dependencies = [
|
|
|
35
34
|
]
|
|
36
35
|
|
|
37
36
|
[project.optional-dependencies]
|
|
37
|
+
web = ["fastapi>=0.100.0"]
|
|
38
38
|
ollama = ["ollama>=0.1.0"]
|
|
39
39
|
openai = ["openai>=1.0.0"]
|
|
40
40
|
qwen = ["dashscope>=1.0.0"]
|
|
@@ -56,7 +56,7 @@ dev = [
|
|
|
56
56
|
"mypy>=1.0",
|
|
57
57
|
]
|
|
58
58
|
all = [
|
|
59
|
-
"thinkai[ollama,openai,qwen,deepseek,claude,gemini,rag,agent]",
|
|
59
|
+
"thinkai[web,ollama,openai,qwen,deepseek,claude,gemini,rag,agent]",
|
|
60
60
|
]
|
|
61
61
|
|
|
62
62
|
[project.urls]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"""
|
|
2
2
|
ThinkAi - Enterprise-grade AI Framework
|
|
3
|
-
基于
|
|
3
|
+
基于Python异步的企业级AI大模型集成框架
|
|
4
4
|
开箱即用,支持多模型,RAG,Agent等核心能力
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
__version__ = "0.2.
|
|
7
|
+
__version__ = "0.2.2"
|
|
8
8
|
__author__ = "ThinkAi Team"
|
|
9
9
|
|
|
10
10
|
from thinkai.core.client import ThinkAI
|
|
@@ -173,10 +173,11 @@ class RAGPipeline:
|
|
|
173
173
|
|
|
174
174
|
if not context_docs:
|
|
175
175
|
# 没有检索到文档,直接提问
|
|
176
|
-
|
|
176
|
+
response = await self.ai_client.chat(question)
|
|
177
|
+
return response.content
|
|
177
178
|
|
|
178
179
|
# 2. 构建上下文
|
|
179
|
-
context = "\n\n".join([doc["
|
|
180
|
+
context = "\n\n".join([doc["text"] for doc in context_docs])
|
|
180
181
|
|
|
181
182
|
# 3. 构建增强Prompt
|
|
182
183
|
template_name = prompt_template or "rag_query"
|
|
@@ -187,9 +188,9 @@ class RAGPipeline:
|
|
|
187
188
|
)
|
|
188
189
|
|
|
189
190
|
# 4. 生成回答
|
|
190
|
-
response = await self.ai_client.
|
|
191
|
+
response = await self.ai_client.chat(prompt)
|
|
191
192
|
|
|
192
|
-
return response
|
|
193
|
+
return response.content
|
|
193
194
|
|
|
194
195
|
async def add_document(self, document_path: str):
|
|
195
196
|
"""添加单个文档"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: thinkai-framework
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Enterprise-grade AI framework for seamless LLM integration
|
|
5
5
|
Author-email: ThinkAi Team <thinkai@example.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -19,13 +19,14 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Requires-Python: >=3.9
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
|
-
Requires-Dist: fastapi>=0.100.0
|
|
23
22
|
Requires-Dist: pydantic>=2.0
|
|
24
23
|
Requires-Dist: pydantic-settings>=2.0
|
|
25
24
|
Requires-Dist: httpx>=0.24.0
|
|
26
25
|
Requires-Dist: pyyaml>=6.0
|
|
27
26
|
Requires-Dist: python-dotenv>=1.0.0
|
|
28
27
|
Requires-Dist: tenacity>=8.0.0
|
|
28
|
+
Provides-Extra: web
|
|
29
|
+
Requires-Dist: fastapi>=0.100.0; extra == "web"
|
|
29
30
|
Provides-Extra: ollama
|
|
30
31
|
Requires-Dist: ollama>=0.1.0; extra == "ollama"
|
|
31
32
|
Provides-Extra: openai
|
|
@@ -52,15 +53,16 @@ Requires-Dist: black>=23.0; extra == "dev"
|
|
|
52
53
|
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
53
54
|
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
54
55
|
Provides-Extra: all
|
|
55
|
-
Requires-Dist: thinkai[agent,claude,deepseek,gemini,ollama,openai,qwen,rag]; extra == "all"
|
|
56
|
+
Requires-Dist: thinkai[agent,claude,deepseek,gemini,ollama,openai,qwen,rag,web]; extra == "all"
|
|
56
57
|
Dynamic: license-file
|
|
57
58
|
|
|
58
59
|
# ThinkAi - Enterprise AI Framework
|
|
59
60
|
|
|
60
|
-
基于
|
|
61
|
+
基于Python异步的企业级AI大模型集成框架 - **开箱即用,简单易用,功能全面**
|
|
61
62
|
|
|
62
63
|
## 特性
|
|
63
64
|
|
|
65
|
+
- **轻量零依赖** - 核心框架不依赖任何Web框架,完全脱离FastAPI
|
|
64
66
|
- **多模型支持** - 支持Ollama、OpenAI、通义千问、DeepSeek、Claude、Gemini等主流大模型
|
|
65
67
|
- **统一接口** - 一次配置,多模型自由切换
|
|
66
68
|
- **开箱即用** - 简单配置即可使用,无需复杂配置
|
|
@@ -75,9 +77,12 @@ Dynamic: license-file
|
|
|
75
77
|
## 安装
|
|
76
78
|
|
|
77
79
|
```bash
|
|
78
|
-
# 基础安装
|
|
80
|
+
# 基础安装 (轻量核心,无任何Web框架依赖)
|
|
79
81
|
pip install thinkai-framework
|
|
80
82
|
|
|
83
|
+
# Web开发支持(安装FastAPI依赖,用于构建API服务)
|
|
84
|
+
pip install thinkai-framework[web]
|
|
85
|
+
|
|
81
86
|
# 安装特定Provider
|
|
82
87
|
pip install thinkai-framework[ollama]
|
|
83
88
|
pip install thinkai-framework[openai]
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
fastapi>=0.100.0
|
|
2
1
|
pydantic>=2.0
|
|
3
2
|
pydantic-settings>=2.0
|
|
4
3
|
httpx>=0.24.0
|
|
@@ -10,7 +9,7 @@ tenacity>=8.0.0
|
|
|
10
9
|
openai>=1.0.0
|
|
11
10
|
|
|
12
11
|
[all]
|
|
13
|
-
thinkai[agent,claude,deepseek,gemini,ollama,openai,qwen,rag]
|
|
12
|
+
thinkai[agent,claude,deepseek,gemini,ollama,openai,qwen,rag,web]
|
|
14
13
|
|
|
15
14
|
[claude]
|
|
16
15
|
anthropic>=0.7.0
|
|
@@ -42,3 +41,6 @@ chromadb>=0.4.0
|
|
|
42
41
|
tiktoken>=0.5.0
|
|
43
42
|
pypdf>=3.0
|
|
44
43
|
python-docx>=0.8.0
|
|
44
|
+
|
|
45
|
+
[web]
|
|
46
|
+
fastapi>=0.100.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
|
{thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai/middleware/logging_middleware.py
RENAMED
|
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
|
{thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai_framework.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai_framework.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{thinkai_framework-0.2.0 → thinkai_framework-0.2.2}/thinkai_framework.egg-info/top_level.txt
RENAMED
|
File without changes
|