Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch: Added support for passing params as keyword arg #38

Merged
merged 9 commits into from
Nov 13, 2024

Conversation

MateuszOssGit
Copy link
Collaborator

Added support for passing params as keyword arg

  • init:
chat = ChatWatsonx(
    model_id=MODEL_ID_TOOL,
    url=URL,
    project_id=WX_PROJECT_ID,
    max_tokens=10
)
  • method:
resp_1 = chat.invoke(prompt_1, max_tokens=10)

libs/ibm/langchain_ibm/utils.py Show resolved Hide resolved
if v is not None
}
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow reuse here _update_params function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it can not be reused. Here we are updating the default parameters, but in _update_params function (renamed to _merge_params ) we are only merge it without adding it to default params.

@MateuszOssGit
Copy link
Collaborator Author

Integration test passing successfully -> https://github.com/langchain-ai/langchain-ibm/actions/runs/11741957098

Copy link
Collaborator

@Mateusz-Switala Mateusz-Switala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MateuszOssGit MateuszOssGit merged commit 9b5b9dd into main Nov 13, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants