flyto-ai 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.
- flyto_ai-0.2.0/LICENSE +190 -0
- flyto_ai-0.2.0/NOTICE +4 -0
- flyto_ai-0.2.0/PKG-INFO +207 -0
- flyto_ai-0.2.0/README.md +177 -0
- flyto_ai-0.2.0/flyto_ai/__init__.py +20 -0
- flyto_ai-0.2.0/flyto_ai/__main__.py +5 -0
- flyto_ai-0.2.0/flyto_ai/agent.py +257 -0
- flyto_ai-0.2.0/flyto_ai/cli.py +331 -0
- flyto_ai-0.2.0/flyto_ai/config.py +80 -0
- flyto_ai-0.2.0/flyto_ai/models.py +32 -0
- flyto_ai-0.2.0/flyto_ai/prompt/__init__.py +2 -0
- flyto_ai-0.2.0/flyto_ai/prompt/policies.py +100 -0
- flyto_ai-0.2.0/flyto_ai/prompt/system_prompt.py +170 -0
- flyto_ai-0.2.0/flyto_ai/providers/__init__.py +5 -0
- flyto_ai-0.2.0/flyto_ai/providers/anthropic.py +128 -0
- flyto_ai-0.2.0/flyto_ai/providers/base.py +27 -0
- flyto_ai-0.2.0/flyto_ai/providers/ollama.py +23 -0
- flyto_ai-0.2.0/flyto_ai/providers/openai.py +127 -0
- flyto_ai-0.2.0/flyto_ai/redaction.py +28 -0
- flyto_ai-0.2.0/flyto_ai/session.py +104 -0
- flyto_ai-0.2.0/flyto_ai/tools/__init__.py +5 -0
- flyto_ai-0.2.0/flyto_ai/tools/blueprint_tools.py +56 -0
- flyto_ai-0.2.0/flyto_ai/tools/core_tools.py +83 -0
- flyto_ai-0.2.0/flyto_ai/tools/inspect_page.py +158 -0
- flyto_ai-0.2.0/flyto_ai/tools/registry.py +74 -0
- flyto_ai-0.2.0/flyto_ai/validation.py +76 -0
- flyto_ai-0.2.0/pyproject.toml +41 -0
- flyto_ai-0.2.0/tests/conftest.py +3 -0
- flyto_ai-0.2.0/tests/test_auto_discover.py +80 -0
- flyto_ai-0.2.0/tests/test_cli.py +134 -0
- flyto_ai-0.2.0/tests/test_config.py +70 -0
- flyto_ai-0.2.0/tests/test_ollama_flow.py +82 -0
- flyto_ai-0.2.0/tests/test_policies.py +80 -0
- flyto_ai-0.2.0/tests/test_prompt.py +46 -0
- flyto_ai-0.2.0/tests/test_redaction.py +51 -0
- flyto_ai-0.2.0/tests/test_session.py +71 -0
- flyto_ai-0.2.0/tests/test_tool_registry.py +95 -0
- flyto_ai-0.2.0/tests/test_validation.py +37 -0
flyto_ai-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2024 Flyto
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
flyto_ai-0.2.0/NOTICE
ADDED
flyto_ai-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flyto-ai
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: AI agent that turns natural language into executable automation. 412 batteries included.
|
|
5
|
+
Project-URL: Homepage, https://github.com/flytohub/flyto-ai
|
|
6
|
+
Project-URL: Repository, https://github.com/flytohub/flyto-ai.git
|
|
7
|
+
Project-URL: Issues, https://github.com/flytohub/flyto-ai/issues
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
License-File: NOTICE
|
|
11
|
+
Keywords: ai-agent,anthropic,automation,llm,mcp,ollama,openai,workflow
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Requires-Dist: anthropic>=0.20.0
|
|
18
|
+
Requires-Dist: flyto-blueprint>=0.1.0
|
|
19
|
+
Requires-Dist: flyto-core[browser]>=2.12.0
|
|
20
|
+
Requires-Dist: openai>=1.0.0
|
|
21
|
+
Requires-Dist: pydantic>=2.0.0
|
|
22
|
+
Requires-Dist: pyyaml>=6.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
26
|
+
Provides-Extra: lite
|
|
27
|
+
Requires-Dist: pydantic>=2.0.0; extra == 'lite'
|
|
28
|
+
Requires-Dist: pyyaml>=6.0; extra == 'lite'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<img src="https://raw.githubusercontent.com/AIsFlow/flyto-ai/main/docs/logo.svg" alt="Flyto2 AI" width="400">
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<h3 align="center">Natural language → executable automation workflows</h3>
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<em>aider writes code. open-interpreter runs code. <strong>flyto-ai builds workflows.</strong></em>
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
<a href="https://pypi.org/project/flyto-ai/"><img src="https://img.shields.io/pypi/v/flyto-ai?color=blue" alt="PyPI"></a>
|
|
43
|
+
<a href="https://pypi.org/project/flyto-ai/"><img src="https://img.shields.io/pypi/pyversions/flyto-ai" alt="Python"></a>
|
|
44
|
+
<a href="https://github.com/AIsFlow/flyto-ai/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"></a>
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## What is flyto-ai?
|
|
50
|
+
|
|
51
|
+
An AI agent that turns natural language into **reusable, structured automation workflows** — not throwaway scripts, not chat responses.
|
|
52
|
+
|
|
53
|
+
You describe what you want. The agent calls tools, validates parameters, and produces a **YAML workflow** you can save, share, schedule, and run again.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
"scrape the title from example.com"
|
|
57
|
+
↓
|
|
58
|
+
┌─────────────────────────────────────┐
|
|
59
|
+
│ name: Scrape Title │
|
|
60
|
+
│ steps: │
|
|
61
|
+
│ - id: launch │
|
|
62
|
+
│ module: browser.launch │
|
|
63
|
+
│ - id: goto │
|
|
64
|
+
│ module: browser.goto │
|
|
65
|
+
│ params: │
|
|
66
|
+
│ url: "https://example.com" │
|
|
67
|
+
│ - id: extract │
|
|
68
|
+
│ module: browser.extract │
|
|
69
|
+
│ params: │
|
|
70
|
+
│ selector: "h1" │
|
|
71
|
+
└─────────────────────────────────────┘
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Quick Start
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pip install flyto-ai
|
|
78
|
+
export OPENAI_API_KEY=sk-...
|
|
79
|
+
flyto-ai chat "scrape the title from https://example.com"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
That's it. One install — includes OpenAI, Anthropic, Ollama, **412 automation modules**, browser automation, and self-learning blueprints.
|
|
83
|
+
|
|
84
|
+
## Why flyto-ai?
|
|
85
|
+
|
|
86
|
+
| | aider | open-interpreter | flyto-ai |
|
|
87
|
+
|---|---|---|---|
|
|
88
|
+
| **Output** | Code changes (git diff) | One-time code execution | **Reusable YAML workflows** |
|
|
89
|
+
| **Tools** | Your codebase | Raw Python/JS/Shell | **412 pre-built modules** |
|
|
90
|
+
| **Learns** | No | No | **Yes — self-learning blueprints** |
|
|
91
|
+
| **Reusable** | Yes (code) | No (ephemeral) | **Yes (save, share, schedule)** |
|
|
92
|
+
| **Webhook/API** | No | No | **Yes** |
|
|
93
|
+
| **For** | Developers | Power users | **Anyone** |
|
|
94
|
+
| **License** | Apache-2.0 | AGPL-3.0 | **Apache-2.0** |
|
|
95
|
+
|
|
96
|
+
## 412 Batteries Included
|
|
97
|
+
|
|
98
|
+
Powered by [flyto-core](https://pypi.org/project/flyto-core/) — 412 automation modules across 78 categories:
|
|
99
|
+
|
|
100
|
+
| Category | Modules | Examples |
|
|
101
|
+
|----------|---------|---------|
|
|
102
|
+
| Browser | 38 | launch, goto, click, type, extract, screenshot, wait |
|
|
103
|
+
| HTTP / API | 15 | GET, POST, download, upload, GraphQL |
|
|
104
|
+
| String | 12 | split, replace, template, regex, slugify |
|
|
105
|
+
| Image | 10 | resize, crop, convert, watermark, compress |
|
|
106
|
+
| File | 9 | read, write, copy, zip, CSV, JSON |
|
|
107
|
+
| Database | 6 | query, insert, SQLite, PostgreSQL |
|
|
108
|
+
| Notification | 5 | email, Slack, Telegram, webhook |
|
|
109
|
+
| + 71 more categories | 317 | array, math, crypto, convert, flow, ... |
|
|
110
|
+
|
|
111
|
+
## Self-Learning Blueprints
|
|
112
|
+
|
|
113
|
+
The agent remembers what works. Good workflows are automatically saved as **blueprints** — reusable patterns that make future tasks faster.
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
First time: "screenshot example.com" → 15s (discover modules, build from scratch)
|
|
117
|
+
Second time: "screenshot another.com" → 3s (reuse learned blueprint)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Blueprints are stored locally (`~/.flyto/blueprints.db`) and scored by success rate. Export and share your best ones:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
flyto-ai blueprints # View learned blueprints
|
|
124
|
+
flyto-ai blueprints --export > blueprints.yaml # Export for sharing
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## CLI
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
flyto-ai chat "scrape example.com" # Generate a workflow
|
|
131
|
+
flyto-ai chat "take screenshot" -p ollama # Use Ollama (no API key)
|
|
132
|
+
flyto-ai chat "hello" --json # Raw JSON output
|
|
133
|
+
flyto-ai chat "..." --webhook https://... # POST result to webhook
|
|
134
|
+
flyto-ai serve --port 8080 # HTTP server for triggers
|
|
135
|
+
flyto-ai blueprints # List learned blueprints
|
|
136
|
+
flyto-ai version # Version + dependency status
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Webhook & HTTP Server
|
|
140
|
+
|
|
141
|
+
**Send results anywhere:**
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
flyto-ai chat "scrape example.com" --webhook https://hook.site/xxx
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Accept triggers from anywhere:**
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
flyto-ai serve --port 8080
|
|
151
|
+
|
|
152
|
+
# Then from Slack, n8n, Make, or any HTTP client:
|
|
153
|
+
curl -X POST http://localhost:8080/chat \
|
|
154
|
+
-H "Content-Type: application/json" \
|
|
155
|
+
-d '{"message": "take a screenshot of example.com"}'
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Python API
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
from flyto_ai import Agent, AgentConfig
|
|
162
|
+
|
|
163
|
+
# Auto-detects API keys from environment
|
|
164
|
+
agent = Agent(config=AgentConfig.from_env())
|
|
165
|
+
result = await agent.chat("extract all links from https://example.com")
|
|
166
|
+
print(result.message) # YAML workflow
|
|
167
|
+
print(result.tool_calls) # Tool call log
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Multi-Provider
|
|
171
|
+
|
|
172
|
+
Works with any LLM:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
export OPENAI_API_KEY=sk-... # GPT-4o, GPT-4o-mini
|
|
176
|
+
export ANTHROPIC_API_KEY=sk-ant-... # Claude Sonnet, Opus
|
|
177
|
+
flyto-ai chat "..." -p ollama # Llama, Mistral, local models
|
|
178
|
+
flyto-ai chat "..." -p openai --model gpt-4o
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Architecture
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
User message
|
|
185
|
+
→ LLM (OpenAI / Anthropic / Ollama)
|
|
186
|
+
→ Function calling: search_modules, get_module_info, validate_params, ...
|
|
187
|
+
→ 412 flyto-core modules
|
|
188
|
+
→ Self-learning blueprints
|
|
189
|
+
→ Browser page inspection
|
|
190
|
+
→ YAML validation loop (auto-retry on errors)
|
|
191
|
+
→ Structured workflow output
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Environment Variables
|
|
195
|
+
|
|
196
|
+
| Variable | Description |
|
|
197
|
+
|----------|-------------|
|
|
198
|
+
| `FLYTO_AI_PROVIDER` | `openai`, `anthropic`, or `ollama` |
|
|
199
|
+
| `FLYTO_AI_API_KEY` | API key (or use provider-specific vars below) |
|
|
200
|
+
| `FLYTO_AI_MODEL` | Model name override |
|
|
201
|
+
| `OPENAI_API_KEY` | Fallback for OpenAI provider |
|
|
202
|
+
| `ANTHROPIC_API_KEY` | Fallback for Anthropic provider |
|
|
203
|
+
| `FLYTO_AI_BASE_URL` | Custom API endpoint (OpenAI-compatible) |
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
Apache-2.0 — use it commercially, fork it, build on it.
|
flyto_ai-0.2.0/README.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/AIsFlow/flyto-ai/main/docs/logo.svg" alt="Flyto2 AI" width="400">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h3 align="center">Natural language → executable automation workflows</h3>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<em>aider writes code. open-interpreter runs code. <strong>flyto-ai builds workflows.</strong></em>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://pypi.org/project/flyto-ai/"><img src="https://img.shields.io/pypi/v/flyto-ai?color=blue" alt="PyPI"></a>
|
|
13
|
+
<a href="https://pypi.org/project/flyto-ai/"><img src="https://img.shields.io/pypi/pyversions/flyto-ai" alt="Python"></a>
|
|
14
|
+
<a href="https://github.com/AIsFlow/flyto-ai/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## What is flyto-ai?
|
|
20
|
+
|
|
21
|
+
An AI agent that turns natural language into **reusable, structured automation workflows** — not throwaway scripts, not chat responses.
|
|
22
|
+
|
|
23
|
+
You describe what you want. The agent calls tools, validates parameters, and produces a **YAML workflow** you can save, share, schedule, and run again.
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
"scrape the title from example.com"
|
|
27
|
+
↓
|
|
28
|
+
┌─────────────────────────────────────┐
|
|
29
|
+
│ name: Scrape Title │
|
|
30
|
+
│ steps: │
|
|
31
|
+
│ - id: launch │
|
|
32
|
+
│ module: browser.launch │
|
|
33
|
+
│ - id: goto │
|
|
34
|
+
│ module: browser.goto │
|
|
35
|
+
│ params: │
|
|
36
|
+
│ url: "https://example.com" │
|
|
37
|
+
│ - id: extract │
|
|
38
|
+
│ module: browser.extract │
|
|
39
|
+
│ params: │
|
|
40
|
+
│ selector: "h1" │
|
|
41
|
+
└─────────────────────────────────────┘
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install flyto-ai
|
|
48
|
+
export OPENAI_API_KEY=sk-...
|
|
49
|
+
flyto-ai chat "scrape the title from https://example.com"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
That's it. One install — includes OpenAI, Anthropic, Ollama, **412 automation modules**, browser automation, and self-learning blueprints.
|
|
53
|
+
|
|
54
|
+
## Why flyto-ai?
|
|
55
|
+
|
|
56
|
+
| | aider | open-interpreter | flyto-ai |
|
|
57
|
+
|---|---|---|---|
|
|
58
|
+
| **Output** | Code changes (git diff) | One-time code execution | **Reusable YAML workflows** |
|
|
59
|
+
| **Tools** | Your codebase | Raw Python/JS/Shell | **412 pre-built modules** |
|
|
60
|
+
| **Learns** | No | No | **Yes — self-learning blueprints** |
|
|
61
|
+
| **Reusable** | Yes (code) | No (ephemeral) | **Yes (save, share, schedule)** |
|
|
62
|
+
| **Webhook/API** | No | No | **Yes** |
|
|
63
|
+
| **For** | Developers | Power users | **Anyone** |
|
|
64
|
+
| **License** | Apache-2.0 | AGPL-3.0 | **Apache-2.0** |
|
|
65
|
+
|
|
66
|
+
## 412 Batteries Included
|
|
67
|
+
|
|
68
|
+
Powered by [flyto-core](https://pypi.org/project/flyto-core/) — 412 automation modules across 78 categories:
|
|
69
|
+
|
|
70
|
+
| Category | Modules | Examples |
|
|
71
|
+
|----------|---------|---------|
|
|
72
|
+
| Browser | 38 | launch, goto, click, type, extract, screenshot, wait |
|
|
73
|
+
| HTTP / API | 15 | GET, POST, download, upload, GraphQL |
|
|
74
|
+
| String | 12 | split, replace, template, regex, slugify |
|
|
75
|
+
| Image | 10 | resize, crop, convert, watermark, compress |
|
|
76
|
+
| File | 9 | read, write, copy, zip, CSV, JSON |
|
|
77
|
+
| Database | 6 | query, insert, SQLite, PostgreSQL |
|
|
78
|
+
| Notification | 5 | email, Slack, Telegram, webhook |
|
|
79
|
+
| + 71 more categories | 317 | array, math, crypto, convert, flow, ... |
|
|
80
|
+
|
|
81
|
+
## Self-Learning Blueprints
|
|
82
|
+
|
|
83
|
+
The agent remembers what works. Good workflows are automatically saved as **blueprints** — reusable patterns that make future tasks faster.
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
First time: "screenshot example.com" → 15s (discover modules, build from scratch)
|
|
87
|
+
Second time: "screenshot another.com" → 3s (reuse learned blueprint)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Blueprints are stored locally (`~/.flyto/blueprints.db`) and scored by success rate. Export and share your best ones:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
flyto-ai blueprints # View learned blueprints
|
|
94
|
+
flyto-ai blueprints --export > blueprints.yaml # Export for sharing
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## CLI
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
flyto-ai chat "scrape example.com" # Generate a workflow
|
|
101
|
+
flyto-ai chat "take screenshot" -p ollama # Use Ollama (no API key)
|
|
102
|
+
flyto-ai chat "hello" --json # Raw JSON output
|
|
103
|
+
flyto-ai chat "..." --webhook https://... # POST result to webhook
|
|
104
|
+
flyto-ai serve --port 8080 # HTTP server for triggers
|
|
105
|
+
flyto-ai blueprints # List learned blueprints
|
|
106
|
+
flyto-ai version # Version + dependency status
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Webhook & HTTP Server
|
|
110
|
+
|
|
111
|
+
**Send results anywhere:**
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
flyto-ai chat "scrape example.com" --webhook https://hook.site/xxx
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Accept triggers from anywhere:**
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
flyto-ai serve --port 8080
|
|
121
|
+
|
|
122
|
+
# Then from Slack, n8n, Make, or any HTTP client:
|
|
123
|
+
curl -X POST http://localhost:8080/chat \
|
|
124
|
+
-H "Content-Type: application/json" \
|
|
125
|
+
-d '{"message": "take a screenshot of example.com"}'
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Python API
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from flyto_ai import Agent, AgentConfig
|
|
132
|
+
|
|
133
|
+
# Auto-detects API keys from environment
|
|
134
|
+
agent = Agent(config=AgentConfig.from_env())
|
|
135
|
+
result = await agent.chat("extract all links from https://example.com")
|
|
136
|
+
print(result.message) # YAML workflow
|
|
137
|
+
print(result.tool_calls) # Tool call log
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Multi-Provider
|
|
141
|
+
|
|
142
|
+
Works with any LLM:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
export OPENAI_API_KEY=sk-... # GPT-4o, GPT-4o-mini
|
|
146
|
+
export ANTHROPIC_API_KEY=sk-ant-... # Claude Sonnet, Opus
|
|
147
|
+
flyto-ai chat "..." -p ollama # Llama, Mistral, local models
|
|
148
|
+
flyto-ai chat "..." -p openai --model gpt-4o
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Architecture
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
User message
|
|
155
|
+
→ LLM (OpenAI / Anthropic / Ollama)
|
|
156
|
+
→ Function calling: search_modules, get_module_info, validate_params, ...
|
|
157
|
+
→ 412 flyto-core modules
|
|
158
|
+
→ Self-learning blueprints
|
|
159
|
+
→ Browser page inspection
|
|
160
|
+
→ YAML validation loop (auto-retry on errors)
|
|
161
|
+
→ Structured workflow output
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Environment Variables
|
|
165
|
+
|
|
166
|
+
| Variable | Description |
|
|
167
|
+
|----------|-------------|
|
|
168
|
+
| `FLYTO_AI_PROVIDER` | `openai`, `anthropic`, or `ollama` |
|
|
169
|
+
| `FLYTO_AI_API_KEY` | API key (or use provider-specific vars below) |
|
|
170
|
+
| `FLYTO_AI_MODEL` | Model name override |
|
|
171
|
+
| `OPENAI_API_KEY` | Fallback for OpenAI provider |
|
|
172
|
+
| `ANTHROPIC_API_KEY` | Fallback for Anthropic provider |
|
|
173
|
+
| `FLYTO_AI_BASE_URL` | Custom API endpoint (OpenAI-compatible) |
|
|
174
|
+
|
|
175
|
+
## License
|
|
176
|
+
|
|
177
|
+
Apache-2.0 — use it commercially, fork it, build on it.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Copyright 2024 Flyto
|
|
2
|
+
# Licensed under the Apache License, Version 2.0
|
|
3
|
+
"""flyto-ai — Natural language automation agent."""
|
|
4
|
+
from flyto_ai.agent import Agent
|
|
5
|
+
from flyto_ai.config import AgentConfig
|
|
6
|
+
from flyto_ai.models import ChatMessage, ChatRequest, ChatResponse
|
|
7
|
+
|
|
8
|
+
__version__ = "0.2.0"
|
|
9
|
+
__all__ = ["Agent", "AgentConfig", "ChatMessage", "ChatRequest", "ChatResponse", "__version__"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def create_agent(
|
|
13
|
+
provider: str = "",
|
|
14
|
+
api_key: str = "",
|
|
15
|
+
model: str = "",
|
|
16
|
+
**kwargs,
|
|
17
|
+
) -> Agent:
|
|
18
|
+
"""Convenience factory for creating an Agent."""
|
|
19
|
+
config = AgentConfig(provider=provider, api_key=api_key, model=model, **kwargs)
|
|
20
|
+
return Agent(config=config)
|