llm-workflow-engine 0.22.9__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.
Files changed (135) hide show
  1. llm_workflow_engine-0.22.9/PKG-INFO +139 -0
  2. llm_workflow_engine-0.22.9/README.md +94 -0
  3. llm_workflow_engine-0.22.9/docs/conf.py +84 -0
  4. llm_workflow_engine-0.22.9/llm_workflow_engine.egg-info/PKG-INFO +139 -0
  5. llm_workflow_engine-0.22.9/llm_workflow_engine.egg-info/SOURCES.txt +133 -0
  6. llm_workflow_engine-0.22.9/llm_workflow_engine.egg-info/dependency_links.txt +1 -0
  7. llm_workflow_engine-0.22.9/llm_workflow_engine.egg-info/entry_points.txt +2 -0
  8. llm_workflow_engine-0.22.9/llm_workflow_engine.egg-info/requires.txt +32 -0
  9. llm_workflow_engine-0.22.9/llm_workflow_engine.egg-info/top_level.txt +7 -0
  10. llm_workflow_engine-0.22.9/lwe/__init__.py +1 -0
  11. llm_workflow_engine-0.22.9/lwe/backends/__init__.py +0 -0
  12. llm_workflow_engine-0.22.9/lwe/backends/api/__init__.py +0 -0
  13. llm_workflow_engine-0.22.9/lwe/backends/api/backend.py +863 -0
  14. llm_workflow_engine-0.22.9/lwe/backends/api/conversation.py +85 -0
  15. llm_workflow_engine-0.22.9/lwe/backends/api/conversation_storage_manager.py +257 -0
  16. llm_workflow_engine-0.22.9/lwe/backends/api/database.py +207 -0
  17. llm_workflow_engine-0.22.9/lwe/backends/api/message.py +132 -0
  18. llm_workflow_engine-0.22.9/lwe/backends/api/orm.py +287 -0
  19. llm_workflow_engine-0.22.9/lwe/backends/api/repl.py +1235 -0
  20. llm_workflow_engine-0.22.9/lwe/backends/api/request.py +628 -0
  21. llm_workflow_engine-0.22.9/lwe/backends/api/schema/__init__.py +0 -0
  22. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic/env.py +85 -0
  23. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic/script.py.mako +24 -0
  24. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic/versions/28ec77033b2e_conversation_add_provider_preset.py +42 -0
  25. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic/versions/4e642f725923_tools_migration.py +151 -0
  26. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic/versions/82656e325f36_migrate_model_data_to_messages_remove_.py +34 -0
  27. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic/versions/9a533073a041_user_replace_default_model_with_default_.py +20 -0
  28. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic/versions/c7d7803302a9_add_message_metadata_to_message_table.py +21 -0
  29. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic/versions/cc8f2aecf9ff_remove_streaming_attribute_from_presets.py +60 -0
  30. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic/versions/ea7ed165a4ef_preset_config_schema_v2.py +68 -0
  31. llm_workflow_engine-0.22.9/lwe/backends/api/schema/alembic.ini +110 -0
  32. llm_workflow_engine-0.22.9/lwe/backends/api/schema/updater.py +135 -0
  33. llm_workflow_engine-0.22.9/lwe/backends/api/user.py +150 -0
  34. llm_workflow_engine-0.22.9/lwe/backends/api/workflow/__init__.py +0 -0
  35. llm_workflow_engine-0.22.9/lwe/backends/api/workflow/action_plugins/__init__.py +0 -0
  36. llm_workflow_engine-0.22.9/lwe/backends/api/workflow/action_plugins/lwe_input.py +186 -0
  37. llm_workflow_engine-0.22.9/lwe/backends/api/workflow/library/__init__.py +0 -0
  38. llm_workflow_engine-0.22.9/lwe/backends/api/workflow/library/lwe_command.py +147 -0
  39. llm_workflow_engine-0.22.9/lwe/backends/api/workflow/library/lwe_llm.py +276 -0
  40. llm_workflow_engine-0.22.9/lwe/backends/api/workflow/library/lwe_sqlite_query.py +150 -0
  41. llm_workflow_engine-0.22.9/lwe/backends/api/workflow/library/text_extractor.py +214 -0
  42. llm_workflow_engine-0.22.9/lwe/core/__init__.py +0 -0
  43. llm_workflow_engine-0.22.9/lwe/core/async_compat.py +9 -0
  44. llm_workflow_engine-0.22.9/lwe/core/cache_manager.py +125 -0
  45. llm_workflow_engine-0.22.9/lwe/core/config.py +157 -0
  46. llm_workflow_engine-0.22.9/lwe/core/constants.py +137 -0
  47. llm_workflow_engine-0.22.9/lwe/core/doc_parser.py +159 -0
  48. llm_workflow_engine-0.22.9/lwe/core/editor.py +93 -0
  49. llm_workflow_engine-0.22.9/lwe/core/error.py +2 -0
  50. llm_workflow_engine-0.22.9/lwe/core/logger.py +23 -0
  51. llm_workflow_engine-0.22.9/lwe/core/monkey_patch.py +1 -0
  52. llm_workflow_engine-0.22.9/lwe/core/plugin.py +72 -0
  53. llm_workflow_engine-0.22.9/lwe/core/plugin_manager.py +155 -0
  54. llm_workflow_engine-0.22.9/lwe/core/preset_manager.py +173 -0
  55. llm_workflow_engine-0.22.9/lwe/core/provider.py +427 -0
  56. llm_workflow_engine-0.22.9/lwe/core/provider_manager.py +42 -0
  57. llm_workflow_engine-0.22.9/lwe/core/repl.py +1472 -0
  58. llm_workflow_engine-0.22.9/lwe/core/template_manager.py +396 -0
  59. llm_workflow_engine-0.22.9/lwe/core/token_manager.py +98 -0
  60. llm_workflow_engine-0.22.9/lwe/core/tool.py +42 -0
  61. llm_workflow_engine-0.22.9/lwe/core/tool_cache.py +66 -0
  62. llm_workflow_engine-0.22.9/lwe/core/tool_manager.py +223 -0
  63. llm_workflow_engine-0.22.9/lwe/core/util.py +489 -0
  64. llm_workflow_engine-0.22.9/lwe/core/workflow_manager.py +242 -0
  65. llm_workflow_engine-0.22.9/lwe/debug.py +17 -0
  66. llm_workflow_engine-0.22.9/lwe/examples/data/voicemail_transcriptions.db.tar.gz +0 -0
  67. llm_workflow_engine-0.22.9/lwe/examples/presets/gpt-4-exploratory-code-writing.yaml +11 -0
  68. llm_workflow_engine-0.22.9/lwe/examples/presets/turbo-16k-code-generation.yaml +11 -0
  69. llm_workflow_engine-0.22.9/lwe/examples/presets/turbo.yaml +11 -0
  70. llm_workflow_engine-0.22.9/lwe/examples/templates/example-antonym-generator.md +21 -0
  71. llm_workflow_engine-0.22.9/lwe/examples/templates/example-code-documentation.md +18 -0
  72. llm_workflow_engine-0.22.9/lwe/examples/templates/example-code-generator.md +30 -0
  73. llm_workflow_engine-0.22.9/lwe/examples/templates/example-code-refactor.md +13 -0
  74. llm_workflow_engine-0.22.9/lwe/examples/templates/example-code-spec-generator.md +32 -0
  75. llm_workflow_engine-0.22.9/lwe/examples/templates/example-coding-gpt-chain-of-thought-collaboration.md +19 -0
  76. llm_workflow_engine-0.22.9/lwe/examples/templates/example-prompt-engineer.md +27 -0
  77. llm_workflow_engine-0.22.9/lwe/examples/templates/example-sentiment-analysis.md +16 -0
  78. llm_workflow_engine-0.22.9/lwe/examples/templates/example-summarize-conversation.md +11 -0
  79. llm_workflow_engine-0.22.9/lwe/examples/templates/example-voicemail-sentiment-analysis.md +22 -0
  80. llm_workflow_engine-0.22.9/lwe/examples/tools/reverse_content.py +24 -0
  81. llm_workflow_engine-0.22.9/lwe/examples/tools/store_sentiment_and_topics.py +52 -0
  82. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-analyze-voicemail-transcriptions-process-row.yaml +47 -0
  83. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-analyze-voicemail-transcriptions.yaml +60 -0
  84. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-ask-question.yaml +20 -0
  85. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-file-summarizer-summarize-file.yaml +192 -0
  86. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-file-summarizer.yaml +67 -0
  87. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-iterative-task.yaml +45 -0
  88. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-iterative.yaml +18 -0
  89. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-multiple-workflows.yaml +50 -0
  90. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-persona-generator-create-characteristics.yaml +12 -0
  91. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-persona-generator-create-persona.yaml +83 -0
  92. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-persona-generator.yaml +43 -0
  93. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-question-answer-feedback-answer.yaml +54 -0
  94. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-saved-conversation.yaml +50 -0
  95. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-say-hello.yaml +13 -0
  96. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-social-media-content-generator.yaml +144 -0
  97. llm_workflow_engine-0.22.9/lwe/examples/workflows/example-summarize-content.yaml +33 -0
  98. llm_workflow_engine-0.22.9/lwe/main.py +226 -0
  99. llm_workflow_engine-0.22.9/lwe/plugins/__init__.py +0 -0
  100. llm_workflow_engine-0.22.9/lwe/plugins/echo.py +54 -0
  101. llm_workflow_engine-0.22.9/lwe/plugins/examples.py +142 -0
  102. llm_workflow_engine-0.22.9/lwe/plugins/provider_chat_openai.py +174 -0
  103. llm_workflow_engine-0.22.9/lwe/plugins/provider_chat_openai_compat.py +83 -0
  104. llm_workflow_engine-0.22.9/lwe/plugins/provider_fake_llm.py +233 -0
  105. llm_workflow_engine-0.22.9/lwe/presets/gpt-4-chatbot-responses.yaml +12 -0
  106. llm_workflow_engine-0.22.9/lwe/presets/gpt-4-code-generation.yaml +12 -0
  107. llm_workflow_engine-0.22.9/lwe/presets/gpt-4-creative-writing.yaml +12 -0
  108. llm_workflow_engine-0.22.9/lwe/presets/gpt-4o-mini.yaml +7 -0
  109. llm_workflow_engine-0.22.9/lwe/templates/workflow-generator.md +288 -0
  110. llm_workflow_engine-0.22.9/lwe/templates/workflow-review.md +72 -0
  111. llm_workflow_engine-0.22.9/lwe/templates/workflow-spec-generator.md +45 -0
  112. llm_workflow_engine-0.22.9/lwe/tools/test_tool.py +32 -0
  113. llm_workflow_engine-0.22.9/lwe/version.py +1 -0
  114. llm_workflow_engine-0.22.9/lwe/workflows/hello-world.yaml +9 -0
  115. llm_workflow_engine-0.22.9/pyproject.toml +90 -0
  116. llm_workflow_engine-0.22.9/scripts/create-schema-revision.py +75 -0
  117. llm_workflow_engine-0.22.9/scripts/tool_calling_stub.py +82 -0
  118. llm_workflow_engine-0.22.9/setup.cfg +4 -0
  119. llm_workflow_engine-0.22.9/tests/__init__.py +0 -0
  120. llm_workflow_engine-0.22.9/tests/base.py +226 -0
  121. llm_workflow_engine-0.22.9/tests/conftest.py +76 -0
  122. llm_workflow_engine-0.22.9/tests/count-test-asserts.py +46 -0
  123. llm_workflow_engine-0.22.9/tests/integration/__init__.py +0 -0
  124. llm_workflow_engine-0.22.9/tests/integration/test_conversation_storage_manager.py +116 -0
  125. llm_workflow_engine-0.22.9/tests/integration/test_request.py +904 -0
  126. llm_workflow_engine-0.22.9/tests/system/__init__.py +0 -0
  127. llm_workflow_engine-0.22.9/tests/system/test_api_backend.py +628 -0
  128. llm_workflow_engine-0.22.9/tests/system/test_api_backend_template.py +462 -0
  129. llm_workflow_engine-0.22.9/tests/unit/__init__.py +0 -0
  130. llm_workflow_engine-0.22.9/tests/unit/test_conversation_storage_manager.py +164 -0
  131. llm_workflow_engine-0.22.9/tests/unit/test_request.py +1507 -0
  132. llm_workflow_engine-0.22.9/tests/unit/test_template_manager.py +269 -0
  133. llm_workflow_engine-0.22.9/tests/unit/test_token_manager.py +110 -0
  134. llm_workflow_engine-0.22.9/tests/unit/test_tool_cache.py +100 -0
  135. llm_workflow_engine-0.22.9/tests/unit/test_util.py +379 -0
@@ -0,0 +1,139 @@
1
+ Metadata-Version: 2.4
2
+ Name: llm-workflow-engine
3
+ Version: 0.22.9
4
+ Summary: CLI tool and workflow manager for common LLMs
5
+ Author: Chad Phillips
6
+ Author-email: Mahmoud Mabrouk <mahmoudmabrouk.mail@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/llm-workflow-engine/llm-workflow-engine
9
+ Project-URL: Repository, https://github.com/llm-workflow-engine/llm-workflow-engine
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: ansible>=8.0
15
+ Requires-Dist: ansible-core>=2.15
16
+ Requires-Dist: alembic
17
+ Requires-Dist: beautifulsoup4
18
+ Requires-Dist: docutils>=0.20.1
19
+ Requires-Dist: email-validator
20
+ Requires-Dist: Jinja2
21
+ Requires-Dist: kreuzberg
22
+ Requires-Dist: langchain<0.4,>=0.3.19
23
+ Requires-Dist: langchain-core<0.4,>=0.3.39
24
+ Requires-Dist: langchain-community<0.4,>=0.3.16
25
+ Requires-Dist: langchain_openai>=0.3.3
26
+ Requires-Dist: names
27
+ Requires-Dist: numexpr>=2.8.4
28
+ Requires-Dist: openpyxl
29
+ Requires-Dist: pdfminer.six
30
+ Requires-Dist: prompt-toolkit
31
+ Requires-Dist: pymupdf4llm
32
+ Requires-Dist: pyperclip
33
+ Requires-Dist: python-frontmatter
34
+ Requires-Dist: PyYAML
35
+ Requires-Dist: rich
36
+ Requires-Dist: setuptools
37
+ Requires-Dist: sqlalchemy>=1.4.48
38
+ Requires-Dist: tiktoken
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest; extra == "dev"
41
+ Requires-Dist: pytest-datadir; extra == "dev"
42
+ Requires-Dist: pip-tools; extra == "dev"
43
+ Requires-Dist: flake8; extra == "dev"
44
+ Requires-Dist: black; extra == "dev"
45
+
46
+ [![Test status](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/python-app.yml/badge.svg)](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/python-app.yml)
47
+ [![CodeQL](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/github-code-scanning/codeql)
48
+
49
+ <p align="center">
50
+ <img alt="lwe-logo-small" src="https://github.com/llm-workflow-engine/llm-workflow-engine/assets/43772/6921deac-0964-41a9-84fd-7c2ebce198c0" />
51
+ </p>
52
+
53
+ <h1>
54
+ <p align="center">
55
+ LLM Workflow Engine
56
+ </p>
57
+ </h1>
58
+
59
+ <p id="summary-header" align="center">LLM Workflow Engine (LWE) is a <b>Power CLI</b> and <b>Workflow manager</b> for LLMs.</p>
60
+
61
+ <h4 id="documentation" align="center">
62
+ <a href="https://llm-workflow-engine.readthedocs.io" target="_blank">
63
+ Read the documentation
64
+ </a>
65
+ </h4>
66
+
67
+ <h4 id="intro-video" align="center">
68
+ <a href="https://www.youtube.com/watch?v=-FiYQiS5nY4" target="_blank">
69
+ WATCH INTRO VIDEO
70
+ </a>
71
+ </h4>
72
+
73
+ ## Welcome!
74
+
75
+ What would you like to do?
76
+
77
+ * [Learn about the project](https://llm-workflow-engine.readthedocs.io)
78
+ * [Install LWE](https://llm-workflow-engine.readthedocs.io/en/latest/installation.html)
79
+ * [Learn how to use it](https://llm-workflow-engine.readthedocs.io/en/latest/how_it_works.html)
80
+ * [Read the documentation](https://llm-workflow-engine.readthedocs.io)
81
+ * [Learn more about configuration/features](https://llm-workflow-engine.readthedocs.io/en/latest/configuration.html)
82
+ * [Troubleshoot common issues](https://llm-workflow-engine.readthedocs.io/en/latest/troubleshooting.html)
83
+ * [Upgrade LWE](https://llm-workflow-engine.readthedocs.io/en/latest/upgrading.html)
84
+ * [Using GPT4](https://llm-workflow-engine.readthedocs.io/en/latest/model_access.html#gpt4)
85
+ * [Report a bug](ISSUES.md)
86
+ * [Get support](SUPPORT.md)
87
+
88
+
89
+ ## What happend to the original ChatGPT Wrapper project?
90
+
91
+ See [CHATGPT_WRAPPER.md](CHATGPT_WRAPPER.md)
92
+
93
+ ChatGPT Wrapper was an amazing tool for its time, thank you to its original creator [mmabrouk](https://github.com/mmabrouk) for all your hard work, it lives on in a new form :)
94
+
95
+ ## Highlights
96
+
97
+ 🤖 LWE lets you use the powerful ChatGPT/GPT4 bot from the **command line**.
98
+
99
+ 💬 **Runs in Shell**. You can call and interact with ChatGPT/GPT4 in the terminal.
100
+
101
+ 💻 **Supports official ChatGPT API**. Make API calls directly to the OpenAI ChatGPT endpoint (all supported models accessible by your OpenAI account)
102
+
103
+ 🔌 [**Simple plugin architecture**](https://llm-workflow-engine.readthedocs.io/en/latest/plugins.html#core-plugins). Extend LWE with custom functionality
104
+
105
+ 🗣 **Supports multiple LLM providers**. Provider plugins allow interacting with other LLMs (GPT-3, Cohere, Hugginface, etc.)
106
+
107
+ 🔄[**Build workflows**](https://llm-workflow-engine.readthedocs.io/en/latest/workflows.html). Easily integrate calls to an LLM into larger workflows via Ansible Playbooks
108
+
109
+ 🔧 [**Tool use**](https://llm-workflow-engine.readthedocs.io/en/latest/tools.html). (for supported providers)
110
+
111
+ 🐳 **Docker image**. LWE is also available as a docker image. (experimental)
112
+
113
+ 🐍**Python API**. LWE also has a Python library that lets you use ChatGPT/GPT4 in your Python scripts.
114
+
115
+ ## Projects built with the original ChatGPT Wrapper
116
+
117
+ - [bookast: ChatGPT Podcast Generator For Books](https://github.com/SamMethnani/bookast)
118
+ - [ChatGPT.el: ChatGPT in Emacs](https://github.com/joshcho/ChatGPT.el)
119
+ - [ChatGPT Reddit Bot](https://github.com/PopDaddyGames/ChatGPT-RedditBot)
120
+ - [Smarty GPT](https://github.com/citiususc/Smarty-GPT/tree/v1.1.0)
121
+ - [ChatGPTify](https://github.com/idilsulo/ChatGPTify)
122
+ - [selection-to-chatgpt](https://github.com/collin-murphy/selection-to-chatgpt)
123
+
124
+ ## Contributing
125
+
126
+ We welcome contributions to LWE! If you have an idea for a new feature or have found a bug, please open an issue on the GitHub repository.
127
+
128
+ ## License
129
+
130
+ This project is licensed under the MIT License - see the LICENSE file for details.
131
+
132
+ ## Acknowledgments
133
+
134
+ - The original ChatGPT Wrapper project (which LWE grew from) was created and maintained by [mmabrouk](https://github.com/mmabrouk)
135
+ - The original ChatGPT Wrapper project is a modification from [Taranjeet](https://github.com/taranjeet/chatgpt-api) code which is a modification of [Daniel Gross](https://github.com/danielgross/whatsapp-gpt) code.
136
+
137
+ ## Star History
138
+
139
+ [![Star History Chart](https://api.star-history.com/svg?repos=llm-workflow-engine/llm-workflow-engine&type=Date)](https://star-history.com/#llm-workflow-engine/llm-workflow-engine&Date)
@@ -0,0 +1,94 @@
1
+ [![Test status](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/python-app.yml/badge.svg)](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/python-app.yml)
2
+ [![CodeQL](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/github-code-scanning/codeql)
3
+
4
+ <p align="center">
5
+ <img alt="lwe-logo-small" src="https://github.com/llm-workflow-engine/llm-workflow-engine/assets/43772/6921deac-0964-41a9-84fd-7c2ebce198c0" />
6
+ </p>
7
+
8
+ <h1>
9
+ <p align="center">
10
+ LLM Workflow Engine
11
+ </p>
12
+ </h1>
13
+
14
+ <p id="summary-header" align="center">LLM Workflow Engine (LWE) is a <b>Power CLI</b> and <b>Workflow manager</b> for LLMs.</p>
15
+
16
+ <h4 id="documentation" align="center">
17
+ <a href="https://llm-workflow-engine.readthedocs.io" target="_blank">
18
+ Read the documentation
19
+ </a>
20
+ </h4>
21
+
22
+ <h4 id="intro-video" align="center">
23
+ <a href="https://www.youtube.com/watch?v=-FiYQiS5nY4" target="_blank">
24
+ WATCH INTRO VIDEO
25
+ </a>
26
+ </h4>
27
+
28
+ ## Welcome!
29
+
30
+ What would you like to do?
31
+
32
+ * [Learn about the project](https://llm-workflow-engine.readthedocs.io)
33
+ * [Install LWE](https://llm-workflow-engine.readthedocs.io/en/latest/installation.html)
34
+ * [Learn how to use it](https://llm-workflow-engine.readthedocs.io/en/latest/how_it_works.html)
35
+ * [Read the documentation](https://llm-workflow-engine.readthedocs.io)
36
+ * [Learn more about configuration/features](https://llm-workflow-engine.readthedocs.io/en/latest/configuration.html)
37
+ * [Troubleshoot common issues](https://llm-workflow-engine.readthedocs.io/en/latest/troubleshooting.html)
38
+ * [Upgrade LWE](https://llm-workflow-engine.readthedocs.io/en/latest/upgrading.html)
39
+ * [Using GPT4](https://llm-workflow-engine.readthedocs.io/en/latest/model_access.html#gpt4)
40
+ * [Report a bug](ISSUES.md)
41
+ * [Get support](SUPPORT.md)
42
+
43
+
44
+ ## What happend to the original ChatGPT Wrapper project?
45
+
46
+ See [CHATGPT_WRAPPER.md](CHATGPT_WRAPPER.md)
47
+
48
+ ChatGPT Wrapper was an amazing tool for its time, thank you to its original creator [mmabrouk](https://github.com/mmabrouk) for all your hard work, it lives on in a new form :)
49
+
50
+ ## Highlights
51
+
52
+ 🤖 LWE lets you use the powerful ChatGPT/GPT4 bot from the **command line**.
53
+
54
+ 💬 **Runs in Shell**. You can call and interact with ChatGPT/GPT4 in the terminal.
55
+
56
+ 💻 **Supports official ChatGPT API**. Make API calls directly to the OpenAI ChatGPT endpoint (all supported models accessible by your OpenAI account)
57
+
58
+ 🔌 [**Simple plugin architecture**](https://llm-workflow-engine.readthedocs.io/en/latest/plugins.html#core-plugins). Extend LWE with custom functionality
59
+
60
+ 🗣 **Supports multiple LLM providers**. Provider plugins allow interacting with other LLMs (GPT-3, Cohere, Hugginface, etc.)
61
+
62
+ 🔄[**Build workflows**](https://llm-workflow-engine.readthedocs.io/en/latest/workflows.html). Easily integrate calls to an LLM into larger workflows via Ansible Playbooks
63
+
64
+ 🔧 [**Tool use**](https://llm-workflow-engine.readthedocs.io/en/latest/tools.html). (for supported providers)
65
+
66
+ 🐳 **Docker image**. LWE is also available as a docker image. (experimental)
67
+
68
+ 🐍**Python API**. LWE also has a Python library that lets you use ChatGPT/GPT4 in your Python scripts.
69
+
70
+ ## Projects built with the original ChatGPT Wrapper
71
+
72
+ - [bookast: ChatGPT Podcast Generator For Books](https://github.com/SamMethnani/bookast)
73
+ - [ChatGPT.el: ChatGPT in Emacs](https://github.com/joshcho/ChatGPT.el)
74
+ - [ChatGPT Reddit Bot](https://github.com/PopDaddyGames/ChatGPT-RedditBot)
75
+ - [Smarty GPT](https://github.com/citiususc/Smarty-GPT/tree/v1.1.0)
76
+ - [ChatGPTify](https://github.com/idilsulo/ChatGPTify)
77
+ - [selection-to-chatgpt](https://github.com/collin-murphy/selection-to-chatgpt)
78
+
79
+ ## Contributing
80
+
81
+ We welcome contributions to LWE! If you have an idea for a new feature or have found a bug, please open an issue on the GitHub repository.
82
+
83
+ ## License
84
+
85
+ This project is licensed under the MIT License - see the LICENSE file for details.
86
+
87
+ ## Acknowledgments
88
+
89
+ - The original ChatGPT Wrapper project (which LWE grew from) was created and maintained by [mmabrouk](https://github.com/mmabrouk)
90
+ - The original ChatGPT Wrapper project is a modification from [Taranjeet](https://github.com/taranjeet/chatgpt-api) code which is a modification of [Daniel Gross](https://github.com/danielgross/whatsapp-gpt) code.
91
+
92
+ ## Star History
93
+
94
+ [![Star History Chart](https://api.star-history.com/svg?repos=llm-workflow-engine/llm-workflow-engine&type=Date)](https://star-history.com/#llm-workflow-engine/llm-workflow-engine&Date)
@@ -0,0 +1,84 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # For the full list of built-in configuration values, see the documentation:
4
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
+
6
+ # -- Project information -----------------------------------------------------
7
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
+
9
+ import os
10
+ import sys
11
+ import re
12
+ from os import path
13
+ from datetime import datetime
14
+
15
+ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
16
+
17
+ current_year = datetime.now().year
18
+ authors = [
19
+ "Chad Phillips",
20
+ "Mahmoud Mabrouk",
21
+ ]
22
+
23
+ ROOT_DIR = path.dirname(path.dirname(path.abspath(path.realpath(__file__))))
24
+
25
+ with open(path.join(ROOT_DIR, "lwe", "version.py")) as f:
26
+ version = re.match(r'^__version__ = "([\w\.]+)"$', f.read().strip())[1]
27
+
28
+ project = "LLM Workflow Engine"
29
+ copyright = "%s, %s" % (current_year, ", ".join(authors))
30
+ author = ", ".join(authors)
31
+ release = version
32
+
33
+ # -- General configuration ---------------------------------------------------
34
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
35
+
36
+ extensions = [
37
+ "sphinx.ext.autodoc",
38
+ "sphinx.ext.todo",
39
+ "sphinx.ext.viewcode",
40
+ "sphinx.ext.autosectionlabel",
41
+ "sphinx_copybutton",
42
+ ]
43
+
44
+ templates_path = ["_templates"]
45
+ exclude_patterns = [
46
+ ".python-version",
47
+ "_build",
48
+ "Thumbs.db",
49
+ ".DS_Store",
50
+ ]
51
+ pygments_style = "sphinx"
52
+
53
+
54
+ # -- Options for HTML output -------------------------------------------------
55
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
56
+
57
+ html_static_path = ["_static"]
58
+ html_theme = "alabaster"
59
+ html_theme_options = {
60
+ # 'logo': 'images/cog-brain-trimmed.png',
61
+ "logo": "images/lwe-logo.png",
62
+ "logo_name": False,
63
+ "fixed_sidebar": False,
64
+ "show_powered_by": False,
65
+ "show_relbars": True,
66
+ "sidebar_collapse": True,
67
+ "github_button": True,
68
+ "github_repo": "llm-workflow-engine",
69
+ "github_user": "llm-workflow-engine",
70
+ }
71
+ html_sidebars = {
72
+ "**": [
73
+ "about.html",
74
+ "searchbox.html",
75
+ "navigation.html",
76
+ "relations.html",
77
+ "donate.html",
78
+ ]
79
+ }
80
+ html_css_files = [
81
+ "css/custom.css",
82
+ ]
83
+
84
+ copybutton_exclude = ".linenos, .gp, .go"
@@ -0,0 +1,139 @@
1
+ Metadata-Version: 2.4
2
+ Name: llm-workflow-engine
3
+ Version: 0.22.9
4
+ Summary: CLI tool and workflow manager for common LLMs
5
+ Author: Chad Phillips
6
+ Author-email: Mahmoud Mabrouk <mahmoudmabrouk.mail@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/llm-workflow-engine/llm-workflow-engine
9
+ Project-URL: Repository, https://github.com/llm-workflow-engine/llm-workflow-engine
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: ansible>=8.0
15
+ Requires-Dist: ansible-core>=2.15
16
+ Requires-Dist: alembic
17
+ Requires-Dist: beautifulsoup4
18
+ Requires-Dist: docutils>=0.20.1
19
+ Requires-Dist: email-validator
20
+ Requires-Dist: Jinja2
21
+ Requires-Dist: kreuzberg
22
+ Requires-Dist: langchain<0.4,>=0.3.19
23
+ Requires-Dist: langchain-core<0.4,>=0.3.39
24
+ Requires-Dist: langchain-community<0.4,>=0.3.16
25
+ Requires-Dist: langchain_openai>=0.3.3
26
+ Requires-Dist: names
27
+ Requires-Dist: numexpr>=2.8.4
28
+ Requires-Dist: openpyxl
29
+ Requires-Dist: pdfminer.six
30
+ Requires-Dist: prompt-toolkit
31
+ Requires-Dist: pymupdf4llm
32
+ Requires-Dist: pyperclip
33
+ Requires-Dist: python-frontmatter
34
+ Requires-Dist: PyYAML
35
+ Requires-Dist: rich
36
+ Requires-Dist: setuptools
37
+ Requires-Dist: sqlalchemy>=1.4.48
38
+ Requires-Dist: tiktoken
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest; extra == "dev"
41
+ Requires-Dist: pytest-datadir; extra == "dev"
42
+ Requires-Dist: pip-tools; extra == "dev"
43
+ Requires-Dist: flake8; extra == "dev"
44
+ Requires-Dist: black; extra == "dev"
45
+
46
+ [![Test status](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/python-app.yml/badge.svg)](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/python-app.yml)
47
+ [![CodeQL](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/llm-workflow-engine/llm-workflow-engine/actions/workflows/github-code-scanning/codeql)
48
+
49
+ <p align="center">
50
+ <img alt="lwe-logo-small" src="https://github.com/llm-workflow-engine/llm-workflow-engine/assets/43772/6921deac-0964-41a9-84fd-7c2ebce198c0" />
51
+ </p>
52
+
53
+ <h1>
54
+ <p align="center">
55
+ LLM Workflow Engine
56
+ </p>
57
+ </h1>
58
+
59
+ <p id="summary-header" align="center">LLM Workflow Engine (LWE) is a <b>Power CLI</b> and <b>Workflow manager</b> for LLMs.</p>
60
+
61
+ <h4 id="documentation" align="center">
62
+ <a href="https://llm-workflow-engine.readthedocs.io" target="_blank">
63
+ Read the documentation
64
+ </a>
65
+ </h4>
66
+
67
+ <h4 id="intro-video" align="center">
68
+ <a href="https://www.youtube.com/watch?v=-FiYQiS5nY4" target="_blank">
69
+ WATCH INTRO VIDEO
70
+ </a>
71
+ </h4>
72
+
73
+ ## Welcome!
74
+
75
+ What would you like to do?
76
+
77
+ * [Learn about the project](https://llm-workflow-engine.readthedocs.io)
78
+ * [Install LWE](https://llm-workflow-engine.readthedocs.io/en/latest/installation.html)
79
+ * [Learn how to use it](https://llm-workflow-engine.readthedocs.io/en/latest/how_it_works.html)
80
+ * [Read the documentation](https://llm-workflow-engine.readthedocs.io)
81
+ * [Learn more about configuration/features](https://llm-workflow-engine.readthedocs.io/en/latest/configuration.html)
82
+ * [Troubleshoot common issues](https://llm-workflow-engine.readthedocs.io/en/latest/troubleshooting.html)
83
+ * [Upgrade LWE](https://llm-workflow-engine.readthedocs.io/en/latest/upgrading.html)
84
+ * [Using GPT4](https://llm-workflow-engine.readthedocs.io/en/latest/model_access.html#gpt4)
85
+ * [Report a bug](ISSUES.md)
86
+ * [Get support](SUPPORT.md)
87
+
88
+
89
+ ## What happend to the original ChatGPT Wrapper project?
90
+
91
+ See [CHATGPT_WRAPPER.md](CHATGPT_WRAPPER.md)
92
+
93
+ ChatGPT Wrapper was an amazing tool for its time, thank you to its original creator [mmabrouk](https://github.com/mmabrouk) for all your hard work, it lives on in a new form :)
94
+
95
+ ## Highlights
96
+
97
+ 🤖 LWE lets you use the powerful ChatGPT/GPT4 bot from the **command line**.
98
+
99
+ 💬 **Runs in Shell**. You can call and interact with ChatGPT/GPT4 in the terminal.
100
+
101
+ 💻 **Supports official ChatGPT API**. Make API calls directly to the OpenAI ChatGPT endpoint (all supported models accessible by your OpenAI account)
102
+
103
+ 🔌 [**Simple plugin architecture**](https://llm-workflow-engine.readthedocs.io/en/latest/plugins.html#core-plugins). Extend LWE with custom functionality
104
+
105
+ 🗣 **Supports multiple LLM providers**. Provider plugins allow interacting with other LLMs (GPT-3, Cohere, Hugginface, etc.)
106
+
107
+ 🔄[**Build workflows**](https://llm-workflow-engine.readthedocs.io/en/latest/workflows.html). Easily integrate calls to an LLM into larger workflows via Ansible Playbooks
108
+
109
+ 🔧 [**Tool use**](https://llm-workflow-engine.readthedocs.io/en/latest/tools.html). (for supported providers)
110
+
111
+ 🐳 **Docker image**. LWE is also available as a docker image. (experimental)
112
+
113
+ 🐍**Python API**. LWE also has a Python library that lets you use ChatGPT/GPT4 in your Python scripts.
114
+
115
+ ## Projects built with the original ChatGPT Wrapper
116
+
117
+ - [bookast: ChatGPT Podcast Generator For Books](https://github.com/SamMethnani/bookast)
118
+ - [ChatGPT.el: ChatGPT in Emacs](https://github.com/joshcho/ChatGPT.el)
119
+ - [ChatGPT Reddit Bot](https://github.com/PopDaddyGames/ChatGPT-RedditBot)
120
+ - [Smarty GPT](https://github.com/citiususc/Smarty-GPT/tree/v1.1.0)
121
+ - [ChatGPTify](https://github.com/idilsulo/ChatGPTify)
122
+ - [selection-to-chatgpt](https://github.com/collin-murphy/selection-to-chatgpt)
123
+
124
+ ## Contributing
125
+
126
+ We welcome contributions to LWE! If you have an idea for a new feature or have found a bug, please open an issue on the GitHub repository.
127
+
128
+ ## License
129
+
130
+ This project is licensed under the MIT License - see the LICENSE file for details.
131
+
132
+ ## Acknowledgments
133
+
134
+ - The original ChatGPT Wrapper project (which LWE grew from) was created and maintained by [mmabrouk](https://github.com/mmabrouk)
135
+ - The original ChatGPT Wrapper project is a modification from [Taranjeet](https://github.com/taranjeet/chatgpt-api) code which is a modification of [Daniel Gross](https://github.com/danielgross/whatsapp-gpt) code.
136
+
137
+ ## Star History
138
+
139
+ [![Star History Chart](https://api.star-history.com/svg?repos=llm-workflow-engine/llm-workflow-engine&type=Date)](https://star-history.com/#llm-workflow-engine/llm-workflow-engine&Date)
@@ -0,0 +1,133 @@
1
+ README.md
2
+ pyproject.toml
3
+ docs/conf.py
4
+ llm_workflow_engine.egg-info/PKG-INFO
5
+ llm_workflow_engine.egg-info/SOURCES.txt
6
+ llm_workflow_engine.egg-info/dependency_links.txt
7
+ llm_workflow_engine.egg-info/entry_points.txt
8
+ llm_workflow_engine.egg-info/requires.txt
9
+ llm_workflow_engine.egg-info/top_level.txt
10
+ lwe/__init__.py
11
+ lwe/debug.py
12
+ lwe/main.py
13
+ lwe/version.py
14
+ lwe/backends/__init__.py
15
+ lwe/backends/api/__init__.py
16
+ lwe/backends/api/backend.py
17
+ lwe/backends/api/conversation.py
18
+ lwe/backends/api/conversation_storage_manager.py
19
+ lwe/backends/api/database.py
20
+ lwe/backends/api/message.py
21
+ lwe/backends/api/orm.py
22
+ lwe/backends/api/repl.py
23
+ lwe/backends/api/request.py
24
+ lwe/backends/api/user.py
25
+ lwe/backends/api/schema/__init__.py
26
+ lwe/backends/api/schema/alembic.ini
27
+ lwe/backends/api/schema/updater.py
28
+ lwe/backends/api/schema/alembic/env.py
29
+ lwe/backends/api/schema/alembic/script.py.mako
30
+ lwe/backends/api/schema/alembic/versions/28ec77033b2e_conversation_add_provider_preset.py
31
+ lwe/backends/api/schema/alembic/versions/4e642f725923_tools_migration.py
32
+ lwe/backends/api/schema/alembic/versions/82656e325f36_migrate_model_data_to_messages_remove_.py
33
+ lwe/backends/api/schema/alembic/versions/9a533073a041_user_replace_default_model_with_default_.py
34
+ lwe/backends/api/schema/alembic/versions/c7d7803302a9_add_message_metadata_to_message_table.py
35
+ lwe/backends/api/schema/alembic/versions/cc8f2aecf9ff_remove_streaming_attribute_from_presets.py
36
+ lwe/backends/api/schema/alembic/versions/ea7ed165a4ef_preset_config_schema_v2.py
37
+ lwe/backends/api/workflow/__init__.py
38
+ lwe/backends/api/workflow/action_plugins/__init__.py
39
+ lwe/backends/api/workflow/action_plugins/lwe_input.py
40
+ lwe/backends/api/workflow/library/__init__.py
41
+ lwe/backends/api/workflow/library/lwe_command.py
42
+ lwe/backends/api/workflow/library/lwe_llm.py
43
+ lwe/backends/api/workflow/library/lwe_sqlite_query.py
44
+ lwe/backends/api/workflow/library/text_extractor.py
45
+ lwe/core/__init__.py
46
+ lwe/core/async_compat.py
47
+ lwe/core/cache_manager.py
48
+ lwe/core/config.py
49
+ lwe/core/constants.py
50
+ lwe/core/doc_parser.py
51
+ lwe/core/editor.py
52
+ lwe/core/error.py
53
+ lwe/core/logger.py
54
+ lwe/core/monkey_patch.py
55
+ lwe/core/plugin.py
56
+ lwe/core/plugin_manager.py
57
+ lwe/core/preset_manager.py
58
+ lwe/core/provider.py
59
+ lwe/core/provider_manager.py
60
+ lwe/core/repl.py
61
+ lwe/core/template_manager.py
62
+ lwe/core/token_manager.py
63
+ lwe/core/tool.py
64
+ lwe/core/tool_cache.py
65
+ lwe/core/tool_manager.py
66
+ lwe/core/util.py
67
+ lwe/core/workflow_manager.py
68
+ lwe/examples/data/voicemail_transcriptions.db.tar.gz
69
+ lwe/examples/presets/gpt-4-exploratory-code-writing.yaml
70
+ lwe/examples/presets/turbo-16k-code-generation.yaml
71
+ lwe/examples/presets/turbo.yaml
72
+ lwe/examples/templates/example-antonym-generator.md
73
+ lwe/examples/templates/example-code-documentation.md
74
+ lwe/examples/templates/example-code-generator.md
75
+ lwe/examples/templates/example-code-refactor.md
76
+ lwe/examples/templates/example-code-spec-generator.md
77
+ lwe/examples/templates/example-coding-gpt-chain-of-thought-collaboration.md
78
+ lwe/examples/templates/example-prompt-engineer.md
79
+ lwe/examples/templates/example-sentiment-analysis.md
80
+ lwe/examples/templates/example-summarize-conversation.md
81
+ lwe/examples/templates/example-voicemail-sentiment-analysis.md
82
+ lwe/examples/tools/reverse_content.py
83
+ lwe/examples/tools/store_sentiment_and_topics.py
84
+ lwe/examples/workflows/example-analyze-voicemail-transcriptions-process-row.yaml
85
+ lwe/examples/workflows/example-analyze-voicemail-transcriptions.yaml
86
+ lwe/examples/workflows/example-ask-question.yaml
87
+ lwe/examples/workflows/example-file-summarizer-summarize-file.yaml
88
+ lwe/examples/workflows/example-file-summarizer.yaml
89
+ lwe/examples/workflows/example-iterative-task.yaml
90
+ lwe/examples/workflows/example-iterative.yaml
91
+ lwe/examples/workflows/example-multiple-workflows.yaml
92
+ lwe/examples/workflows/example-persona-generator-create-characteristics.yaml
93
+ lwe/examples/workflows/example-persona-generator-create-persona.yaml
94
+ lwe/examples/workflows/example-persona-generator.yaml
95
+ lwe/examples/workflows/example-question-answer-feedback-answer.yaml
96
+ lwe/examples/workflows/example-saved-conversation.yaml
97
+ lwe/examples/workflows/example-say-hello.yaml
98
+ lwe/examples/workflows/example-social-media-content-generator.yaml
99
+ lwe/examples/workflows/example-summarize-content.yaml
100
+ lwe/plugins/__init__.py
101
+ lwe/plugins/echo.py
102
+ lwe/plugins/examples.py
103
+ lwe/plugins/provider_chat_openai.py
104
+ lwe/plugins/provider_chat_openai_compat.py
105
+ lwe/plugins/provider_fake_llm.py
106
+ lwe/presets/gpt-4-chatbot-responses.yaml
107
+ lwe/presets/gpt-4-code-generation.yaml
108
+ lwe/presets/gpt-4-creative-writing.yaml
109
+ lwe/presets/gpt-4o-mini.yaml
110
+ lwe/templates/workflow-generator.md
111
+ lwe/templates/workflow-review.md
112
+ lwe/templates/workflow-spec-generator.md
113
+ lwe/tools/test_tool.py
114
+ lwe/workflows/hello-world.yaml
115
+ scripts/create-schema-revision.py
116
+ scripts/tool_calling_stub.py
117
+ tests/__init__.py
118
+ tests/base.py
119
+ tests/conftest.py
120
+ tests/count-test-asserts.py
121
+ tests/integration/__init__.py
122
+ tests/integration/test_conversation_storage_manager.py
123
+ tests/integration/test_request.py
124
+ tests/system/__init__.py
125
+ tests/system/test_api_backend.py
126
+ tests/system/test_api_backend_template.py
127
+ tests/unit/__init__.py
128
+ tests/unit/test_conversation_storage_manager.py
129
+ tests/unit/test_request.py
130
+ tests/unit/test_template_manager.py
131
+ tests/unit/test_token_manager.py
132
+ tests/unit/test_tool_cache.py
133
+ tests/unit/test_util.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ lwe = lwe.main:main
@@ -0,0 +1,32 @@
1
+ ansible>=8.0
2
+ ansible-core>=2.15
3
+ alembic
4
+ beautifulsoup4
5
+ docutils>=0.20.1
6
+ email-validator
7
+ Jinja2
8
+ kreuzberg
9
+ langchain<0.4,>=0.3.19
10
+ langchain-core<0.4,>=0.3.39
11
+ langchain-community<0.4,>=0.3.16
12
+ langchain_openai>=0.3.3
13
+ names
14
+ numexpr>=2.8.4
15
+ openpyxl
16
+ pdfminer.six
17
+ prompt-toolkit
18
+ pymupdf4llm
19
+ pyperclip
20
+ python-frontmatter
21
+ PyYAML
22
+ rich
23
+ setuptools
24
+ sqlalchemy>=1.4.48
25
+ tiktoken
26
+
27
+ [dev]
28
+ pytest
29
+ pytest-datadir
30
+ pip-tools
31
+ flake8
32
+ black
@@ -0,0 +1,7 @@
1
+ dist
2
+ docs
3
+ lwe
4
+ research
5
+ scripts
6
+ tests
7
+ tmp
@@ -0,0 +1 @@
1
+ from lwe.backends.api.backend import ApiBackend # noqa: F401
File without changes