mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 21:43:44 +00:00
community[minor]: DeepInfra support for chat models (#16380)
Add deepinfra chat models support. This is https://github.com/langchain-ai/langchain/pull/14234 re-opened from my branch (so maintainers can edit).
This commit is contained in:
committed by
GitHub
parent
eac91b60c9
commit
fc196cab12
@@ -5,13 +5,13 @@ from langchain_community.llms.deepinfra import DeepInfra
|
||||
def test_deepinfra_call() -> None:
|
||||
"""Test valid call to DeepInfra."""
|
||||
llm = DeepInfra(model_id="meta-llama/Llama-2-7b-chat-hf")
|
||||
output = llm("What is 2 + 2?")
|
||||
output = llm.invoke("What is 2 + 2?")
|
||||
assert isinstance(output, str)
|
||||
|
||||
|
||||
async def test_deepinfra_acall() -> None:
|
||||
llm = DeepInfra(model_id="meta-llama/Llama-2-7b-chat-hf")
|
||||
output = await llm.apredict("What is 2 + 2?")
|
||||
output = await llm.ainvoke("What is 2 + 2?")
|
||||
assert llm._llm_type == "deepinfra"
|
||||
assert isinstance(output, str)
|
||||
|
||||
|
Reference in New Issue
Block a user