abstractcore 2.4.4__py3-none-any.whl → 2.4.6__py3-none-any.whl
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.
- abstractcore/cli/__init__.py +9 -0
- abstractcore/cli/main.py +759 -0
- abstractcore/cli/vision_config.py +491 -0
- abstractcore/core/interface.py +7 -0
- abstractcore/core/session.py +27 -2
- abstractcore/media/handlers/__init__.py +16 -0
- abstractcore/media/handlers/anthropic_handler.py +326 -0
- abstractcore/media/handlers/local_handler.py +541 -0
- abstractcore/media/handlers/openai_handler.py +281 -0
- abstractcore/media/processors/__init__.py +13 -0
- abstractcore/media/processors/image_processor.py +610 -0
- abstractcore/media/processors/office_processor.py +490 -0
- abstractcore/media/processors/pdf_processor.py +485 -0
- abstractcore/media/processors/text_processor.py +557 -0
- abstractcore/media/utils/__init__.py +22 -0
- abstractcore/media/utils/image_scaler.py +306 -0
- abstractcore/providers/anthropic_provider.py +14 -2
- abstractcore/providers/base.py +24 -0
- abstractcore/providers/huggingface_provider.py +23 -9
- abstractcore/providers/lmstudio_provider.py +6 -1
- abstractcore/providers/mlx_provider.py +20 -7
- abstractcore/providers/ollama_provider.py +6 -1
- abstractcore/providers/openai_provider.py +6 -2
- abstractcore/tools/common_tools.py +651 -1
- abstractcore/utils/version.py +1 -1
- {abstractcore-2.4.4.dist-info → abstractcore-2.4.6.dist-info}/METADATA +59 -9
- {abstractcore-2.4.4.dist-info → abstractcore-2.4.6.dist-info}/RECORD +31 -17
- {abstractcore-2.4.4.dist-info → abstractcore-2.4.6.dist-info}/entry_points.txt +2 -0
- {abstractcore-2.4.4.dist-info → abstractcore-2.4.6.dist-info}/WHEEL +0 -0
- {abstractcore-2.4.4.dist-info → abstractcore-2.4.6.dist-info}/licenses/LICENSE +0 -0
- {abstractcore-2.4.4.dist-info → abstractcore-2.4.6.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: abstractcore
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.6
|
|
4
4
|
Summary: Unified interface to all LLM providers with essential infrastructure for tool calling, streaming, and model management
|
|
5
5
|
Author-email: Laurent-Philippe Albou <contact@abstractcore.ai>
|
|
6
6
|
Maintainer-email: Laurent-Philippe Albou <contact@abstractcore.ai>
|
|
@@ -122,6 +122,21 @@ response = llm.generate("What is the capital of France?")
|
|
|
122
122
|
print(response.content)
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
+
### Deterministic Generation
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
from abstractcore import create_llm
|
|
129
|
+
|
|
130
|
+
# Deterministic outputs with seed + temperature=0
|
|
131
|
+
llm = create_llm("openai", model="gpt-3.5-turbo", seed=42, temperature=0.0)
|
|
132
|
+
|
|
133
|
+
# These will produce identical outputs
|
|
134
|
+
response1 = llm.generate("Write exactly 3 words about coding")
|
|
135
|
+
response2 = llm.generate("Write exactly 3 words about coding")
|
|
136
|
+
print(f"Response 1: {response1.content}") # "Innovative, challenging, rewarding."
|
|
137
|
+
print(f"Response 2: {response2.content}") # "Innovative, challenging, rewarding."
|
|
138
|
+
```
|
|
139
|
+
|
|
125
140
|
### Tool Calling
|
|
126
141
|
|
|
127
142
|
```python
|
|
@@ -140,6 +155,39 @@ response = llm.generate(
|
|
|
140
155
|
print(response.content)
|
|
141
156
|
```
|
|
142
157
|
|
|
158
|
+
### Built-in Tools
|
|
159
|
+
|
|
160
|
+
AbstractCore includes a comprehensive set of ready-to-use tools for common tasks:
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
from abstractcore.tools.common_tools import fetch_url, search_files, read_file
|
|
164
|
+
|
|
165
|
+
# Intelligent web content fetching with automatic parsing
|
|
166
|
+
result = fetch_url("https://api.github.com/repos/python/cpython")
|
|
167
|
+
# Automatically detects JSON, HTML, images, PDFs, etc. and provides structured analysis
|
|
168
|
+
|
|
169
|
+
# File system operations
|
|
170
|
+
files = search_files("def.*fetch", ".", file_pattern="*.py") # Find function definitions
|
|
171
|
+
content = read_file("config.json") # Read file contents
|
|
172
|
+
|
|
173
|
+
# Use with any LLM
|
|
174
|
+
llm = create_llm("anthropic", model="claude-3-5-haiku-latest")
|
|
175
|
+
response = llm.generate(
|
|
176
|
+
"Analyze this API response and summarize the key information",
|
|
177
|
+
tools=[fetch_url]
|
|
178
|
+
)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Available Tools:**
|
|
182
|
+
- `fetch_url` - Intelligent web content fetching with automatic content type detection and parsing
|
|
183
|
+
- `search_files` - Search for text patterns inside files using regex
|
|
184
|
+
- `list_files` - Find and list files by names/paths using glob patterns
|
|
185
|
+
- `read_file` - Read file contents with optional line range selection
|
|
186
|
+
- `write_file` - Write content to files with directory creation
|
|
187
|
+
- `edit_file` - Edit files using pattern matching and replacement
|
|
188
|
+
- `web_search` - Search the web using DuckDuckGo
|
|
189
|
+
- `execute_command` - Execute shell commands safely with security controls
|
|
190
|
+
|
|
143
191
|
### Session Management
|
|
144
192
|
|
|
145
193
|
```python
|
|
@@ -228,14 +276,16 @@ response = llm.generate(
|
|
|
228
276
|
|
|
229
277
|
## Supported Providers
|
|
230
278
|
|
|
231
|
-
| Provider | Status | Setup |
|
|
232
|
-
|
|
233
|
-
| **OpenAI** | Full | [Get API key](docs/prerequisites.md#openai-setup) |
|
|
234
|
-
| **Anthropic** | Full | [Get API key](docs/prerequisites.md#anthropic-setup) |
|
|
235
|
-
| **Ollama** | Full | [Install guide](docs/prerequisites.md#ollama-setup) |
|
|
236
|
-
| **LMStudio** | Full | [Install guide](docs/prerequisites.md#lmstudio-setup) |
|
|
237
|
-
| **MLX** | Full | [Setup guide](docs/prerequisites.md#mlx-setup) |
|
|
238
|
-
| **HuggingFace** | Full | [Setup guide](docs/prerequisites.md#huggingface-setup) |
|
|
279
|
+
| Provider | Status | SEED Support | Setup |
|
|
280
|
+
|----------|--------|-------------|-------|
|
|
281
|
+
| **OpenAI** | Full | ✅ Native | [Get API key](docs/prerequisites.md#openai-setup) |
|
|
282
|
+
| **Anthropic** | Full | ⚠️ Warning* | [Get API key](docs/prerequisites.md#anthropic-setup) |
|
|
283
|
+
| **Ollama** | Full | ✅ Native | [Install guide](docs/prerequisites.md#ollama-setup) |
|
|
284
|
+
| **LMStudio** | Full | ✅ Native | [Install guide](docs/prerequisites.md#lmstudio-setup) |
|
|
285
|
+
| **MLX** | Full | ✅ Native | [Setup guide](docs/prerequisites.md#mlx-setup) |
|
|
286
|
+
| **HuggingFace** | Full | ✅ Native | [Setup guide](docs/prerequisites.md#huggingface-setup) |
|
|
287
|
+
|
|
288
|
+
*Anthropic doesn't support seed parameters but issues a warning when provided. Use `temperature=0.0` for more consistent outputs.
|
|
239
289
|
|
|
240
290
|
## Server Mode (Optional HTTP REST API)
|
|
241
291
|
|
|
@@ -11,12 +11,15 @@ abstractcore/architectures/enums.py,sha256=9vIv2vDBEKhxwzwH9iaSAyf-iVj3p8y9loMeN
|
|
|
11
11
|
abstractcore/assets/architecture_formats.json,sha256=CIf6SaR_IJs1D7Uvd1K3zWngIXJ_yq3DM_IE3wnpCHY,16076
|
|
12
12
|
abstractcore/assets/model_capabilities.json,sha256=iUkDiljyZUZzPlpYCOFgStXyc6e7dvOfReYQ0HFrX9Q,49703
|
|
13
13
|
abstractcore/assets/session_schema.json,sha256=b6HTAWxRVlVhAzA7FqaKpunK1yO6jilBOsD5sQkqJTo,10580
|
|
14
|
+
abstractcore/cli/__init__.py,sha256=rUjLjZSK3wENSw4g_iN43Bc2i5cggcEmj4NPXBMohdc,241
|
|
15
|
+
abstractcore/cli/main.py,sha256=QD38nnfrInavO452WbkXCI37SVsdIu9VhvjEOojXBGY,31834
|
|
16
|
+
abstractcore/cli/vision_config.py,sha256=jJzO4zBexh8SqSKp6YKOXdMDSv4AL4Ztl5Xi-5c4KyY,17869
|
|
14
17
|
abstractcore/core/__init__.py,sha256=2h-86U4QkCQ4gzZ4iRusSTMlkODiUS6tKjZHiEXz6rM,684
|
|
15
18
|
abstractcore/core/enums.py,sha256=BhkVnHC-X1_377JDmqd-2mnem9GdBLqixWlYzlP_FJU,695
|
|
16
19
|
abstractcore/core/factory.py,sha256=UdrNwQAvifvFS3LMjF5KO87m-2n1bJBryTs9pvesYcI,2804
|
|
17
|
-
abstractcore/core/interface.py,sha256
|
|
20
|
+
abstractcore/core/interface.py,sha256=-VAY0nlsTnWN_WghiuMC7iE7xUdZfYOg6KlgrAPi14Y,14086
|
|
18
21
|
abstractcore/core/retry.py,sha256=wNlUAxfmvdO_uVWb4iqkhTqd7O1oRwXxqvVQaLXQOw0,14538
|
|
19
|
-
abstractcore/core/session.py,sha256=
|
|
22
|
+
abstractcore/core/session.py,sha256=cYmQv9m69ivpZXfR-a2xasbBRiP4IZt-9QDuuT6eHKw,36462
|
|
20
23
|
abstractcore/core/types.py,sha256=KT9Gf9ei4t0QnWBH72fFa8vR7UZSKI-CJyQjU9ynE8g,3642
|
|
21
24
|
abstractcore/embeddings/__init__.py,sha256=hR3xZyqcRm4c2pq1dIa5lxj_-Bk70Zad802JQN4joWo,637
|
|
22
25
|
abstractcore/embeddings/manager.py,sha256=uFVbRPHx_R-kVMVA7N7_7EzeUmCJCeN9Dv0EV8Jko24,52245
|
|
@@ -29,19 +32,30 @@ abstractcore/media/base.py,sha256=vWdxscqTGTvd3oc4IzzsBTWhUrznWcqM7M_sFyq6-eE,15
|
|
|
29
32
|
abstractcore/media/capabilities.py,sha256=qqKvXGkUT-FNnbFS-EYx8KCT9SZOovO2h4N7ucrHgBA,12844
|
|
30
33
|
abstractcore/media/types.py,sha256=jG-g_2_gzl8eOgEalk9x3Ikhni9GoGfoRjkZWaBhV30,10165
|
|
31
34
|
abstractcore/media/vision_fallback.py,sha256=XcEV5T9ekqd4DRBrhJvxgX5j_puxSlofvuUIfQc2vmg,10629
|
|
35
|
+
abstractcore/media/handlers/__init__.py,sha256=HBqFo15JX1q7RM11076iFQUfPvInLlOizX-LGSznLuI,404
|
|
36
|
+
abstractcore/media/handlers/anthropic_handler.py,sha256=iwcHKnHgHoQGpJKlJmwFJWBvrYg9lAzAnndybwsWZRA,12427
|
|
37
|
+
abstractcore/media/handlers/local_handler.py,sha256=xfMV2Ztre3eUkDno4aSGob96oWUlgicZ3VChs-txjXU,23033
|
|
38
|
+
abstractcore/media/handlers/openai_handler.py,sha256=o0H_WQ_NQt133my55xYQmq6_QFGafghF8sPTrqr1f0Q,9726
|
|
39
|
+
abstractcore/media/processors/__init__.py,sha256=tExCZwVhD9Qzn3D99-zQcU-T1324YtiLkWjIfWLC708,442
|
|
40
|
+
abstractcore/media/processors/image_processor.py,sha256=wj-f1W71ZCs4AZdmyTKZvnMee83GkiXKuZ6QvJwd3Lo,22577
|
|
41
|
+
abstractcore/media/processors/office_processor.py,sha256=MqhLDWNtjHEpiMgpFaf7tbj8iDcTCf_zelWrHZkr7Z4,18580
|
|
42
|
+
abstractcore/media/processors/pdf_processor.py,sha256=qniYt7cTYYPVRi_cS1IsXztOldeY0bqdn7sdbELBU9k,17157
|
|
43
|
+
abstractcore/media/processors/text_processor.py,sha256=E28FtT2_jzsvMIDwZi6aVWuu_pSyAPSBa96fe4YYcU8,21092
|
|
44
|
+
abstractcore/media/utils/__init__.py,sha256=30-CTif91iRKOXJ4njGiduWAt-xp31U7NafMBNvgdO0,460
|
|
45
|
+
abstractcore/media/utils/image_scaler.py,sha256=QrYqoNQc8tzGu7I9Sf_E-Iv7ei2oLh714AGiX3yACNM,11338
|
|
32
46
|
abstractcore/processing/__init__.py,sha256=t6hiakQjcZROT4pw9ZFt2q6fF3vf5VpdMKG2EWlsFd8,540
|
|
33
47
|
abstractcore/processing/basic_extractor.py,sha256=3x-3BdIHgLvqLnLF6K1-P4qVaLIpAnNIIutaJi7lDQM,49832
|
|
34
48
|
abstractcore/processing/basic_judge.py,sha256=tKWJrg_tY4vCHzWgXxz0ZjgLXBYYfpMcpG7vl03hJcM,32218
|
|
35
49
|
abstractcore/processing/basic_summarizer.py,sha256=XHNxMQ_8aLStTeUo6_2JaThlct12Htpz7ORmm0iuJsg,25495
|
|
36
50
|
abstractcore/providers/__init__.py,sha256=t8Kp4flH5GvZEC6dx-iYJSPeSxMODa2spXb8MqtlPy4,1282
|
|
37
|
-
abstractcore/providers/anthropic_provider.py,sha256=
|
|
38
|
-
abstractcore/providers/base.py,sha256=
|
|
39
|
-
abstractcore/providers/huggingface_provider.py,sha256=
|
|
40
|
-
abstractcore/providers/lmstudio_provider.py,sha256=
|
|
41
|
-
abstractcore/providers/mlx_provider.py,sha256=
|
|
51
|
+
abstractcore/providers/anthropic_provider.py,sha256=4DsHpfJ5iVnIB6gOL4iZGRjoR0R5kJhKdO5jG06iUmo,21287
|
|
52
|
+
abstractcore/providers/base.py,sha256=YfrqM3c7wLT19vspL7goUO6Bv-z1691ZkCM2wxvQX4s,51501
|
|
53
|
+
abstractcore/providers/huggingface_provider.py,sha256=v12JzpZ0Ra6OGD2aWcNdBMLxWytrW3gsSnzrr7F-rnA,48500
|
|
54
|
+
abstractcore/providers/lmstudio_provider.py,sha256=NbhJMd3RjZ9nSIfy9lVmGAnxH8eGPz5ogRsN8YQfsl0,20629
|
|
55
|
+
abstractcore/providers/mlx_provider.py,sha256=vbuv6lEfAURb6Dvcx7tpjV5woi5oZuZGsqwPBqiZ2EQ,18157
|
|
42
56
|
abstractcore/providers/mock_provider.py,sha256=tIjA57Hlwu3vNODOZShNn0tY9HWvz1p4z-HyD_bsvbo,5741
|
|
43
|
-
abstractcore/providers/ollama_provider.py,sha256=
|
|
44
|
-
abstractcore/providers/openai_provider.py,sha256=
|
|
57
|
+
abstractcore/providers/ollama_provider.py,sha256=7p4BcCZ0UJabjw_lHzBqjQvtoEJYOj_NI511QjjWaSc,21361
|
|
58
|
+
abstractcore/providers/openai_provider.py,sha256=3cm0TG2gbuoBDkoQmsliH9SBZCwL7hnKuzzDmwU3K4E,22853
|
|
45
59
|
abstractcore/providers/registry.py,sha256=c0hxp9RRa-uipGotaAu48fHXc_HGlLcOxC1k763mzhU,16596
|
|
46
60
|
abstractcore/providers/streaming.py,sha256=VnffBV_CU9SAKzghL154OoFyEdDsiLwUNXPahyU41Bw,31342
|
|
47
61
|
abstractcore/server/__init__.py,sha256=1DSAz_YhQtnKv7sNi5TMQV8GFujctDOabgvAdilQE0o,249
|
|
@@ -50,7 +64,7 @@ abstractcore/structured/__init__.py,sha256=VXRQHGcm-iaYnLOBPin2kyhvhhQA0kaGt_pcN
|
|
|
50
64
|
abstractcore/structured/handler.py,sha256=Vb15smiR81JGDXX2RLkY2Exuj67J7a6C-xwVrZoXp0I,17134
|
|
51
65
|
abstractcore/structured/retry.py,sha256=BN_PvrWybyU1clMy2cult1-TVxFSMaVqiCPmmXvA5aI,3805
|
|
52
66
|
abstractcore/tools/__init__.py,sha256=oh6vG0RdM1lqUtOp95mLrTsWLh9VmhJf5_FVjGIP5_M,2259
|
|
53
|
-
abstractcore/tools/common_tools.py,sha256=
|
|
67
|
+
abstractcore/tools/common_tools.py,sha256=GkUSnBum3zMm9M-Zd9LlJQmlDp1XDssC7z8ItUcbloc,91692
|
|
54
68
|
abstractcore/tools/core.py,sha256=lUUGihyceiRYlKUFvEMig9jWFF563d574mSDbYYD3fM,4777
|
|
55
69
|
abstractcore/tools/handler.py,sha256=GmDenXAJkhceWSGlhvuF90aMb2301tRTh6WxGwBQifc,12022
|
|
56
70
|
abstractcore/tools/parser.py,sha256=1r5nmEEp1Rid3JU6ct-s3lP-eCln67fvXG5HCjqiRew,27740
|
|
@@ -63,10 +77,10 @@ abstractcore/utils/message_preprocessor.py,sha256=GdHkm6tmrgjm3PwHRSCjIsq1XLkbhy
|
|
|
63
77
|
abstractcore/utils/self_fixes.py,sha256=QEDwNTW80iQM4ftfEY3Ghz69F018oKwLM9yeRCYZOvw,5886
|
|
64
78
|
abstractcore/utils/structured_logging.py,sha256=Vm-HviSa42G9DJCWmaEv4a0QG3NMsADD3ictLOs4En0,19952
|
|
65
79
|
abstractcore/utils/token_utils.py,sha256=eLwFmJ68p9WMFD_MHLMmeJRW6Oqx_4hKELB8FNQ2Mnk,21097
|
|
66
|
-
abstractcore/utils/version.py,sha256=
|
|
67
|
-
abstractcore-2.4.
|
|
68
|
-
abstractcore-2.4.
|
|
69
|
-
abstractcore-2.4.
|
|
70
|
-
abstractcore-2.4.
|
|
71
|
-
abstractcore-2.4.
|
|
72
|
-
abstractcore-2.4.
|
|
80
|
+
abstractcore/utils/version.py,sha256=r8Rzbfb6YwcUi9ek9BN0m6rVNtA2oImg_hOzRFnS2CE,605
|
|
81
|
+
abstractcore-2.4.6.dist-info/licenses/LICENSE,sha256=PI2v_4HMvd6050uDD_4AY_8PzBnu2asa3RKbdDjowTA,1078
|
|
82
|
+
abstractcore-2.4.6.dist-info/METADATA,sha256=agFFlRyASBw8uDKCAmchMdvggXjPydMHTfARd4GQqcU,29749
|
|
83
|
+
abstractcore-2.4.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
84
|
+
abstractcore-2.4.6.dist-info/entry_points.txt,sha256=UdVmchBC_Lt3H4Vlkt5js-QDAkVlBbkCu1yCsswk-KE,454
|
|
85
|
+
abstractcore-2.4.6.dist-info/top_level.txt,sha256=DiNHBI35SIawW3N9Z-z0y6cQYNbXd32pvBkW0RLfScs,13
|
|
86
|
+
abstractcore-2.4.6.dist-info/RECORD,,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[console_scripts]
|
|
2
2
|
abstractcore = abstractcore.cli.main:main
|
|
3
|
+
abstractcore-chat = abstractcore.utils.cli:main
|
|
4
|
+
abstractcore-config = abstractcore.cli.main:main
|
|
3
5
|
abstractcore-extractor = abstractcore.apps.extractor:main
|
|
4
6
|
abstractcore-judge = abstractcore.apps.judge:main
|
|
5
7
|
abstractcore-summarizer = abstractcore.apps.summarizer:main
|
|
File without changes
|
|
File without changes
|
|
File without changes
|