From d89c940bd397a3e50442962b5a0c2c71b7232e63 Mon Sep 17 00:00:00 2001 From: Kye Date: Sat, 14 Oct 2023 00:15:16 -0400 Subject: [PATCH] openai usage llms models --- README.md | 6 +++--- apps/discord.py | 2 +- apps/omni_ui.py | 2 +- example.py | 6 +++--- playground/agents/meta_prompter.py | 2 +- playground/agents/omnimodal_agent_example.py | 2 +- playground/structs/workflow.py | 2 +- playground/swarms/dialogue_simulator.py | 2 +- playground/swarms/groupchat.py | 2 +- playground/swarms/multi_agent_debate.py | 2 +- pyproject.toml | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b21a9e8d..119dd644 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ We have a small gallery of examples to run here, [for more check out the docs to ```python from swarms.workers import Worker from swarms.swarms import MultiAgentDebate, select_speaker -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat llm = OpenAIChat( model_name='gpt-4', @@ -107,7 +107,7 @@ for result in results: - And, then place the openai api key in the Worker for the openai embedding model ```python -from langchain.llms import ChatOpenAI +from swarms.models import ChatOpenAI from swarms.workers import Worker llm = ChatOpenAI( @@ -139,7 +139,7 @@ print(response) - OmniModal Agent is an LLM that access to 10+ multi-modal encoders and diffusers! It can generate images, videos, speech, music and so much more, get started with: ```python -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat from swarms.agents import OmniModalAgent diff --git a/apps/discord.py b/apps/discord.py index 84f0cace..734ea4dc 100644 --- a/apps/discord.py +++ b/apps/discord.py @@ -1,5 +1,5 @@ from discord.ext import commands -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat from swarms.agents import OmniModalAgent # Setup diff --git a/apps/omni_ui.py b/apps/omni_ui.py index 73613ed5..84aed930 100644 --- a/apps/omni_ui.py +++ b/apps/omni_ui.py @@ -4,7 +4,7 @@ import threading import os import glob import base64 -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat from swarms.agents import OmniModalAgent diff --git a/example.py b/example.py index cb72330b..e34943cc 100644 --- a/example.py +++ b/example.py @@ -1,15 +1,15 @@ -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat from swarms import Worker llm = OpenAIChat( - openai_api_key="", + openai_api_key="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", temperature=0.5, ) node = Worker( llm=llm, ai_name="Optimus Prime", - openai_api_key="", + openai_api_key="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", ai_role="Worker in a swarm", external_tools=None, human_in_the_loop=False, diff --git a/playground/agents/meta_prompter.py b/playground/agents/meta_prompter.py index c517acb1..fb5e622a 100644 --- a/playground/agents/meta_prompter.py +++ b/playground/agents/meta_prompter.py @@ -1,6 +1,6 @@ from swarms.workers import Worker from swarms.agents.meta_prompter import MetaPrompterAgent -from langchain.llms import OpenAI +from swarms.models import OpenAI # init llm llm = OpenAI() diff --git a/playground/agents/omnimodal_agent_example.py b/playground/agents/omnimodal_agent_example.py index a9ab0995..50dd2896 100644 --- a/playground/agents/omnimodal_agent_example.py +++ b/playground/agents/omnimodal_agent_example.py @@ -1,4 +1,4 @@ -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat from swarms.agents import OmniModalAgent diff --git a/playground/structs/workflow.py b/playground/structs/workflow.py index df226bc0..d77079b0 100644 --- a/playground/structs/workflow.py +++ b/playground/structs/workflow.py @@ -1,5 +1,5 @@ from swarms.structs.workflow import Workflow, StringTask -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat llm = OpenAIChat() diff --git a/playground/swarms/dialogue_simulator.py b/playground/swarms/dialogue_simulator.py index 755c502e..76f31f65 100644 --- a/playground/swarms/dialogue_simulator.py +++ b/playground/swarms/dialogue_simulator.py @@ -1,6 +1,6 @@ from swarms.swarms import DialogueSimulator from swarms.workers.worker import Worker -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat llm = OpenAIChat(model_name="gpt-4", openai_api_key="api-key", temperature=0.5) diff --git a/playground/swarms/groupchat.py b/playground/swarms/groupchat.py index 2af37d93..a5e8dd0d 100644 --- a/playground/swarms/groupchat.py +++ b/playground/swarms/groupchat.py @@ -1,4 +1,4 @@ -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat from swarms.swarms import GroupChat, GroupChatManager from swarms.workers import Worker diff --git a/playground/swarms/multi_agent_debate.py b/playground/swarms/multi_agent_debate.py index 11c5a28d..f0bec797 100644 --- a/playground/swarms/multi_agent_debate.py +++ b/playground/swarms/multi_agent_debate.py @@ -1,6 +1,6 @@ from swarms.swarms.multi_agent_debate import MultiAgentDebate, select_speaker from swarms.workers.worker import Worker -from langchain.llms import OpenAIChat +from swarms.models import OpenAIChat llm = OpenAIChat() diff --git a/pyproject.toml b/pyproject.toml index 272aa44b..f0e0f866 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "1.7.9" +version = "1.8.0" description = "Swarms - Pytorch" license = "MIT" authors = ["Kye Gomez "]