mirror of
https://github.com/hwchase17/langchain
synced 2024-11-16 06:13:16 +00:00
481d3855dc
- `llm(prompt)` -> `llm.invoke(prompt)` - `llm(prompt=prompt` -> `llm.invoke(prompt)` (same with `messages=`) - `llm(prompt, callbacks=callbacks)` -> `llm.invoke(prompt, config={"callbacks": callbacks})` - `llm(prompt, **kwargs)` -> `llm.invoke(prompt, **kwargs)`
14 lines
403 B
Python
14 lines
403 B
Python
"""Test Baseten API wrapper."""
|
|
import os
|
|
|
|
from langchain_community.llms.baseten import Baseten
|
|
|
|
# This test requires valid BASETEN_MODEL_ID and BASETEN_API_KEY environment variables
|
|
|
|
|
|
def test_baseten_call() -> None:
|
|
"""Test valid call to Baseten."""
|
|
llm = Baseten(model=os.environ["BASETEN_MODEL_ID"])
|
|
output = llm.invoke("Test prompt, please respond.")
|
|
assert isinstance(output, str)
|