From 1608cbdc23f8a10fa4bc5e37c94073f622a73695 Mon Sep 17 00:00:00 2001 From: Kye Date: Tue, 22 Aug 2023 07:51:35 -0400 Subject: [PATCH] readme Former-commit-id: 9e18aafbac2f6aaadb2c591e1236c2138c2452bc --- README.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 52493d4d..a797a6c9 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,17 @@ There are 2 methods, one is through `git clone` and the other is by `pip install ```python -from swarms import swarm +from swarms import Worker -objective = "What is the capital of the Uk" -swarm(objective) +node = Worker( + openai_api_key="", + ai_name="Optimus Prime", +) + +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." +response = node.run(task) +print(response) ``` --- @@ -56,6 +62,21 @@ from swarms import HuggingFaceLLM hugging_face_model = HuggingFaceLLM(model_id="Voicelab/trurl-2-13b") generated_text = hugging_face_model.generate("In a world where AI") +``` +```python + +from swarms import Worker + + +node = Worker( + openai_api_key="", + ai_name="Optimus Prime", +) + +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." +response = node.run(task) +print(response) + ``` ---