Skip to content

Commit

Permalink
dynamic max loops, + gpt4clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
kyegomez committed Nov 9, 2023
1 parent 1dc1e8f commit 371da79
Show file tree
Hide file tree
Showing 16 changed files with 287 additions and 257 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ Book a [1-on-1 Session with Kye](https://calendly.com/swarm-corp/30min), the Cre
We have a small gallery of examples to run here, [for more check out the docs to build your own agent and or swarms!](https://docs.apac.ai)

### `Flow` Example
- The `Flow` is a superior iteratioin of the `LLMChain` from Langchain, our intent with `Flow` is to create the most reliable loop structure that gives the agents their "autonomy" through 3 main methods of interaction, one through user specified loops, then dynamic where the agent parses a <DONE> token, and or an interactive human input verison, or a mix of all 3.
- Reliable Structure that provides LLMS autonomy
- Extremely Customizeable with stopping conditions, interactivity, dynamical temperature, loop intervals, and so much more
- Enterprise Grade + Production Grade: `Flow` is designed and optimized for automating real-world tasks at scale!

```python

Expand Down Expand Up @@ -86,9 +88,10 @@ out = flow.run("Generate a 10,000 word blog on health and wellness.")
------

### `SequentialWorkflow`
- Execute tasks step by step by passing in an LLM and the task description!
- Pass in flows with various LLMs
- Save and restore Workflow states!
- A Sequential swarm of autonomous agents where each agent's outputs are fed into the next agent
- Save and Restore Workflow states!
- Integrate Flow's with various LLMs and Multi-Modality Models

```python
from swarms.models import OpenAIChat
from swarms.structs import Flow
Expand Down Expand Up @@ -130,7 +133,6 @@ for task in workflow.tasks:

```


---

## Documentation
Expand All @@ -140,6 +142,9 @@ for task in workflow.tasks:
## Contribute
- We're always looking for contributors to help us improve and expand this project. If you're interested, please check out our [Contributing Guidelines](CONTRIBUTING.md) and our [contributing board](https://github.com/users/kyegomez/projects/1)

## Community
- [Join the Swarms community here on Discord!](https://discord.gg/AJazBmhKnr)


# License
MIT
Empty file modified code_quality.sh
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions demos/ui_software_demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Autonomous swarm that optimizes UI autonomously
GPT4Vision ->> GPT4 ->> UI
"""
15 changes: 15 additions & 0 deletions playground/models/gpt4_v.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from swarms.models.gpt4v import GPT4Vision

api_key = ""

gpt4vision = GPT4Vision(
openai_api_key=api_key,
)

img = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/VFPt_Solenoid_correct2.svg/640px-VFPt_Solenoid_correct2.svg.png"

task = "What is this image"

answer = gpt4vision.run(task, img)

print(answer)
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "swarms"
version = "2.1.4"
version = "2.1.6"
description = "Swarms - Pytorch"
license = "MIT"
authors = ["Kye Gomez <kye@apac.ai>"]
Expand All @@ -24,7 +24,7 @@ classifiers = [
[tool.poetry.dependencies]
python = "^3.8.1"
transformers = "*"
openai = "0.28.1"
openai = "*"
langchain = "*"
asyncio = "*"
nest_asyncio = "*"
Expand All @@ -45,6 +45,8 @@ httpx = "*"
tiktoken = "*"
attrs = "*"
ggl = "*"
ratelimit = "*"

beautifulsoup4 = "*"
huggingface-hub = "*"
pydantic = "*"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ tabulate
colored
griptape
addict
ratelimit
albumentations
basicsr
termcolor
Expand Down
2 changes: 1 addition & 1 deletion sequential_workflow_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from swarms.structs.sequential_workflow import SequentialWorkflow

# Example usage
api_key = ""
api_key = ""

# Initialize the language flow
llm = OpenAIChat(
Expand Down
2 changes: 1 addition & 1 deletion swarms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
from swarms.agents import *
from swarms.swarms import *
from swarms.structs import *
from swarms.models import * # import * only works when __all__ = [] is defined in __init__.py
from swarms.models import *
from swarms.chunkers import *
from swarms.workers import *
4 changes: 4 additions & 0 deletions swarms/memory/weaviate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""
Weaviate API Client
"""
1 change: 0 additions & 1 deletion swarms/models/fuyu.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Fuyu:
>>> fuyu = Fuyu()
>>> fuyu("Hello, my name is", "path/to/image.png")
"""

def __init__(
Expand Down

0 comments on commit 371da79

Please sign in to comment.