Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dewmal committed Aug 21, 2024
1 parent 9a57d0a commit e8a3627
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from loguru import logger

from ceylon.task import Task
from ceylon.llm import LLMTaskAgent, LLMTaskManager


class QueryInput(BaseModel):
Expand Down
12 changes: 9 additions & 3 deletions bindings/ceylon/tests/tasks/article-writer-agents.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from langchain_community.chat_models import ChatOllama
from langchain_openai import ChatOpenAI

from ceylon.task import Task, SubTask
from ceylon.llm import LLMTaskOperator,LLMTaskCoordinator
from ceylon.llm import LLMTaskOperator, LLMTaskCoordinator

# Example usage
if __name__ == "__main__":
Expand All @@ -26,7 +27,11 @@
article_task
]

llm = ChatOllama(model="llama3.1:latest", temperature=0)
llm = ChatOpenAI(
base_url='http://localhost:11434/v1',
api_key='ollama', # required, but unused
model_name='llama3.1:latest'
)

# Create specialized agents
agents = [
Expand Down Expand Up @@ -63,7 +68,8 @@
)
]

task_manager = LLMTaskCoordinator(tasks, agents, llm=llm)
task_manager = LLMTaskCoordinator(tasks, agents, llm=llm, context="You team is working to write an article",
team_goal="Write quickly and accurately")
tasks = task_manager.do(inputs=b"")

for t in tasks:
Expand Down

0 comments on commit e8a3627

Please sign in to comment.