Former-commit-id: d44f097563acc29a705ed6888829dad488e96b0f
pull/160/head
Kye 1 year ago
parent cca58acf3e
commit 71fe56159c

@ -53,6 +53,7 @@ class LLM:
raise raise
# example # example
from swarms.utils.llm import LLM
llm_instance = LLM(openai_api_key="your_openai_key") llm_instance = LLM(openai_api_key="your_openai_key")
result = llm_instance.run("Who won the FIFA World Cup in 1998?") result = llm_instance.run("Who won the FIFA World Cup in 1998?")
print(result) print(result)

@ -3,7 +3,7 @@ import os
from unittest.mock import patch, MagicMock from unittest.mock import patch, MagicMock
from langchain import PromptTemplate, HuggingFaceHub, ChatOpenAI, LLMChain from langchain import PromptTemplate, HuggingFaceHub, ChatOpenAI, LLMChain
from swarms.utils.LLM import LLM from swarms.utils.llm import LLM
class TestLLM(unittest.TestCase): class TestLLM(unittest.TestCase):
@patch.object(HuggingFaceHub, '__init__', return_value=None) @patch.object(HuggingFaceHub, '__init__', return_value=None)

Loading…
Cancel
Save