fix: Refactor open ai api

Former-commit-id: ff72f3416fb605f612b4b929f7afde1e2a0cc16e
pull/133/head
Zack 2 years ago
parent 43c56acd4d
commit 20021f712a

@ -12,7 +12,7 @@ api_key = os.environ.get("OPENAI_API_KEY")
# Initialize the language model, this model can be swapped out with Anthropic, ETC, Huggingface Models like Mistral, ETC
llm = OpenAI(
# model_name="gpt-4"
# openai_api_key=api_key,
openai_api_key=api_key,
temperature=0.5,
# max_tokens=100,
)
@ -23,7 +23,7 @@ flow = Flow(
llm=llm,
max_loops=2,
dashboard=True,
# tools=[search_api]
# tools = [search_api, slack, ]
# stopping_condition=None, # You can define a stopping condition as needed.
# loop_interval=1,
# retry_attempts=3,

@ -5,15 +5,15 @@ import sys
# LLMs
from swarms.models.anthropic import Anthropic # noqa: E402
from swarms.models.petals import Petals # noqa: E402
from swarms.models.mistral import Mistral # noqa: E402
from swarms.models.openai_models import OpenAI, AzureOpenAI, OpenAIChat # noqa: E402
from swarms.models.zephyr import Zephyr # noqa: E402
from swarms.models.biogpt import BioGPT # noqa: E402
from swarms.models.huggingface import HuggingfaceLLM # noqa: E402
from swarms.models.wizard_storytelling import WizardLLMStoryTeller # noqa: E402
from swarms.models.mpt import MPT7B # noqa: E402
from swarms.models.anthropic import Anthropic
from swarms.models.petals import Petals
from swarms.models.mistral import Mistral
from swarms.models.openai_models import OpenAIChat, AzureOpenAI, OpenAI
from swarms.models.zephyr import Zephyr
from swarms.models.biogpt import BioGPT
from swarms.models.huggingface import HuggingfaceLLM
from swarms.models.wizard_storytelling import WizardLLMStoryTeller
from swarms.models.mpt import MPT7B
# MultiModal Models
from swarms.models.idefics import Idefics # noqa: E402

@ -1,5 +1,6 @@
from __future__ import annotations
"""OpenAI chat wrapper."""
import logging
import os
import sys

Loading…
Cancel
Save