parent
ab90a405c8
commit
b3dc64cae6
@ -0,0 +1,17 @@
|
||||
{
|
||||
"agent_id": "<function agent_id at 0x16368c400>",
|
||||
"agent_name": "Transcript Generator",
|
||||
"agent_description": "Generate a transcript for a youtube video on what swarms are!",
|
||||
"system_prompt": "\n You are a fully autonomous agent serving the user in automating tasks, workflows, and activities. \n Agent's use custom instructions, capabilities, and data to optimize LLMs for a more narrow set of tasks.\n \n You will have internal dialogues with yourself and or interact with the user to aid in these tasks. \n Your responses should be coherent, contextually relevant, and tailored to the task at hand.\n",
|
||||
"sop": null,
|
||||
"short_memory": "system: \n You are a fully autonomous agent serving the user in automating tasks, workflows, and activities. \n Agent's use custom instructions, capabilities, and data to optimize LLMs for a more narrow set of tasks.\n \n You will have internal dialogues with yourself and or interact with the user to aid in these tasks. \n Your responses should be coherent, contextually relevant, and tailored to the task at hand.\n\n\n\nHuman:: Generate a transcript for a youtube video on what swarms are!\n\n\nTranscript Generator: \nSwarms are composed of large numbers of independent individuals that collectively carry out complex behaviors. For example, an ant colony functions as a swarm - each ant follows simple rules but together the colony can build intricate nests and find food.\n\nIn artificial swarms, we try to emulate these naturally-occurring phenomena. By programming basic behaviors into agents and allowing them to interact, we can observe emergent group behaviors without centralized control. For example, groups of robots may be designed with attraction and repulsion forces to self-assemble or explore environments.\n\nSimilarly, swarms may allow optimization algorithms to explore solutions in parallel. Each program follows their own trajectory while sharing information to converge on the best result. High-level commands give a rough direction, but the specific behaviors emerge from the interactions at the local level. \n\nPotential applications of artificial swarms include self-configuring robot teams for search & rescue, intelligent routing of network packets, and distributed processing for enhanced efficiency. The decentralized nature of swarms provides robustness, scalability and adaptability surpassing individual agents. \n\nBy harnessing simple local rules and interactions, swarm systems transcend the capabilities of any single member. They provide distributed solutions to coordinate large numbers independent agents to achieve a collective purpose.\n\n\nTranscript Generator: \nSwarms are composed of large numbers of independent individuals that collectively carry out complex behaviors. For example, an ant colony functions as a swarm - each ant follows simple rules but together the colony can build intricate nests and find food.\n\nIn artificial swarms, we try to emulate these naturally-occurring phenomena. By programming basic behaviors into agents and allowing them to interact, we can observe emergent group behaviors without centralized control. For example, groups of robots may be designed with attraction and repulsion forces to self-assemble or explore environments.\n\nSimilarly, swarms may allow optimization algorithms to explore solutions in parallel. Each program follows their own trajectory while sharing information to converge on the best result. High-level commands give a rough direction, but the specific behaviors emerge from the interactions at the local level. \n\nPotential applications of artificial swarms include self-configuring robot teams for search & rescue, intelligent routing of network packets, and distributed processing for enhanced efficiency. The decentralized nature of swarms provides robustness, scalability and adaptability surpassing individual agents. \n\nBy harnessing simple local rules and interactions, swarm systems transcend the capabilities of any single member. They provide distributed solutions to coordinate large numbers independent agents to achieve a collective purpose.\n\n\nHuman:: what is your purpose\n\n",
|
||||
"loop_interval": 1,
|
||||
"retry_attempts": 3,
|
||||
"retry_interval": 1,
|
||||
"interactive": true,
|
||||
"dashboard": false,
|
||||
"dynamic_temperature": false,
|
||||
"autosave": true,
|
||||
"saved_state_path": "Transcript Generator_state.json",
|
||||
"max_loops": 1
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
from swarms.models.popular_llms import OpenAIChat
|
||||
|
||||
|
||||
class MistralAPILLM(OpenAIChat):
|
||||
def __init__(self, url):
|
||||
super().__init__()
|
||||
self.openai_proxy_url = url
|
||||
|
||||
def __call__(self, task: str):
|
||||
super().__call__(task)
|
@ -0,0 +1,8 @@
|
||||
from langchain.tools import (
|
||||
BaseTool,
|
||||
Tool,
|
||||
StructuredTool,
|
||||
tool,
|
||||
) # noqa F401
|
||||
|
||||
__all__ = ["BaseTool", "Tool", "StructuredTool", "tool"]
|
@ -0,0 +1,50 @@
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from swarms import OpenAIChat, ToolAgent
|
||||
from swarms.utils.json_utils import base_model_to_json
|
||||
|
||||
# Load the environment variables
|
||||
load_dotenv()
|
||||
|
||||
# Initialize the OpenAIChat class
|
||||
chat = OpenAIChat(
|
||||
api_key=os.getenv("OPENAI_API"),
|
||||
)
|
||||
|
||||
|
||||
# Initialize the schema for the person's information
|
||||
class Schema(BaseModel):
|
||||
name: str = Field(..., title="Name of the person")
|
||||
agent: int = Field(..., title="Age of the person")
|
||||
is_student: bool = Field(
|
||||
..., title="Whether the person is a student"
|
||||
)
|
||||
courses: list[str] = Field(
|
||||
..., title="List of courses the person is taking"
|
||||
)
|
||||
|
||||
|
||||
# Convert the schema to a JSON string
|
||||
tool_schema = base_model_to_json(Schema)
|
||||
|
||||
# Define the task to generate a person's information
|
||||
task = (
|
||||
"Generate a person's information based on the following schema:"
|
||||
)
|
||||
|
||||
# Create an instance of the ToolAgent class
|
||||
agent = ToolAgent(
|
||||
name="dolly-function-agent",
|
||||
description="Ana gent to create a child data",
|
||||
llm=chat,
|
||||
json_schema=tool_schema,
|
||||
)
|
||||
|
||||
# Run the agent to generate the person's information
|
||||
generated_data = agent(task)
|
||||
|
||||
# Print the generated data
|
||||
print(f"Generated data: {generated_data}")
|
Loading…
Reference in new issue