Skip to content

Commit

Permalink
rename to llama-agents (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich authored Jun 23, 2024
1 parent 42eb7e7 commit e012077
Show file tree
Hide file tree
Showing 66 changed files with 226 additions and 222 deletions.
4 changes: 0 additions & 4 deletions agentfile/control_plane/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions agentfile/launchers/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions agentfile/message_consumers/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions agentfile/message_publishers/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions agentfile/message_queues/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions agentfile/messages/__init__.py

This file was deleted.

13 changes: 0 additions & 13 deletions agentfile/orchestrators/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions agentfile/tools/__init__.py

This file was deleted.

10 changes: 5 additions & 5 deletions example_scripts/agentic_human_local_single.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from agentfile.launchers.local import LocalLauncher
from agentfile.services import HumanService, AgentService
from agentfile.control_plane.server import ControlPlaneServer
from agentfile.message_queues.simple import SimpleMessageQueue
from agentfile.orchestrators.agent import AgentOrchestrator
from llama_agents.launchers.local import LocalLauncher
from llama_agents.services import HumanService, AgentService
from llama_agents.control_plane.server import ControlPlaneServer
from llama_agents.message_queues.simple import SimpleMessageQueue
from llama_agents.orchestrators.agent import AgentOrchestrator

from llama_index.core.agent import FunctionCallingAgentWorker
from llama_index.core.tools import FunctionTool
Expand Down
2 changes: 1 addition & 1 deletion example_scripts/agentic_local_single.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from agentfile import (
from llama_agents import (
AgentService,
AgentOrchestrator,
ControlPlaneServer,
Expand Down
2 changes: 1 addition & 1 deletion example_scripts/agentic_server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from agentfile import (
from llama_agents import (
AgentService,
HumanService,
AgentOrchestrator,
Expand Down
12 changes: 6 additions & 6 deletions example_scripts/agentic_toolservice_local_single.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from agentfile.launchers.local import LocalLauncher
from agentfile.services import AgentService, ToolService
from agentfile.tools import MetaServiceTool
from agentfile.control_plane.fastapi import ControlPlaneServer
from agentfile.message_queues.simple import SimpleMessageQueue
from agentfile.orchestrators.agent import AgentOrchestrator
from llama_agents.launchers.local import LocalLauncher
from llama_agents.services import AgentService, ToolService
from llama_agents.tools import MetaServiceTool
from llama_agents.control_plane.fastapi import ControlPlaneServer
from llama_agents.message_queues.simple import SimpleMessageQueue
from llama_agents.orchestrators.agent import AgentOrchestrator

from llama_index.core.agent import FunctionCallingAgentWorker
from llama_index.core.tools import FunctionTool
Expand Down
2 changes: 1 addition & 1 deletion example_scripts/pipeline_human_local_single.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from agentfile import (
from llama_agents import (
AgentService,
HumanService,
ControlPlaneServer,
Expand Down
24 changes: 14 additions & 10 deletions example_scripts/pipeline_local_single.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from agentfile import (
from llama_agents import (
AgentService,
ControlPlaneServer,
SimpleMessageQueue,
Expand All @@ -9,9 +9,9 @@

from llama_index.core.agent import FunctionCallingAgentWorker
from llama_index.core.tools import FunctionTool
from llama_index.core.query_pipeline import RouterComponent, QueryPipeline
from llama_index.core.query_pipeline import QueryPipeline
from llama_index.llms.openai import OpenAI
from llama_index.core.selectors import PydanticSingleSelector
from llama_index.agent.openai import OpenAIAgent


# create an agent
Expand All @@ -23,9 +23,11 @@ def get_the_secret_fact() -> str:
tool = FunctionTool.from_defaults(fn=get_the_secret_fact)

worker1 = FunctionCallingAgentWorker.from_tools([tool], llm=OpenAI())
worker2 = FunctionCallingAgentWorker.from_tools([], llm=OpenAI())
# worker2 = FunctionCallingAgentWorker.from_tools([], llm=OpenAI())
agent1 = worker1.as_agent()
agent2 = worker2.as_agent()
agent2 = OpenAIAgent.from_tools(
[], system_prompt="Repeat the input with a silly fact added."
) # worker2.as_agent()

# create our multi-agent framework components
message_queue = SimpleMessageQueue()
Expand All @@ -48,11 +50,13 @@ def get_the_secret_fact() -> str:

pipeline = QueryPipeline(
chain=[
RouterComponent(
selector=PydanticSingleSelector.from_defaults(llm=OpenAI()),
choices=[agent_server_1.description, agent_server_2.description],
components=[agent_component_1, agent_component_2],
)
agent_component_1,
agent_component_2,
# RouterComponent(
# selector=PydanticSingleSelector.from_defaults(llm=OpenAI()),
# choices=[agent_server_1.description, agent_server_2.description],
# components=[agent_component_1, agent_component_2],
# )
]
)

Expand Down
12 changes: 6 additions & 6 deletions agentfile/__init__.py → llama_agents/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from agentfile.control_plane import ControlPlaneServer
from agentfile.launchers import LocalLauncher, ServerLauncher
from agentfile.message_queues import SimpleMessageQueue
from agentfile.orchestrators import (
from llama_agents.control_plane import ControlPlaneServer
from llama_agents.launchers import LocalLauncher, ServerLauncher
from llama_agents.message_queues import SimpleMessageQueue
from llama_agents.orchestrators import (
AgentOrchestrator,
PipelineOrchestrator,
ServiceComponent,
ServiceTool,
)
from agentfile.tools import MetaServiceTool
from agentfile.services import AgentService, ToolService, HumanService
from llama_agents.tools import MetaServiceTool
from llama_agents.services import AgentService, ToolService, HumanService

__all__ = [
# services
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions agentfile/app/app.py → llama_agents/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from textual.reactive import reactive
from textual.widgets import Button, Header, Footer, Static, Input

from agentfile.app.components.human_list import HumanTaskList
from agentfile.app.components.service_list import ServicesList
from agentfile.app.components.task_list import TasksList
from agentfile.app.components.types import ButtonType
from agentfile.types import TaskDefinition
from llama_agents.app.components.human_list import HumanTaskList
from llama_agents.app.components.service_list import ServicesList
from llama_agents.app.components.task_list import TasksList
from llama_agents.app.components.types import ButtonType
from llama_agents.types import TaskDefinition


class LlamaAgentsMonitor(App):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from textual.reactive import reactive
from textual.widgets import Button, Static, Input

from agentfile.app.components.types import ButtonType
from agentfile.types import HumanResponse, TaskDefinition
from llama_agents.app.components.types import ButtonType
from llama_agents.types import HumanResponse, TaskDefinition


class HumanTaskButton(Button):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from textual.reactive import reactive
from textual.widgets import Button, Static

from agentfile.app.components.types import ButtonType
from llama_agents.app.components.types import ButtonType


class ServiceButton(Button):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from textual.reactive import reactive
from textual.widgets import Button, Static

from agentfile.app.components.types import ButtonType
from llama_agents.app.components.types import ButtonType


class TaskButton(Button):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse

from agentfile.app.app import run as launch_monitor
from llama_agents.app.app import run as launch_monitor


def main() -> None:
Expand Down
4 changes: 4 additions & 0 deletions llama_agents/control_plane/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from llama_agents.control_plane.base import BaseControlPlane
from llama_agents.control_plane.server import ControlPlaneServer

__all__ = ["BaseControlPlane", "ControlPlaneServer"]
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

from abc import ABC, abstractmethod

from agentfile.message_consumers.base import BaseMessageQueueConsumer
from agentfile.message_publishers.publisher import MessageQueuePublisherMixin
from agentfile.types import (
from llama_agents.message_consumers.base import BaseMessageQueueConsumer
from llama_agents.message_publishers.publisher import MessageQueuePublisherMixin
from llama_agents.types import (
ServiceDefinition,
TaskDefinition,
TaskResult,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
from llama_index.core.storage.kvstore import SimpleKVStore
from llama_index.core.vector_stores.types import BasePydanticVectorStore

from agentfile.control_plane.base import BaseControlPlane
from agentfile.message_consumers.base import BaseMessageQueueConsumer
from agentfile.message_consumers.callable import CallableMessageConsumer
from agentfile.message_consumers.remote import RemoteMessageConsumer
from agentfile.message_queues.base import BaseMessageQueue, PublishCallback
from agentfile.messages.base import QueueMessage
from agentfile.orchestrators.base import BaseOrchestrator
from agentfile.orchestrators.service_tool import ServiceTool
from agentfile.types import (
from llama_agents.control_plane.base import BaseControlPlane
from llama_agents.message_consumers.base import BaseMessageQueueConsumer
from llama_agents.message_consumers.callable import CallableMessageConsumer
from llama_agents.message_consumers.remote import RemoteMessageConsumer
from llama_agents.message_queues.base import BaseMessageQueue, PublishCallback
from llama_agents.messages.base import QueueMessage
from llama_agents.orchestrators.base import BaseOrchestrator
from llama_agents.orchestrators.service_tool import ServiceTool
from llama_agents.types import (
ActionTypes,
ServiceDefinition,
TaskDefinition,
Expand Down Expand Up @@ -294,7 +294,7 @@ async def get_all_tasks(self) -> Dict[str, TaskDefinition]:


if __name__ == "__main__":
from agentfile import SimpleMessageQueue, AgentOrchestrator
from llama_agents import SimpleMessageQueue, AgentOrchestrator
from llama_index.llms.openai import OpenAI

control_plane = ControlPlaneServer(
Expand Down
4 changes: 4 additions & 0 deletions llama_agents/launchers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from llama_agents.launchers.local import LocalLauncher
from llama_agents.launchers.server import ServerLauncher

__all__ = ["LocalLauncher", "ServerLauncher"]
16 changes: 8 additions & 8 deletions agentfile/launchers/local.py → llama_agents/launchers/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import uuid
from typing import Any, Callable, Dict, List, Optional

from agentfile.services.base import BaseService
from agentfile.control_plane.base import BaseControlPlane
from agentfile.message_consumers.base import BaseMessageQueueConsumer
from agentfile.message_queues.simple import SimpleMessageQueue
from agentfile.message_queues.base import PublishCallback
from agentfile.messages.base import QueueMessage
from agentfile.types import ActionTypes, TaskDefinition, TaskResult
from agentfile.message_publishers.publisher import MessageQueuePublisherMixin
from llama_agents.services.base import BaseService
from llama_agents.control_plane.base import BaseControlPlane
from llama_agents.message_consumers.base import BaseMessageQueueConsumer
from llama_agents.message_queues.simple import SimpleMessageQueue
from llama_agents.message_queues.base import PublishCallback
from llama_agents.messages.base import QueueMessage
from llama_agents.types import ActionTypes, TaskDefinition, TaskResult
from llama_agents.message_publishers.publisher import MessageQueuePublisherMixin


class HumanMessageConsumer(BaseMessageQueueConsumer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import uuid
from typing import Any, Callable, Dict, List, Optional

from agentfile.services.base import BaseService
from agentfile.control_plane.base import BaseControlPlane
from agentfile.message_consumers.base import BaseMessageQueueConsumer
from agentfile.message_queues.simple import SimpleMessageQueue
from agentfile.message_queues.base import PublishCallback
from agentfile.messages.base import QueueMessage
from agentfile.types import ActionTypes
from agentfile.message_publishers.publisher import MessageQueuePublisherMixin
from llama_agents.services.base import BaseService
from llama_agents.control_plane.base import BaseControlPlane
from llama_agents.message_consumers.base import BaseMessageQueueConsumer
from llama_agents.message_queues.simple import SimpleMessageQueue
from llama_agents.message_queues.base import PublishCallback
from llama_agents.messages.base import QueueMessage
from llama_agents.types import ActionTypes
from llama_agents.message_publishers.publisher import MessageQueuePublisherMixin


class HumanMessageConsumer(BaseMessageQueueConsumer):
Expand Down
4 changes: 4 additions & 0 deletions llama_agents/message_consumers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from llama_agents.message_consumers.base import BaseMessageQueueConsumer
from llama_agents.message_consumers.callable import CallableMessageConsumer

__all__ = ["BaseMessageQueueConsumer", "CallableMessageConsumer"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from pydantic import BaseModel, Field
from typing import Any, TYPE_CHECKING

from agentfile.messages.base import QueueMessage
from agentfile.types import generate_id
from llama_agents.messages.base import QueueMessage
from llama_agents.types import generate_id

if TYPE_CHECKING:
from agentfile.message_queues.base import BaseMessageQueue
from llama_agents.message_queues.base import BaseMessageQueue


class BaseMessageQueueConsumer(BaseModel, ABC):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Callable

from agentfile.messages.base import QueueMessage
from agentfile.message_consumers.base import BaseMessageQueueConsumer
from llama_agents.messages.base import QueueMessage
from llama_agents.message_consumers.base import BaseMessageQueueConsumer


class CallableMessageConsumer(BaseMessageQueueConsumer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from pydantic import BaseModel, Field
from typing import Any, Optional

from agentfile.message_consumers.base import BaseMessageQueueConsumer
from agentfile.messages import QueueMessage
from agentfile.types import generate_id
from llama_agents.message_consumers.base import BaseMessageQueueConsumer
from llama_agents.messages import QueueMessage
from llama_agents.types import generate_id


class RemoteMessageConsumerDef(BaseModel):
Expand Down
3 changes: 3 additions & 0 deletions llama_agents/message_publishers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from llama_agents.message_publishers.publisher import MessageQueuePublisherMixin

__all__ = ["MessageQueuePublisherMixin"]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from abc import ABC, abstractmethod
from typing import Any, Optional
from agentfile.messages.base import QueueMessage
from agentfile.message_queues.base import BaseMessageQueue, PublishCallback
from llama_agents.messages.base import QueueMessage
from llama_agents.message_queues.base import BaseMessageQueue, PublishCallback


class MessageQueuePublisherMixin(ABC):
Expand Down
4 changes: 4 additions & 0 deletions llama_agents/message_queues/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from llama_agents.message_queues.base import BaseMessageQueue
from llama_agents.message_queues.simple import SimpleMessageQueue

__all__ = ["BaseMessageQueue", "SimpleMessageQueue"]
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from pydantic import BaseModel
from typing import Any, List, Optional, Protocol, TYPE_CHECKING

from agentfile.messages.base import QueueMessage
from llama_agents.messages.base import QueueMessage

if TYPE_CHECKING:
from agentfile.message_consumers.base import BaseMessageQueueConsumer
from llama_agents.message_consumers.base import BaseMessageQueueConsumer

import logging

Expand Down
Loading

0 comments on commit e012077

Please sign in to comment.