chore(community): update to OpenLLM 0.6 (#24609)

Update to OpenLLM 0.6, which we decides to make use of OpenLLM's
OpenAI-compatible endpoint. Thus, OpenLLM will now just become a thin
wrapper around OpenAI wrapper.

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

---------

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Co-authored-by: ccurme <chester.curme@gmail.com>
This commit is contained in:
Aaron Pham
2024-12-16 14:30:07 -05:00
committed by GitHub
parent 5c17a4ace9
commit 12fced13f4
5 changed files with 64 additions and 432 deletions

View File

@@ -1,17 +1,13 @@
"""Test OpenLLM wrapper."""
"""Test OpenLLM API wrapper."""
import pytest
from langchain_community.llms.openllm import OpenLLM
def test_openllm_llm_local() -> None:
llm = OpenLLM(model_name="flan-t5", model_id="google/flan-t5-small")
output = llm.invoke("Say foo:")
assert isinstance(output, str)
def test_openllm_with_kwargs() -> None:
llm = OpenLLM(
model_name="flan-t5", model_id="google/flan-t5-small", temperature=0.84
)
output = llm.invoke("Say bar:")
@pytest.mark.scheduled
def test_openai_call() -> None:
"""Test valid call to openai."""
llm = OpenLLM()
output = llm.invoke("Say something nice:")
assert isinstance(output, str)