From ff0d47bd3d5f5496d5026ab9b88f6a811b76c02e Mon Sep 17 00:00:00 2001 From: Kye Date: Wed, 30 Aug 2023 11:15:45 -0400 Subject: [PATCH] swarms.agents.models -> swarms.models --- DOCS/Tutorials/GettingStartedLLM.md | 2 +- DOCS/agents/MODELS.md | 8 ++++---- swarms/agents/utils/ConversationalChatAgent.py | 2 +- swarms/agents/utils/agent_setup.py | 2 +- swarms/agents/utils/output_parser.py | 2 +- swarms/memory/base_memory.py | 2 +- swarms/models/prompts/agent_prompt_auto.py | 2 +- swarms/tools/models.py | 2 +- swarms/utils/main.py | 2 +- tests/agents/models/LLM.py | 2 +- tests/agents/models/hf.py | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/DOCS/Tutorials/GettingStartedLLM.md b/DOCS/Tutorials/GettingStartedLLM.md index 3fc8a386..f0d06ef5 100644 --- a/DOCS/Tutorials/GettingStartedLLM.md +++ b/DOCS/Tutorials/GettingStartedLLM.md @@ -120,7 +120,7 @@ google_palm = GooglePalm()\ messages = [{"role": "system", "content": "You are a funny assistant"}, {"role": "user", "content": "Crack me a joke"}]\ response = google_palm.generate(messages) -4\. Anthropic (swarms.agents.models.Anthropic) +4\. Anthropic (swarms.models.Anthropic) ============================================== Anthropic's models, with their mysterious allure, are now at your fingertips. diff --git a/DOCS/agents/MODELS.md b/DOCS/agents/MODELS.md index a74f7d76..d2dce9cb 100644 --- a/DOCS/agents/MODELS.md +++ b/DOCS/agents/MODELS.md @@ -8,7 +8,7 @@ Welcome to the documentation for the llm section of the swarms package, designed 3. [Google PaLM](#google-palm) 4. [Anthropic](#anthropic) -### 1. OpenAI (swarms.agents.models.OpenAI) +### 1. OpenAI (swarms.models.OpenAI) The OpenAI class provides an interface to interact with OpenAI's language models. It allows both synchronous and asynchronous interactions. @@ -46,7 +46,7 @@ async_responses = asyncio.run(chat.ask_multiple(ids, "How is {id}?")) print(async_responses) ``` -### 2. HuggingFace (swarms.agents.models.HuggingFaceLLM) +### 2. HuggingFace (swarms.models.HuggingFaceLLM) The HuggingFaceLLM class allows interaction with language models from Hugging Face. @@ -77,7 +77,7 @@ generated_text = hugging_face_model.generate(prompt) print(generated_text) ``` -### 3. Google PaLM (swarms.agents.models.GooglePalm) +### 3. Google PaLM (swarms.models.GooglePalm) The GooglePalm class provides an interface for Google's PaLM Chat API. @@ -109,7 +109,7 @@ response = google_palm.generate(messages) print(response["choices"][0]["text"]) ``` -### 4. Anthropic (swarms.agents.models.Anthropic) +### 4. Anthropic (swarms.models.Anthropic) The Anthropic class enables interaction with Anthropic's large language models. diff --git a/swarms/agents/utils/ConversationalChatAgent.py b/swarms/agents/utils/ConversationalChatAgent.py index fe29101e..4873cfce 100644 --- a/swarms/agents/utils/ConversationalChatAgent.py +++ b/swarms/agents/utils/ConversationalChatAgent.py @@ -21,7 +21,7 @@ from langchain.schema import ( ) from langchain.tools.base import BaseTool -from swarms.agents.models.prompts.prebuild.multi_modal_prompts import EVAL_TOOL_RESPONSE +from swarms.models.prompts.prebuild.multi_modal_prompts import EVAL_TOOL_RESPONSE from swarms.agents.utils.Agent import Agent logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') diff --git a/swarms/agents/utils/agent_setup.py b/swarms/agents/utils/agent_setup.py index 2f0a7f2f..09e93c2a 100644 --- a/swarms/agents/utils/agent_setup.py +++ b/swarms/agents/utils/agent_setup.py @@ -7,7 +7,7 @@ from langchain.chat_models import ChatOpenAI from langchain.chat_models.base import BaseChatModel from langchain.schema import BaseOutputParser -from swarms.agents.models.prompts.prebuild.multi_modal_prompts import EVAL_PREFIX, EVAL_SUFFIX +from swarms.models.prompts.prebuild.multi_modal_prompts import EVAL_PREFIX, EVAL_SUFFIX from swarms.tools.main import BaseToolSet, ToolsFactory from .ConversationalChatAgent import ConversationalChatAgent diff --git a/swarms/agents/utils/output_parser.py b/swarms/agents/utils/output_parser.py index 9c4205e2..39f7169d 100644 --- a/swarms/agents/utils/output_parser.py +++ b/swarms/agents/utils/output_parser.py @@ -5,7 +5,7 @@ from typing import Dict, NamedTuple from langchain.schema import BaseOutputParser -from swarms.agents.models.prompts.prebuild.multi_modal_prompts import EVAL_FORMAT_INSTRUCTIONS +from swarms.models.prompts.prebuild.multi_modal_prompts import EVAL_FORMAT_INSTRUCTIONS class EvalOutputParser(BaseOutputParser): diff --git a/swarms/memory/base_memory.py b/swarms/memory/base_memory.py index 6a96697f..b2fe49d1 100644 --- a/swarms/memory/base_memory.py +++ b/swarms/memory/base_memory.py @@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, Tuple from langchain.memory.utils import get_prompt_input_key from pydantic import BaseModel, Field -from swarms.agents.models.prompts.base import AIMessage, BaseMessage, HumanMessage +from swarms.models.prompts.base import AIMessage, BaseMessage, HumanMessage from swarms.utils.serializable import Serializable diff --git a/swarms/models/prompts/agent_prompt_auto.py b/swarms/models/prompts/agent_prompt_auto.py index a75d0189..3a901e6b 100644 --- a/swarms/models/prompts/agent_prompt_auto.py +++ b/swarms/models/prompts/agent_prompt_auto.py @@ -1,6 +1,6 @@ import time from typing import Any, Callable, List -from swarms.agents.models.prompts.agent_prompt_generator import get_prompt +from swarms.models.prompts.agent_prompt_generator import get_prompt class TokenUtils: @staticmethod diff --git a/swarms/tools/models.py b/swarms/tools/models.py index b8d06d1d..7b99e1d2 100644 --- a/swarms/tools/models.py +++ b/swarms/tools/models.py @@ -18,7 +18,7 @@ from transformers import ( CLIPSegProcessor, ) -from swarms.agents.models.prompts.prebuild.multi_modal_prompts import IMAGE_PROMPT +from swarms.models.prompts.prebuild.multi_modal_prompts import IMAGE_PROMPT from swarms.tools.base import tool from swarms.tools.main import BaseToolSet from swarms.utils.logger import logger diff --git a/swarms/utils/main.py b/swarms/utils/main.py index 3f8ff0b6..29b0cf77 100644 --- a/swarms/utils/main.py +++ b/swarms/utils/main.py @@ -400,7 +400,7 @@ class FileHandler: #############===========================> -from swarms.agents.models.prompts.prebuild.multi_modal_prompts import DATAFRAME_PROMPT +from swarms.models.prompts.prebuild.multi_modal_prompts import DATAFRAME_PROMPT import pandas as pd class CsvToDataframe(BaseHandler): diff --git a/tests/agents/models/LLM.py b/tests/agents/models/LLM.py index 7e2d4ba5..d1476ea3 100644 --- a/tests/agents/models/LLM.py +++ b/tests/agents/models/LLM.py @@ -3,7 +3,7 @@ import os from unittest.mock import patch from langchain import HuggingFaceHub, ChatOpenAI -from swarms.agents.models.llm import LLM +from swarms.models.llm import LLM class TestLLM(unittest.TestCase): @patch.object(HuggingFaceHub, '__init__', return_value=None) diff --git a/tests/agents/models/hf.py b/tests/agents/models/hf.py index 010ce00d..0696482a 100644 --- a/tests/agents/models/hf.py +++ b/tests/agents/models/hf.py @@ -1,7 +1,7 @@ import pytest import torch from unittest.mock import Mock -from swarms.agents.models.huggingface import HuggingFaceLLM +from swarms.models.huggingface import HuggingFaceLLM @pytest.fixture