claix-ai 1.0.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.
- claix_ai-1.0.0/.gitignore +13 -0
- claix_ai-1.0.0/LICENSE +21 -0
- claix_ai-1.0.0/PKG-INFO +217 -0
- claix_ai-1.0.0/README.md +160 -0
- claix_ai-1.0.0/claix/__init__.py +70 -0
- claix_ai-1.0.0/claix/client.py +332 -0
- claix_ai-1.0.0/claix/exceptions.py +54 -0
- claix_ai-1.0.0/claix/integrations/__init__.py +52 -0
- claix_ai-1.0.0/claix/integrations/crewai.py +101 -0
- claix_ai-1.0.0/claix/integrations/langchain.py +144 -0
- claix_ai-1.0.0/claix/integrations/llamaindex.py +64 -0
- claix_ai-1.0.0/claix/models.py +232 -0
- claix_ai-1.0.0/claix/resources/__init__.py +51 -0
- claix_ai-1.0.0/claix/resources/context.py +80 -0
- claix_ai-1.0.0/claix/resources/extraction.py +327 -0
- claix_ai-1.0.0/claix/resources/schemas.py +118 -0
- claix_ai-1.0.0/claix/resources/spaces.py +82 -0
- claix_ai-1.0.0/pyproject.toml +69 -0
claix_ai-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Claix / ANAYA CARBALLO GAEL
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
claix_ai-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: claix-ai
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Official Python SDK for the Claix document intelligence API (OpenAPI 1.8.2). Typed extraction, document memory, knowledge spaces, and agent-framework tools.
|
|
5
|
+
Project-URL: Homepage, https://www.claix.dev
|
|
6
|
+
Project-URL: Documentation, https://www.claix.dev/documentation
|
|
7
|
+
Project-URL: OpenAPI, https://www.claix.dev/openapi.yaml
|
|
8
|
+
Project-URL: Source, https://github.com/Gaelproodoos/claix-interfaz
|
|
9
|
+
Author-email: Claix <info@claix.dev>
|
|
10
|
+
License: MIT License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2026 Claix / ANAYA CARBALLO GAEL
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
SOFTWARE.
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Keywords: a2a,ai-agents,claix,crewai,document-intelligence,excel-to-json,langchain,langgraph,llamaindex,pdf-to-json
|
|
33
|
+
Classifier: Development Status :: 4 - Beta
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
42
|
+
Classifier: Typing :: Typed
|
|
43
|
+
Requires-Python: >=3.10
|
|
44
|
+
Requires-Dist: httpx>=0.27.0
|
|
45
|
+
Requires-Dist: pydantic>=2.6.0
|
|
46
|
+
Provides-Extra: all
|
|
47
|
+
Requires-Dist: crewai>=0.1.0; extra == 'all'
|
|
48
|
+
Requires-Dist: langchain-core>=0.3.0; extra == 'all'
|
|
49
|
+
Requires-Dist: llama-index-core>=0.10.0; extra == 'all'
|
|
50
|
+
Provides-Extra: crewai
|
|
51
|
+
Requires-Dist: crewai>=0.1.0; extra == 'crewai'
|
|
52
|
+
Provides-Extra: langchain
|
|
53
|
+
Requires-Dist: langchain-core>=0.3.0; extra == 'langchain'
|
|
54
|
+
Provides-Extra: llamaindex
|
|
55
|
+
Requires-Dist: llama-index-core>=0.10.0; extra == 'llamaindex'
|
|
56
|
+
Description-Content-Type: text/markdown
|
|
57
|
+
|
|
58
|
+
# Claix Python SDK
|
|
59
|
+
|
|
60
|
+
[](https://pypi.org/project/claix-ai/)
|
|
61
|
+
[](https://pypi.org/project/claix-ai/)
|
|
62
|
+
[](LICENSE)
|
|
63
|
+
|
|
64
|
+
Official typed Python client for the [Claix](https://www.claix.dev) document intelligence API (**OpenAPI 1.8.2**).
|
|
65
|
+
|
|
66
|
+
Extract PDFs, Excel, Word, images, and text into schema-validated JSON. Query persisted documents and knowledge spaces. Drop the same client into **LangChain / LangGraph**, **CrewAI**, and **LlamaIndex**.
|
|
67
|
+
|
|
68
|
+
- Docs: https://www.claix.dev/documentation
|
|
69
|
+
- OpenAPI: https://www.claix.dev/openapi.yaml
|
|
70
|
+
- Agent Card: https://claix.dev/.well-known/agent.json
|
|
71
|
+
|
|
72
|
+
## Install
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install claix-ai
|
|
76
|
+
pip install 'claix-ai[langchain]'
|
|
77
|
+
pip install 'claix-ai[crewai]'
|
|
78
|
+
pip install 'claix-ai[llamaindex]'
|
|
79
|
+
pip install 'claix-ai[all]'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Requires **Python ≥ 3.10**. Set `CLAIX_API_KEY` or pass `api_key=` to the client.
|
|
83
|
+
|
|
84
|
+
## Quickstart
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from claix import ClaixClient
|
|
88
|
+
|
|
89
|
+
client = ClaixClient() # reads CLAIX_API_KEY
|
|
90
|
+
result = client.extract.pdf("invoice.pdf", schema_id="3c7a9f21-4b8e-4d1a-9c6f-2e0d8a5b7c4f")
|
|
91
|
+
print(result.data)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Async:
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from claix import AsyncClaixClient
|
|
98
|
+
|
|
99
|
+
async with AsyncClaixClient() as client:
|
|
100
|
+
doc = await client.extract.pdf("invoice.pdf", schema_id="...")
|
|
101
|
+
answers = await client.context.ask(doc.document_id, ["What is the total?"])
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Extraction, context, and spaces
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
from claix import ClaixClient
|
|
108
|
+
|
|
109
|
+
client = ClaixClient(api_key="ck_...")
|
|
110
|
+
|
|
111
|
+
# Standard extraction → POST https://claix.dev/api/pdf-json
|
|
112
|
+
extracted = client.extract.pdf("scan.pdf", schema_id="...", space_id=None, is_agent_mode=False)
|
|
113
|
+
|
|
114
|
+
# Agent Mode → POST https://claix.dev/agent/pdf-json
|
|
115
|
+
agented = client.extract.pdf("contract.pdf", schema_id="...", is_agent_mode=True)
|
|
116
|
+
print(agented.agent_data)
|
|
117
|
+
|
|
118
|
+
space = client.spaces.create("Vendors 2026")
|
|
119
|
+
client.extract.excel("ledger.xlsx", schema_id="...", space_id=space.space.space_id)
|
|
120
|
+
|
|
121
|
+
# Cross-document Q&A — ia_response is list[str | None] (native null when missing)
|
|
122
|
+
qa = client.spaces.ask(space.space.space_id, ["Which vendor billed the most?"])
|
|
123
|
+
print(qa.user_ask, qa.ia_response)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## LangGraph (ReAct)
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from claix import ClaixClient
|
|
130
|
+
from claix.integrations.langchain import (
|
|
131
|
+
ClaixDocumentContextTool,
|
|
132
|
+
ClaixExtractTool,
|
|
133
|
+
ClaixSpaceContextTool,
|
|
134
|
+
)
|
|
135
|
+
from langgraph.prebuilt import create_react_agent
|
|
136
|
+
|
|
137
|
+
client = ClaixClient()
|
|
138
|
+
tools = [
|
|
139
|
+
ClaixExtractTool(client=client),
|
|
140
|
+
ClaixDocumentContextTool(client=client),
|
|
141
|
+
ClaixSpaceContextTool(client=client),
|
|
142
|
+
]
|
|
143
|
+
agent = create_react_agent("openai:gpt-4.1", tools)
|
|
144
|
+
agent.invoke({
|
|
145
|
+
"messages": [{
|
|
146
|
+
"role": "user",
|
|
147
|
+
"content": "Extract invoice.pdf with schema 3c7a9f21-4b8e-4d1a-9c6f-2e0d8a5b7c4f, "
|
|
148
|
+
"then ask the document_id for the VAT total.",
|
|
149
|
+
}]
|
|
150
|
+
})
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`create_react_agent` builds a StateGraph that loops until the model stops calling tools. `ClaixSpaceContextTool` is the right primitive for multi-file nodes (compare, sum, reconcile under a `space_id`).
|
|
154
|
+
|
|
155
|
+
## CrewAI
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
from crewai import Agent, Crew, Task
|
|
159
|
+
from claix import ClaixClient
|
|
160
|
+
from claix.integrations.crewai import ClaixDocumentTool, ClaixKnowledgeSpaceTool
|
|
161
|
+
|
|
162
|
+
client = ClaixClient()
|
|
163
|
+
analyst = Agent(
|
|
164
|
+
role="Document auditor",
|
|
165
|
+
goal="Extract contracts and reconcile them against invoices",
|
|
166
|
+
backstory="You never guess missing fields; you trust Claix nulls.",
|
|
167
|
+
tools=[ClaixDocumentTool(client=client), ClaixKnowledgeSpaceTool(client=client)],
|
|
168
|
+
)
|
|
169
|
+
task = Task(
|
|
170
|
+
description="Extract contracts/ and invoices/ into space {space_id}, then list discrepancies.",
|
|
171
|
+
expected_output="A JSON list of mismatches. Use null when a field is absent.",
|
|
172
|
+
agent=analyst,
|
|
173
|
+
)
|
|
174
|
+
Crew(agents=[analyst], tasks=[task]).kickoff()
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## LlamaIndex
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
from claix import ClaixClient
|
|
181
|
+
from claix.integrations.llamaindex import ClaixToolSpec
|
|
182
|
+
|
|
183
|
+
spec = ClaixToolSpec(client=ClaixClient())
|
|
184
|
+
tools = spec.to_tool_list() # extract_document, ask_document, ask_knowledge_space
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## SDK map (OpenAPI 1.8.2)
|
|
188
|
+
|
|
189
|
+
| SDK method | HTTP |
|
|
190
|
+
| --- | --- |
|
|
191
|
+
| `client.extract.pdf(file, schema_id, space_id=None, is_agent_mode=False)` | `POST /api/pdf-json` or `POST /agent/pdf-json` |
|
|
192
|
+
| `client.extract.excel(...)` | `POST /api/excel-json` or `POST /agent/excel-json` |
|
|
193
|
+
| `client.extract.document(...)` | `POST /api/doc-json` or `POST /agent/doc-json` |
|
|
194
|
+
| `client.extract.image(...)` | `POST /api/img-json` or `POST /agent/img-json` |
|
|
195
|
+
| `client.extract.text(content, schema_id, ...)` | `POST /api/txt-json` or `POST /agent/txt-json` |
|
|
196
|
+
| `client.extract.json_to_excel(schema_id=..., data=...)` | `POST /api/json-excel` (binary `.xlsx`) |
|
|
197
|
+
| `client.context.get(document_id)` | `GET https://claix.dev/get-document/{document_id}` |
|
|
198
|
+
| `client.context.ask(document_id, questions)` | `POST https://claix.dev/document-context/{document_id}` (max 5 × 400 chars) |
|
|
199
|
+
| `client.context.delete(document_id)` | `DELETE https://claix.dev/delete-document/{document_id}` |
|
|
200
|
+
| `client.spaces.create(name)` | `POST https://claix.dev/create-space` |
|
|
201
|
+
| `client.spaces.ask(space_id, questions)` | `POST https://claix.dev/space-context/{space_id}` |
|
|
202
|
+
| `client.spaces.delete(space_id)` | `DELETE https://claix.dev/delete-space/{space_id}` |
|
|
203
|
+
| `client.schemas.list()` | `GET /api/schemas` |
|
|
204
|
+
| `client.schemas.create(name, type, schema_definition, ...)` | `POST /api/create-schema` |
|
|
205
|
+
| `client.schemas.delete(schema_id)` | `POST /api/delete-schema` |
|
|
206
|
+
|
|
207
|
+
Auth header: `x-api-key` (Bearer is also accepted by the API). Default timeout 120s, with retries on 429/502/503/504 and transport errors.
|
|
208
|
+
|
|
209
|
+
`WindowContextSuccessResponse.ia_response` and `SpaceContextSuccessResponse.ia_response` are typed as `list[str | None]` so orchestrators can branch on deterministic `null`.
|
|
210
|
+
|
|
211
|
+
## Errors
|
|
212
|
+
|
|
213
|
+
`ClaixAuthenticationError` (401), `ClaixNotFoundError` (404), `ClaixValidationError` (400/413/422), `ClaixRateLimitError` (429), `ClaixTimeoutError`, `ClaixConnectionError`, `ClaixAPIError` (5xx). All subclass `ClaixError` and expose `status_code` plus the `{error, detalle}` payload.
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
MIT
|
claix_ai-1.0.0/README.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Claix Python SDK
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/claix-ai/)
|
|
4
|
+
[](https://pypi.org/project/claix-ai/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Official typed Python client for the [Claix](https://www.claix.dev) document intelligence API (**OpenAPI 1.8.2**).
|
|
8
|
+
|
|
9
|
+
Extract PDFs, Excel, Word, images, and text into schema-validated JSON. Query persisted documents and knowledge spaces. Drop the same client into **LangChain / LangGraph**, **CrewAI**, and **LlamaIndex**.
|
|
10
|
+
|
|
11
|
+
- Docs: https://www.claix.dev/documentation
|
|
12
|
+
- OpenAPI: https://www.claix.dev/openapi.yaml
|
|
13
|
+
- Agent Card: https://claix.dev/.well-known/agent.json
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install claix-ai
|
|
19
|
+
pip install 'claix-ai[langchain]'
|
|
20
|
+
pip install 'claix-ai[crewai]'
|
|
21
|
+
pip install 'claix-ai[llamaindex]'
|
|
22
|
+
pip install 'claix-ai[all]'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Requires **Python ≥ 3.10**. Set `CLAIX_API_KEY` or pass `api_key=` to the client.
|
|
26
|
+
|
|
27
|
+
## Quickstart
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from claix import ClaixClient
|
|
31
|
+
|
|
32
|
+
client = ClaixClient() # reads CLAIX_API_KEY
|
|
33
|
+
result = client.extract.pdf("invoice.pdf", schema_id="3c7a9f21-4b8e-4d1a-9c6f-2e0d8a5b7c4f")
|
|
34
|
+
print(result.data)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Async:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from claix import AsyncClaixClient
|
|
41
|
+
|
|
42
|
+
async with AsyncClaixClient() as client:
|
|
43
|
+
doc = await client.extract.pdf("invoice.pdf", schema_id="...")
|
|
44
|
+
answers = await client.context.ask(doc.document_id, ["What is the total?"])
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Extraction, context, and spaces
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from claix import ClaixClient
|
|
51
|
+
|
|
52
|
+
client = ClaixClient(api_key="ck_...")
|
|
53
|
+
|
|
54
|
+
# Standard extraction → POST https://claix.dev/api/pdf-json
|
|
55
|
+
extracted = client.extract.pdf("scan.pdf", schema_id="...", space_id=None, is_agent_mode=False)
|
|
56
|
+
|
|
57
|
+
# Agent Mode → POST https://claix.dev/agent/pdf-json
|
|
58
|
+
agented = client.extract.pdf("contract.pdf", schema_id="...", is_agent_mode=True)
|
|
59
|
+
print(agented.agent_data)
|
|
60
|
+
|
|
61
|
+
space = client.spaces.create("Vendors 2026")
|
|
62
|
+
client.extract.excel("ledger.xlsx", schema_id="...", space_id=space.space.space_id)
|
|
63
|
+
|
|
64
|
+
# Cross-document Q&A — ia_response is list[str | None] (native null when missing)
|
|
65
|
+
qa = client.spaces.ask(space.space.space_id, ["Which vendor billed the most?"])
|
|
66
|
+
print(qa.user_ask, qa.ia_response)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## LangGraph (ReAct)
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from claix import ClaixClient
|
|
73
|
+
from claix.integrations.langchain import (
|
|
74
|
+
ClaixDocumentContextTool,
|
|
75
|
+
ClaixExtractTool,
|
|
76
|
+
ClaixSpaceContextTool,
|
|
77
|
+
)
|
|
78
|
+
from langgraph.prebuilt import create_react_agent
|
|
79
|
+
|
|
80
|
+
client = ClaixClient()
|
|
81
|
+
tools = [
|
|
82
|
+
ClaixExtractTool(client=client),
|
|
83
|
+
ClaixDocumentContextTool(client=client),
|
|
84
|
+
ClaixSpaceContextTool(client=client),
|
|
85
|
+
]
|
|
86
|
+
agent = create_react_agent("openai:gpt-4.1", tools)
|
|
87
|
+
agent.invoke({
|
|
88
|
+
"messages": [{
|
|
89
|
+
"role": "user",
|
|
90
|
+
"content": "Extract invoice.pdf with schema 3c7a9f21-4b8e-4d1a-9c6f-2e0d8a5b7c4f, "
|
|
91
|
+
"then ask the document_id for the VAT total.",
|
|
92
|
+
}]
|
|
93
|
+
})
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`create_react_agent` builds a StateGraph that loops until the model stops calling tools. `ClaixSpaceContextTool` is the right primitive for multi-file nodes (compare, sum, reconcile under a `space_id`).
|
|
97
|
+
|
|
98
|
+
## CrewAI
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from crewai import Agent, Crew, Task
|
|
102
|
+
from claix import ClaixClient
|
|
103
|
+
from claix.integrations.crewai import ClaixDocumentTool, ClaixKnowledgeSpaceTool
|
|
104
|
+
|
|
105
|
+
client = ClaixClient()
|
|
106
|
+
analyst = Agent(
|
|
107
|
+
role="Document auditor",
|
|
108
|
+
goal="Extract contracts and reconcile them against invoices",
|
|
109
|
+
backstory="You never guess missing fields; you trust Claix nulls.",
|
|
110
|
+
tools=[ClaixDocumentTool(client=client), ClaixKnowledgeSpaceTool(client=client)],
|
|
111
|
+
)
|
|
112
|
+
task = Task(
|
|
113
|
+
description="Extract contracts/ and invoices/ into space {space_id}, then list discrepancies.",
|
|
114
|
+
expected_output="A JSON list of mismatches. Use null when a field is absent.",
|
|
115
|
+
agent=analyst,
|
|
116
|
+
)
|
|
117
|
+
Crew(agents=[analyst], tasks=[task]).kickoff()
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## LlamaIndex
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
from claix import ClaixClient
|
|
124
|
+
from claix.integrations.llamaindex import ClaixToolSpec
|
|
125
|
+
|
|
126
|
+
spec = ClaixToolSpec(client=ClaixClient())
|
|
127
|
+
tools = spec.to_tool_list() # extract_document, ask_document, ask_knowledge_space
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## SDK map (OpenAPI 1.8.2)
|
|
131
|
+
|
|
132
|
+
| SDK method | HTTP |
|
|
133
|
+
| --- | --- |
|
|
134
|
+
| `client.extract.pdf(file, schema_id, space_id=None, is_agent_mode=False)` | `POST /api/pdf-json` or `POST /agent/pdf-json` |
|
|
135
|
+
| `client.extract.excel(...)` | `POST /api/excel-json` or `POST /agent/excel-json` |
|
|
136
|
+
| `client.extract.document(...)` | `POST /api/doc-json` or `POST /agent/doc-json` |
|
|
137
|
+
| `client.extract.image(...)` | `POST /api/img-json` or `POST /agent/img-json` |
|
|
138
|
+
| `client.extract.text(content, schema_id, ...)` | `POST /api/txt-json` or `POST /agent/txt-json` |
|
|
139
|
+
| `client.extract.json_to_excel(schema_id=..., data=...)` | `POST /api/json-excel` (binary `.xlsx`) |
|
|
140
|
+
| `client.context.get(document_id)` | `GET https://claix.dev/get-document/{document_id}` |
|
|
141
|
+
| `client.context.ask(document_id, questions)` | `POST https://claix.dev/document-context/{document_id}` (max 5 × 400 chars) |
|
|
142
|
+
| `client.context.delete(document_id)` | `DELETE https://claix.dev/delete-document/{document_id}` |
|
|
143
|
+
| `client.spaces.create(name)` | `POST https://claix.dev/create-space` |
|
|
144
|
+
| `client.spaces.ask(space_id, questions)` | `POST https://claix.dev/space-context/{space_id}` |
|
|
145
|
+
| `client.spaces.delete(space_id)` | `DELETE https://claix.dev/delete-space/{space_id}` |
|
|
146
|
+
| `client.schemas.list()` | `GET /api/schemas` |
|
|
147
|
+
| `client.schemas.create(name, type, schema_definition, ...)` | `POST /api/create-schema` |
|
|
148
|
+
| `client.schemas.delete(schema_id)` | `POST /api/delete-schema` |
|
|
149
|
+
|
|
150
|
+
Auth header: `x-api-key` (Bearer is also accepted by the API). Default timeout 120s, with retries on 429/502/503/504 and transport errors.
|
|
151
|
+
|
|
152
|
+
`WindowContextSuccessResponse.ia_response` and `SpaceContextSuccessResponse.ia_response` are typed as `list[str | None]` so orchestrators can branch on deterministic `null`.
|
|
153
|
+
|
|
154
|
+
## Errors
|
|
155
|
+
|
|
156
|
+
`ClaixAuthenticationError` (401), `ClaixNotFoundError` (404), `ClaixValidationError` (400/413/422), `ClaixRateLimitError` (429), `ClaixTimeoutError`, `ClaixConnectionError`, `ClaixAPIError` (5xx). All subclass `ClaixError` and expose `status_code` plus the `{error, detalle}` payload.
|
|
157
|
+
|
|
158
|
+
## License
|
|
159
|
+
|
|
160
|
+
MIT
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Official Claix Python SDK (OpenAPI 1.8.2)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from claix.client import AsyncClaixClient, ClaixClient
|
|
6
|
+
from claix.exceptions import (
|
|
7
|
+
ClaixAPIError,
|
|
8
|
+
ClaixAuthenticationError,
|
|
9
|
+
ClaixConnectionError,
|
|
10
|
+
ClaixError,
|
|
11
|
+
ClaixNotFoundError,
|
|
12
|
+
ClaixRateLimitError,
|
|
13
|
+
ClaixTimeoutError,
|
|
14
|
+
ClaixValidationError,
|
|
15
|
+
)
|
|
16
|
+
from claix.models import (
|
|
17
|
+
AgentDocJsonSuccessResponse,
|
|
18
|
+
AgentExcelJsonSuccessResponse,
|
|
19
|
+
AgentImgJsonSuccessResponse,
|
|
20
|
+
AgentPdfJsonSuccessResponse,
|
|
21
|
+
CreateSchemaResponse,
|
|
22
|
+
CreateSpaceSuccessResponse,
|
|
23
|
+
DeleteDocumentSuccessResponse,
|
|
24
|
+
DeleteSchemaResponse,
|
|
25
|
+
DeleteSpaceSuccessResponse,
|
|
26
|
+
DocJsonSuccessResponse,
|
|
27
|
+
ErrorResponse,
|
|
28
|
+
ExcelJsonSuccessResponse,
|
|
29
|
+
GetDocumentSuccessResponse,
|
|
30
|
+
ImgJsonSuccessResponse,
|
|
31
|
+
PdfJsonSuccessResponse,
|
|
32
|
+
SchemaItem,
|
|
33
|
+
SchemasListResponse,
|
|
34
|
+
SpaceContextSuccessResponse,
|
|
35
|
+
WindowContextSuccessResponse,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
__all__ = [
|
|
39
|
+
"AsyncClaixClient",
|
|
40
|
+
"ClaixAPIError",
|
|
41
|
+
"ClaixAuthenticationError",
|
|
42
|
+
"ClaixClient",
|
|
43
|
+
"ClaixConnectionError",
|
|
44
|
+
"ClaixError",
|
|
45
|
+
"ClaixNotFoundError",
|
|
46
|
+
"ClaixRateLimitError",
|
|
47
|
+
"ClaixTimeoutError",
|
|
48
|
+
"ClaixValidationError",
|
|
49
|
+
"AgentDocJsonSuccessResponse",
|
|
50
|
+
"AgentExcelJsonSuccessResponse",
|
|
51
|
+
"AgentImgJsonSuccessResponse",
|
|
52
|
+
"AgentPdfJsonSuccessResponse",
|
|
53
|
+
"CreateSchemaResponse",
|
|
54
|
+
"CreateSpaceSuccessResponse",
|
|
55
|
+
"DeleteDocumentSuccessResponse",
|
|
56
|
+
"DeleteSchemaResponse",
|
|
57
|
+
"DeleteSpaceSuccessResponse",
|
|
58
|
+
"DocJsonSuccessResponse",
|
|
59
|
+
"ErrorResponse",
|
|
60
|
+
"ExcelJsonSuccessResponse",
|
|
61
|
+
"GetDocumentSuccessResponse",
|
|
62
|
+
"ImgJsonSuccessResponse",
|
|
63
|
+
"PdfJsonSuccessResponse",
|
|
64
|
+
"SchemaItem",
|
|
65
|
+
"SchemasListResponse",
|
|
66
|
+
"SpaceContextSuccessResponse",
|
|
67
|
+
"WindowContextSuccessResponse",
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
__version__ = "1.0.0"
|