From e8a3627fe5a62c42b4b535d3064b7763547d4d67 Mon Sep 17 00:00:00 2001 From: dewmal Date: Wed, 21 Aug 2024 17:16:58 +0530 Subject: [PATCH] Update examples --- .../article-writer-agents-gen-with-tools-openai.py | 1 - bindings/ceylon/tests/tasks/article-writer-agents.py | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bindings/ceylon/tests/tasks/article-writer-agents-gen-with-tools-openai.py b/bindings/ceylon/tests/tasks/article-writer-agents-gen-with-tools-openai.py index f92cb8f..f8a56ed 100644 --- a/bindings/ceylon/tests/tasks/article-writer-agents-gen-with-tools-openai.py +++ b/bindings/ceylon/tests/tasks/article-writer-agents-gen-with-tools-openai.py @@ -10,7 +10,6 @@ from loguru import logger from ceylon.task import Task -from ceylon.llm import LLMTaskAgent, LLMTaskManager class QueryInput(BaseModel): diff --git a/bindings/ceylon/tests/tasks/article-writer-agents.py b/bindings/ceylon/tests/tasks/article-writer-agents.py index 82c54c5..8123001 100644 --- a/bindings/ceylon/tests/tasks/article-writer-agents.py +++ b/bindings/ceylon/tests/tasks/article-writer-agents.py @@ -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__": @@ -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 = [ @@ -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: