langchain-ai / langchain-ibm

https://python.langchain.com/docs/integrations/providers/ibm
MIT License
10 stars 10 forks source link

feat: Add _agenerate implementation #12

Closed Wojciech-Rebisz closed 2 months ago

Wojciech-Rebisz commented 3 months ago

Native support for agenetate method:

Example of usage:

watsonxllm = WatsonxLLM(
    model_id=MODEL_ID,
    url="https://us-south.ml.cloud.ibm.com",
    project_id=WX_PROJECT_ID,
)
response = await watsonxllm.agenerate(
    ["What color sunflower is?", "What color turtle is?"]
)

Test results: Screenshot 2024-08-22 at 15 00 09

Unit tests: :white_check_mark: Linting: :white_check_mark: Format: :white_check_mark:

Wojciech-Rebisz commented 3 months ago

It works, but due to planned changes to the SDK, it may be affected by new behavior. Until then, I'm marking it as draft.

Wojciech-Rebisz commented 2 months ago

It looks like the SDK version 1.1.9 is not yet available on pypi. If it's already there, please update poetry.lock (can be done with simple poetry update command).