duragraph-python 0.1.0__tar.gz → 0.2.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.
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/.github/workflows/ci.yml +1 -1
- duragraph_python-0.2.0/.github/workflows/issue-automation.yml +232 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/.gitignore +8 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/PKG-INFO +36 -62
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/README.md +24 -56
- duragraph_python-0.2.0/docs/client-api.md +499 -0
- duragraph_python-0.2.0/docs/edge-operators.md +238 -0
- duragraph_python-0.2.0/docs/index.md +704 -0
- duragraph_python-0.2.0/docs/llm-providers.md +212 -0
- duragraph_python-0.2.0/docs/quick-reference.md +268 -0
- duragraph_python-0.2.0/examples/async_execution.py +108 -0
- duragraph_python-0.2.0/examples/chatbot_anthropic.py +90 -0
- duragraph_python-0.2.0/examples/chatbot_simple.py +79 -0
- duragraph_python-0.2.0/examples/document_processing.py +454 -0
- duragraph_python-0.2.0/examples/edge_operator.py +182 -0
- duragraph_python-0.2.0/examples/embedding_usage.py +105 -0
- duragraph_python-0.2.0/examples/rag_agent.py +454 -0
- duragraph_python-0.2.0/examples/tool_usage.py +223 -0
- duragraph_python-0.2.0/examples/vectorstore_usage.py +214 -0
- duragraph_python-0.2.0/examples/worker_lifecycle.py +274 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/pyproject.toml +20 -9
- duragraph_python-0.2.0/src/duragraph/__init__.py +134 -0
- duragraph_python-0.2.0/src/duragraph/cli/main.py +1140 -0
- duragraph_python-0.2.0/src/duragraph/client.py +748 -0
- duragraph_python-0.2.0/src/duragraph/document_loaders/__init__.py +102 -0
- duragraph_python-0.2.0/src/duragraph/document_loaders/base.py +66 -0
- duragraph_python-0.2.0/src/duragraph/document_loaders/file.py +334 -0
- duragraph_python-0.2.0/src/duragraph/document_loaders/text_splitter.py +407 -0
- duragraph_python-0.2.0/src/duragraph/document_loaders/web.py +394 -0
- duragraph_python-0.2.0/src/duragraph/dspy/__init__.py +23 -0
- duragraph_python-0.2.0/src/duragraph/dspy/bridge.py +97 -0
- duragraph_python-0.2.0/src/duragraph/dspy/module.py +168 -0
- duragraph_python-0.2.0/src/duragraph/embeddings/__init__.py +55 -0
- duragraph_python-0.2.0/src/duragraph/embeddings/anthropic.py +146 -0
- duragraph_python-0.2.0/src/duragraph/embeddings/base.py +157 -0
- duragraph_python-0.2.0/src/duragraph/embeddings/cohere.py +150 -0
- duragraph_python-0.2.0/src/duragraph/embeddings/ollama.py +146 -0
- duragraph_python-0.2.0/src/duragraph/embeddings/openai.py +156 -0
- duragraph_python-0.2.0/src/duragraph/embeddings/registry.py +87 -0
- duragraph_python-0.2.0/src/duragraph/executor.py +233 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/src/duragraph/graph.py +234 -32
- duragraph_python-0.2.0/src/duragraph/llm/__init__.py +13 -0
- duragraph_python-0.2.0/src/duragraph/llm/anthropic.py +267 -0
- duragraph_python-0.2.0/src/duragraph/llm/base.py +113 -0
- duragraph_python-0.2.0/src/duragraph/llm/openai.py +238 -0
- duragraph_python-0.2.0/src/duragraph/llm/registry.py +134 -0
- duragraph_python-0.2.0/src/duragraph/nodes.py +416 -0
- duragraph_python-0.2.0/src/duragraph/prompts/__init__.py +7 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/src/duragraph/prompts/store.py +57 -1
- duragraph_python-0.2.0/src/duragraph/prompts/template.py +125 -0
- duragraph_python-0.2.0/src/duragraph/subgraph.py +126 -0
- duragraph_python-0.2.0/src/duragraph/tools.py +262 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/src/duragraph/types.py +5 -0
- duragraph_python-0.2.0/src/duragraph/vectorstores/__init__.py +60 -0
- duragraph_python-0.2.0/src/duragraph/vectorstores/base.py +261 -0
- duragraph_python-0.2.0/src/duragraph/vectorstores/chroma.py +274 -0
- duragraph_python-0.2.0/src/duragraph/vectorstores/memory.py +242 -0
- duragraph_python-0.2.0/src/duragraph/vectorstores/pgvector.py +398 -0
- duragraph_python-0.2.0/src/duragraph/vectorstores/pinecone.py +278 -0
- duragraph_python-0.2.0/src/duragraph/vectorstores/qdrant.py +341 -0
- duragraph_python-0.2.0/src/duragraph/vectorstores/registry.py +81 -0
- duragraph_python-0.2.0/src/duragraph/vectorstores/weaviate.py +324 -0
- duragraph_python-0.2.0/src/duragraph/worker/__init__.py +5 -0
- duragraph_python-0.2.0/src/duragraph/worker/worker.py +628 -0
- duragraph_python-0.2.0/tests/test_async.py +137 -0
- duragraph_python-0.2.0/tests/test_cli.py +356 -0
- duragraph_python-0.2.0/tests/test_client.py +124 -0
- duragraph_python-0.2.0/tests/test_document_loaders.py +435 -0
- duragraph_python-0.2.0/tests/test_dspy_integration.py +414 -0
- duragraph_python-0.2.0/tests/test_edges.py +205 -0
- duragraph_python-0.2.0/tests/test_embeddings.py +282 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/tests/test_graph.py +1 -2
- duragraph_python-0.2.0/tests/test_llm.py +130 -0
- duragraph_python-0.2.0/tests/test_prompts.py +124 -0
- duragraph_python-0.2.0/tests/test_streaming.py +171 -0
- duragraph_python-0.2.0/tests/test_subgraph.py +121 -0
- duragraph_python-0.2.0/tests/test_tools.py +252 -0
- duragraph_python-0.2.0/tests/test_vectorstores.py +314 -0
- duragraph_python-0.2.0/tests/test_worker.py +291 -0
- duragraph_python-0.2.0/tests/test_worker_execution.py +458 -0
- duragraph_python-0.2.0/uv.lock +3222 -0
- duragraph_python-0.1.0/src/duragraph/__init__.py +0 -35
- duragraph_python-0.1.0/src/duragraph/cli/main.py +0 -163
- duragraph_python-0.1.0/src/duragraph/nodes.py +0 -252
- duragraph_python-0.1.0/src/duragraph/prompts/__init__.py +0 -6
- duragraph_python-0.1.0/src/duragraph/worker/__init__.py +0 -5
- duragraph_python-0.1.0/src/duragraph/worker/worker.py +0 -327
- duragraph_python-0.1.0/uv.lock +0 -1601
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/.github/CODEOWNERS +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/.github/labeler.yml +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/.github/pull_request_template.md +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/.github/workflows/labeler.yml +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/.github/workflows/publish.yml +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/CHANGELOG.md +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/CONTRIBUTING.md +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/LICENSE +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/lefthook.yml +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/src/duragraph/cli/__init__.py +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/src/duragraph/edges.py +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/src/duragraph/prompts/decorators.py +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/src/duragraph/py.typed +0 -0
- {duragraph_python-0.1.0 → duragraph_python-0.2.0}/tests/__init__.py +0 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
name: Auto-update Issue Status
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, reopened, synchronize]
|
|
6
|
+
branches: [main, develop]
|
|
7
|
+
pull_request_target:
|
|
8
|
+
types: [closed]
|
|
9
|
+
branches: [main, develop]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
update-issue-status:
|
|
13
|
+
name: Update Issue Status
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
issues: write
|
|
17
|
+
pull-requests: read
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Update Issue Status on PR Open/Update
|
|
25
|
+
if: github.event.action != 'closed'
|
|
26
|
+
uses: actions/github-script@v7
|
|
27
|
+
with:
|
|
28
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
29
|
+
script: |
|
|
30
|
+
const { pull_request } = context.payload;
|
|
31
|
+
|
|
32
|
+
// Extract issue numbers from PR body and title
|
|
33
|
+
const prBody = pull_request.body || '';
|
|
34
|
+
const prTitle = pull_request.title || '';
|
|
35
|
+
const text = `${prTitle} ${prBody}`;
|
|
36
|
+
|
|
37
|
+
// Look for issue references: fixes #123, closes #456, resolves #789, etc.
|
|
38
|
+
const issueRegex = /(?:fix|fixes|fixed|close|closes|closed|resolve|resolves|resolved)[\s:]*#(\d+)/gi;
|
|
39
|
+
const matches = text.matchAll(issueRegex);
|
|
40
|
+
|
|
41
|
+
const issueNumbers = [...new Set([...matches].map(match => parseInt(match[1])))];
|
|
42
|
+
|
|
43
|
+
console.log(`Found issue references: ${issueNumbers}`);
|
|
44
|
+
|
|
45
|
+
for (const issueNumber of issueNumbers) {
|
|
46
|
+
try {
|
|
47
|
+
// Get current issue labels
|
|
48
|
+
const issue = await github.rest.issues.get({
|
|
49
|
+
owner: context.repo.owner,
|
|
50
|
+
repo: context.repo.repo,
|
|
51
|
+
issue_number: issueNumber
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const currentLabels = issue.data.labels.map(label => label.name);
|
|
55
|
+
console.log(`Issue #${issueNumber} current labels: ${currentLabels}`);
|
|
56
|
+
|
|
57
|
+
// Check if issue is not already in-progress or completed
|
|
58
|
+
if (!currentLabels.includes('status:in-progress') &&
|
|
59
|
+
!currentLabels.includes('status:completed') &&
|
|
60
|
+
currentLabels.includes('status:ready')) {
|
|
61
|
+
|
|
62
|
+
// Remove status:ready and add status:in-progress
|
|
63
|
+
await github.rest.issues.removeLabel({
|
|
64
|
+
owner: context.repo.owner,
|
|
65
|
+
repo: context.repo.repo,
|
|
66
|
+
issue_number: issueNumber,
|
|
67
|
+
name: 'status:ready'
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
await github.rest.issues.addLabels({
|
|
71
|
+
owner: context.repo.owner,
|
|
72
|
+
repo: context.repo.repo,
|
|
73
|
+
issue_number: issueNumber,
|
|
74
|
+
labels: ['status:in-progress']
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
console.log(`Updated issue #${issueNumber} to in-progress`);
|
|
78
|
+
|
|
79
|
+
// Add comment to issue
|
|
80
|
+
await github.rest.issues.createComment({
|
|
81
|
+
owner: context.repo.owner,
|
|
82
|
+
repo: context.repo.repo,
|
|
83
|
+
issue_number: issueNumber,
|
|
84
|
+
body: `🔄 This issue is now in progress via PR #${pull_request.number}`
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error(`Error updating issue #${issueNumber}:`, error.message);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
- name: Update Issue Status on PR Merge
|
|
93
|
+
if: github.event.action == 'closed' && github.event.pull_request.merged == true
|
|
94
|
+
uses: actions/github-script@v7
|
|
95
|
+
with:
|
|
96
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
97
|
+
script: |
|
|
98
|
+
const { pull_request } = context.payload;
|
|
99
|
+
|
|
100
|
+
// Extract issue numbers from PR body and title
|
|
101
|
+
const prBody = pull_request.body || '';
|
|
102
|
+
const prTitle = pull_request.title || '';
|
|
103
|
+
const text = `${prTitle} ${prBody}`;
|
|
104
|
+
|
|
105
|
+
// Look for issue references
|
|
106
|
+
const issueRegex = /(?:fix|fixes|fixed|close|closes|closed|resolve|resolves|resolved)[\s:]*#(\d+)/gi;
|
|
107
|
+
const matches = text.matchAll(issueRegex);
|
|
108
|
+
|
|
109
|
+
const issueNumbers = [...new Set([...matches].map(match => parseInt(match[1])))];
|
|
110
|
+
|
|
111
|
+
console.log(`PR merged! Found issue references: ${issueNumbers}`);
|
|
112
|
+
|
|
113
|
+
for (const issueNumber of issueNumbers) {
|
|
114
|
+
try {
|
|
115
|
+
// Get current issue labels
|
|
116
|
+
const issue = await github.rest.issues.get({
|
|
117
|
+
owner: context.repo.owner,
|
|
118
|
+
repo: context.repo.repo,
|
|
119
|
+
issue_number: issueNumber
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const currentLabels = issue.data.labels.map(label => label.name);
|
|
123
|
+
console.log(`Issue #${issueNumber} current labels: ${currentLabels}`);
|
|
124
|
+
|
|
125
|
+
// Remove all status labels
|
|
126
|
+
const statusLabels = currentLabels.filter(label => label.startsWith('status:'));
|
|
127
|
+
for (const label of statusLabels) {
|
|
128
|
+
try {
|
|
129
|
+
await github.rest.issues.removeLabel({
|
|
130
|
+
owner: context.repo.owner,
|
|
131
|
+
repo: context.repo.repo,
|
|
132
|
+
issue_number: issueNumber,
|
|
133
|
+
name: label
|
|
134
|
+
});
|
|
135
|
+
} catch (error) {
|
|
136
|
+
console.log(`Label ${label} not found, skipping removal`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Add status:completed
|
|
141
|
+
await github.rest.issues.addLabels({
|
|
142
|
+
owner: context.repo.owner,
|
|
143
|
+
repo: context.repo.repo,
|
|
144
|
+
issue_number: issueNumber,
|
|
145
|
+
labels: ['status:completed']
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// Close the issue
|
|
149
|
+
await github.rest.issues.update({
|
|
150
|
+
owner: context.repo.owner,
|
|
151
|
+
repo: context.repo.repo,
|
|
152
|
+
issue_number: issueNumber,
|
|
153
|
+
state: 'closed'
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
console.log(`Closed issue #${issueNumber} with status:completed`);
|
|
157
|
+
|
|
158
|
+
// Add completion comment
|
|
159
|
+
await github.rest.issues.createComment({
|
|
160
|
+
owner: context.repo.owner,
|
|
161
|
+
repo: context.repo.repo,
|
|
162
|
+
issue_number: issueNumber,
|
|
163
|
+
body: `✅ Completed via PR #${pull_request.number}\n\nThis issue has been automatically closed and marked as \`status:completed\`.`
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
} catch (error) {
|
|
167
|
+
console.error(`Error completing issue #${issueNumber}:`, error.message);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
- name: Update Issue Status on PR Close (not merged)
|
|
172
|
+
if: github.event.action == 'closed' && github.event.pull_request.merged == false
|
|
173
|
+
uses: actions/github-script@v7
|
|
174
|
+
with:
|
|
175
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
176
|
+
script: |
|
|
177
|
+
const { pull_request } = context.payload;
|
|
178
|
+
|
|
179
|
+
// Extract issue numbers from PR body and title
|
|
180
|
+
const prBody = pull_request.body || '';
|
|
181
|
+
const prTitle = pull_request.title || '';
|
|
182
|
+
const text = `${prTitle} ${prBody}`;
|
|
183
|
+
|
|
184
|
+
// Look for issue references
|
|
185
|
+
const issueRegex = /(?:fix|fixes|fixed|close|closes|closed|resolve|resolves|resolved)[\s:]*#(\d+)/gi;
|
|
186
|
+
const matches = text.matchAll(issueRegex);
|
|
187
|
+
|
|
188
|
+
const issueNumbers = [...new Set([...matches].map(match => parseInt(match[1])))];
|
|
189
|
+
|
|
190
|
+
console.log(`PR closed without merge. Found issue references: ${issueNumbers}`);
|
|
191
|
+
|
|
192
|
+
for (const issueNumber of issueNumbers) {
|
|
193
|
+
try {
|
|
194
|
+
// Get current issue labels
|
|
195
|
+
const issue = await github.rest.issues.get({
|
|
196
|
+
owner: context.repo.owner,
|
|
197
|
+
repo: context.repo.repo,
|
|
198
|
+
issue_number: issueNumber
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const currentLabels = issue.data.labels.map(label => label.name);
|
|
202
|
+
|
|
203
|
+
// If it was in-progress, move back to ready
|
|
204
|
+
if (currentLabels.includes('status:in-progress')) {
|
|
205
|
+
await github.rest.issues.removeLabel({
|
|
206
|
+
owner: context.repo.owner,
|
|
207
|
+
repo: context.repo.repo,
|
|
208
|
+
issue_number: issueNumber,
|
|
209
|
+
name: 'status:in-progress'
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
await github.rest.issues.addLabels({
|
|
213
|
+
owner: context.repo.owner,
|
|
214
|
+
repo: context.repo.repo,
|
|
215
|
+
issue_number: issueNumber,
|
|
216
|
+
labels: ['status:ready']
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
console.log(`Moved issue #${issueNumber} back to ready`);
|
|
220
|
+
|
|
221
|
+
// Add comment
|
|
222
|
+
await github.rest.issues.createComment({
|
|
223
|
+
owner: context.repo.owner,
|
|
224
|
+
repo: context.repo.repo,
|
|
225
|
+
issue_number: issueNumber,
|
|
226
|
+
body: `🔄 PR #${pull_request.number} was closed without merging. This issue is back to \`status:ready\` and available for work.`
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
} catch (error) {
|
|
230
|
+
console.error(`Error updating issue #${issueNumber}:`, error.message);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: duragraph-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Python SDK for DuraGraph - Reliable AI Workflow Orchestration
|
|
5
|
-
Project-URL: Homepage, https://duragraph.
|
|
6
|
-
Project-URL: Documentation, https://docs.duragraph.
|
|
5
|
+
Project-URL: Homepage, https://duragraph.ai
|
|
6
|
+
Project-URL: Documentation, https://docs.duragraph.ai
|
|
7
7
|
Project-URL: Repository, https://github.com/duragraph/duragraph-python
|
|
8
8
|
Project-URL: Issues, https://github.com/duragraph/duragraph-python/issues
|
|
9
9
|
Project-URL: Changelog, https://github.com/duragraph/duragraph-python/blob/main/CHANGELOG.md
|
|
10
|
-
Author-email: DuraGraph Team <team@duragraph.
|
|
10
|
+
Author-email: DuraGraph Team <team@duragraph.ai>
|
|
11
11
|
License-Expression: Apache-2.0
|
|
12
12
|
License-File: LICENSE
|
|
13
13
|
Keywords: agents,ai,langgraph,llm,orchestration,workflows
|
|
@@ -15,18 +15,20 @@ Classifier: Development Status :: 3 - Alpha
|
|
|
15
15
|
Classifier: Intended Audience :: Developers
|
|
16
16
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
17
|
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
22
21
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
22
|
Classifier: Typing :: Typed
|
|
24
|
-
Requires-Python: >=3.
|
|
23
|
+
Requires-Python: >=3.11
|
|
25
24
|
Requires-Dist: httpx>=0.27.0
|
|
26
25
|
Requires-Dist: pydantic>=2.0.0
|
|
27
26
|
Requires-Dist: typing-extensions>=4.0.0
|
|
27
|
+
Requires-Dist: watchfiles>=0.20.0
|
|
28
28
|
Provides-Extra: all
|
|
29
29
|
Requires-Dist: anthropic>=0.30.0; extra == 'all'
|
|
30
|
+
Requires-Dist: dspy>=2.0.0; extra == 'all'
|
|
31
|
+
Requires-Dist: nats-py>=2.7.0; extra == 'all'
|
|
30
32
|
Requires-Dist: openai>=1.0.0; extra == 'all'
|
|
31
33
|
Requires-Dist: opentelemetry-api>=1.20.0; extra == 'all'
|
|
32
34
|
Requires-Dist: opentelemetry-sdk>=1.20.0; extra == 'all'
|
|
@@ -43,33 +45,38 @@ Provides-Extra: docs
|
|
|
43
45
|
Requires-Dist: mkdocs-material>=9.0.0; extra == 'docs'
|
|
44
46
|
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
|
|
45
47
|
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
|
|
48
|
+
Provides-Extra: dspy
|
|
49
|
+
Requires-Dist: dspy>=2.0.0; extra == 'dspy'
|
|
50
|
+
Provides-Extra: nats
|
|
51
|
+
Requires-Dist: nats-py>=2.7.0; extra == 'nats'
|
|
46
52
|
Provides-Extra: openai
|
|
47
53
|
Requires-Dist: openai>=1.0.0; extra == 'openai'
|
|
48
54
|
Description-Content-Type: text/markdown
|
|
49
55
|
|
|
50
56
|
# DuraGraph Python SDK
|
|
51
57
|
|
|
52
|
-
[](
|
|
58
|
+
[](https://badge.fury.io/py/duragraph)
|
|
59
|
+
[](https://pypi.org/project/duragraph/)
|
|
60
|
+
[](LICENSE)
|
|
61
|
+
[](https://github.com/Duragraph/duragraph-python/actions/workflows/ci.yml)
|
|
55
62
|
|
|
56
|
-
Python SDK for [DuraGraph](https://github.com/
|
|
63
|
+
Python SDK for [DuraGraph](https://github.com/Duragraph/duragraph) - Reliable AI Workflow Orchestration.
|
|
57
64
|
|
|
58
65
|
Build AI agents with decorators, deploy to a control plane, and get full observability out of the box.
|
|
59
66
|
|
|
60
67
|
## Installation
|
|
61
68
|
|
|
62
69
|
```bash
|
|
63
|
-
pip install duragraph
|
|
70
|
+
pip install duragraph
|
|
64
71
|
|
|
65
72
|
# With OpenAI support
|
|
66
|
-
pip install duragraph
|
|
73
|
+
pip install duragraph[openai]
|
|
67
74
|
|
|
68
75
|
# With Anthropic support
|
|
69
|
-
pip install duragraph
|
|
76
|
+
pip install duragraph[anthropic]
|
|
70
77
|
|
|
71
78
|
# All features
|
|
72
|
-
pip install duragraph
|
|
79
|
+
pip install duragraph[all]
|
|
73
80
|
```
|
|
74
81
|
|
|
75
82
|
## Quick Start
|
|
@@ -132,18 +139,6 @@ class MyAgent:
|
|
|
132
139
|
return state
|
|
133
140
|
```
|
|
134
141
|
|
|
135
|
-
### Prompt Management
|
|
136
|
-
|
|
137
|
-
```python
|
|
138
|
-
from duragraph.prompts import prompt
|
|
139
|
-
|
|
140
|
-
@llm_node(model="gpt-4o-mini")
|
|
141
|
-
@prompt("support/classify_intent", version="2.1.0")
|
|
142
|
-
def classify(self, state):
|
|
143
|
-
# Prompt is fetched from prompt store automatically
|
|
144
|
-
return state
|
|
145
|
-
```
|
|
146
|
-
|
|
147
142
|
### Streaming
|
|
148
143
|
|
|
149
144
|
```python
|
|
@@ -174,51 +169,30 @@ class MainAgent:
|
|
|
174
169
|
plan >> research
|
|
175
170
|
```
|
|
176
171
|
|
|
177
|
-
##
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
# Initialize new project
|
|
181
|
-
duragraph init my-agent
|
|
182
|
-
|
|
183
|
-
# Run locally in development mode
|
|
184
|
-
duragraph dev
|
|
185
|
-
|
|
186
|
-
# Deploy to control plane
|
|
187
|
-
duragraph deploy --control-plane http://localhost:8081
|
|
188
|
-
|
|
189
|
-
# Visualize graph
|
|
190
|
-
duragraph visualize my_agent.py
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
## Configuration
|
|
194
|
-
|
|
195
|
-
```toml
|
|
196
|
-
# pyproject.toml
|
|
197
|
-
[tool.duragraph]
|
|
198
|
-
control_plane = "http://localhost:8081"
|
|
199
|
-
|
|
200
|
-
[tool.duragraph.llm]
|
|
201
|
-
default_model = "gpt-4o-mini"
|
|
172
|
+
## Requirements
|
|
202
173
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
```
|
|
174
|
+
- Python 3.10+
|
|
175
|
+
- DuraGraph Control Plane (for deployment)
|
|
206
176
|
|
|
207
177
|
## Documentation
|
|
208
178
|
|
|
209
|
-
- [Full Documentation](https://
|
|
210
|
-
- [API Reference](https://
|
|
211
|
-
- [Examples](https://github.com/
|
|
179
|
+
- [Full Documentation](https://duragraph.ai/docs)
|
|
180
|
+
- [API Reference](https://duragraph.ai/docs/api-reference/overview)
|
|
181
|
+
- [Examples](https://github.com/Duragraph/duragraph-examples)
|
|
212
182
|
|
|
213
|
-
##
|
|
183
|
+
## Related Repositories
|
|
214
184
|
|
|
215
|
-
|
|
216
|
-
|
|
185
|
+
| Repository | Description |
|
|
186
|
+
|------------|-------------|
|
|
187
|
+
| [duragraph](https://github.com/Duragraph/duragraph) | Core API server |
|
|
188
|
+
| [duragraph-go](https://github.com/Duragraph/duragraph-go) | Go SDK |
|
|
189
|
+
| [duragraph-examples](https://github.com/Duragraph/duragraph-examples) | Example projects |
|
|
190
|
+
| [duragraph-docs](https://github.com/Duragraph/duragraph-docs) | Documentation |
|
|
217
191
|
|
|
218
192
|
## Contributing
|
|
219
193
|
|
|
220
|
-
|
|
194
|
+
See [CONTRIBUTING.md](https://github.com/Duragraph/.github/blob/main/CONTRIBUTING.md) for guidelines.
|
|
221
195
|
|
|
222
196
|
## License
|
|
223
197
|
|
|
224
|
-
Apache 2.0 -
|
|
198
|
+
Apache 2.0 - See [LICENSE](LICENSE) for details.
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
# DuraGraph Python SDK
|
|
2
2
|
|
|
3
|
-
[](
|
|
3
|
+
[](https://badge.fury.io/py/duragraph)
|
|
4
|
+
[](https://pypi.org/project/duragraph/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://github.com/Duragraph/duragraph-python/actions/workflows/ci.yml)
|
|
6
7
|
|
|
7
|
-
Python SDK for [DuraGraph](https://github.com/
|
|
8
|
+
Python SDK for [DuraGraph](https://github.com/Duragraph/duragraph) - Reliable AI Workflow Orchestration.
|
|
8
9
|
|
|
9
10
|
Build AI agents with decorators, deploy to a control plane, and get full observability out of the box.
|
|
10
11
|
|
|
11
12
|
## Installation
|
|
12
13
|
|
|
13
14
|
```bash
|
|
14
|
-
pip install duragraph
|
|
15
|
+
pip install duragraph
|
|
15
16
|
|
|
16
17
|
# With OpenAI support
|
|
17
|
-
pip install duragraph
|
|
18
|
+
pip install duragraph[openai]
|
|
18
19
|
|
|
19
20
|
# With Anthropic support
|
|
20
|
-
pip install duragraph
|
|
21
|
+
pip install duragraph[anthropic]
|
|
21
22
|
|
|
22
23
|
# All features
|
|
23
|
-
pip install duragraph
|
|
24
|
+
pip install duragraph[all]
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
## Quick Start
|
|
@@ -83,18 +84,6 @@ class MyAgent:
|
|
|
83
84
|
return state
|
|
84
85
|
```
|
|
85
86
|
|
|
86
|
-
### Prompt Management
|
|
87
|
-
|
|
88
|
-
```python
|
|
89
|
-
from duragraph.prompts import prompt
|
|
90
|
-
|
|
91
|
-
@llm_node(model="gpt-4o-mini")
|
|
92
|
-
@prompt("support/classify_intent", version="2.1.0")
|
|
93
|
-
def classify(self, state):
|
|
94
|
-
# Prompt is fetched from prompt store automatically
|
|
95
|
-
return state
|
|
96
|
-
```
|
|
97
|
-
|
|
98
87
|
### Streaming
|
|
99
88
|
|
|
100
89
|
```python
|
|
@@ -125,51 +114,30 @@ class MainAgent:
|
|
|
125
114
|
plan >> research
|
|
126
115
|
```
|
|
127
116
|
|
|
128
|
-
##
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
# Initialize new project
|
|
132
|
-
duragraph init my-agent
|
|
133
|
-
|
|
134
|
-
# Run locally in development mode
|
|
135
|
-
duragraph dev
|
|
136
|
-
|
|
137
|
-
# Deploy to control plane
|
|
138
|
-
duragraph deploy --control-plane http://localhost:8081
|
|
139
|
-
|
|
140
|
-
# Visualize graph
|
|
141
|
-
duragraph visualize my_agent.py
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## Configuration
|
|
145
|
-
|
|
146
|
-
```toml
|
|
147
|
-
# pyproject.toml
|
|
148
|
-
[tool.duragraph]
|
|
149
|
-
control_plane = "http://localhost:8081"
|
|
150
|
-
|
|
151
|
-
[tool.duragraph.llm]
|
|
152
|
-
default_model = "gpt-4o-mini"
|
|
117
|
+
## Requirements
|
|
153
118
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
```
|
|
119
|
+
- Python 3.10+
|
|
120
|
+
- DuraGraph Control Plane (for deployment)
|
|
157
121
|
|
|
158
122
|
## Documentation
|
|
159
123
|
|
|
160
|
-
- [Full Documentation](https://
|
|
161
|
-
- [API Reference](https://
|
|
162
|
-
- [Examples](https://github.com/
|
|
124
|
+
- [Full Documentation](https://duragraph.ai/docs)
|
|
125
|
+
- [API Reference](https://duragraph.ai/docs/api-reference/overview)
|
|
126
|
+
- [Examples](https://github.com/Duragraph/duragraph-examples)
|
|
163
127
|
|
|
164
|
-
##
|
|
128
|
+
## Related Repositories
|
|
165
129
|
|
|
166
|
-
|
|
167
|
-
|
|
130
|
+
| Repository | Description |
|
|
131
|
+
|------------|-------------|
|
|
132
|
+
| [duragraph](https://github.com/Duragraph/duragraph) | Core API server |
|
|
133
|
+
| [duragraph-go](https://github.com/Duragraph/duragraph-go) | Go SDK |
|
|
134
|
+
| [duragraph-examples](https://github.com/Duragraph/duragraph-examples) | Example projects |
|
|
135
|
+
| [duragraph-docs](https://github.com/Duragraph/duragraph-docs) | Documentation |
|
|
168
136
|
|
|
169
137
|
## Contributing
|
|
170
138
|
|
|
171
|
-
|
|
139
|
+
See [CONTRIBUTING.md](https://github.com/Duragraph/.github/blob/main/CONTRIBUTING.md) for guidelines.
|
|
172
140
|
|
|
173
141
|
## License
|
|
174
142
|
|
|
175
|
-
Apache 2.0 -
|
|
143
|
+
Apache 2.0 - See [LICENSE](LICENSE) for details.
|