mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +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)`
15 lines
388 B
Python
15 lines
388 B
Python
"""Test WatsonxLLM API wrapper."""
|
|
|
|
from langchain_community.llms import WatsonxLLM
|
|
|
|
|
|
def test_watsonxllm_call() -> None:
|
|
watsonxllm = WatsonxLLM(
|
|
model_id="google/flan-ul2",
|
|
url="https://us-south.ml.cloud.ibm.com",
|
|
apikey="***",
|
|
project_id="***",
|
|
)
|
|
response = watsonxllm.invoke("What color sunflower is?")
|
|
assert isinstance(response, str)
|