@ -28,8 +28,8 @@ The provided code showcases a system built around a worker node that utilizes va
The code begins with import statements, bringing in necessary modules and classes. Key imports include the `OpenAIChat` class, which represents a language model, and several custom agents and tools from the `swarms` package.
The code begins with import statements, bringing in necessary modules and classes. Key imports include the `OpenAIChat` class, which represents a language model, and several custom agents and tools from the `swarms` package.
```python
```python
import os
import interpreter # Assuming this is a custom module
import interpreter # Assuming this is a custom module
from swarms.agents.hf_agents import HFAgent
from swarms.agents.hf_agents import HFAgent
from swarms.agents.omni_modal_agent import OmniModalAgent
from swarms.agents.omni_modal_agent import OmniModalAgent
from swarms.models import OpenAIChat
from swarms.models import OpenAIChat
@ -59,11 +59,7 @@ All defined tools are appended to a list called `tools`. This list is later used
@ -53,11 +53,11 @@ Voila! You’re now ready to summon your Worker.
Here’s a simple way to invoke the Worker and give it a task:
Here’s a simple way to invoke the Worker and give it a task:
```python
```python
from swarms.models import OpenAIChat
from swarms import Worker
from swarms import Worker
from swarms.models import OpenAIChat
llm = OpenAIChat(
llm = OpenAIChat(
#enter your api key
#enter your api key
openai_api_key="",
openai_api_key="",
temperature=0.5,
temperature=0.5,
)
)
@ -75,8 +75,6 @@ node = Worker(
task = "What were the winning boston marathon times for the past 5 years (ending in 2022)? Generate a table of the year, name, country of origin, and times."
task = "What were the winning boston marathon times for the past 5 years (ending in 2022)? Generate a table of the year, name, country of origin, and times."
In the above example, `upload_no_path` is an instance of `ArtifactUpload` with no specified `relative_path`, whereas `upload_with_path` is an instance of `ArtifactUpload` with the `relative_path` set to "python/code/".
In the above example, `upload_no_path` is an instance of `ArtifactUpload` with no specified `relative_path`, whereas `upload_with_path` is an instance of `ArtifactUpload` with the `relative_path` set to "python/code/".
For the usage examples and additional in-depth documentation please visit [BaseWorkflow](https://github.com/swarms-modules/structs/blob/main/baseworkflow.md#swarms-structs)
For the usage examples and additional in-depth documentation please visit [BaseWorkflow](https://github.com/swarms-modules/structs/blob/main/baseworkflow.md#swarms-structs)
@ -49,11 +49,11 @@ Makes the Worker class callable. When an instance of the class is called, it wil
### **Example 1**: Basic usage with default parameters:
### **Example 1**: Basic usage with default parameters:
```python
```python
from swarms.models import OpenAIChat
from swarms import Worker
from swarms import Worker
from swarms.models import OpenAIChat
llm = OpenAIChat(
llm = OpenAIChat(
#enter your api key
#enter your api key
openai_api_key="",
openai_api_key="",
temperature=0.5,
temperature=0.5,
)
)
@ -195,17 +195,16 @@ response = node.run(task)
# Print the response
# Print the response
print(response)
print(response)
```
```
### **Example 3**: Usage with human in the loop:
### **Example 3**: Usage with human in the loop:
```python
```python
from swarms.models import OpenAIChat
from swarms import Worker
from swarms import Worker
from swarms.models import OpenAIChat
llm = OpenAIChat(
llm = OpenAIChat(
#enter your api key
#enter your api key
openai_api_key="",
openai_api_key="",
temperature=0.5,
temperature=0.5,
)
)
@ -223,7 +222,6 @@ node = Worker(
task = "What were the winning boston marathon times for the past 5 years (ending in 2022)? Generate a table of the year, name, country of origin, and times."
task = "What were the winning boston marathon times for the past 5 years (ending in 2022)? Generate a table of the year, name, country of origin, and times."