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

fix identifying params #16

Merged
merged 2 commits into from
Apr 16, 2024
Merged

fix identifying params #16

merged 2 commits into from
Apr 16, 2024

Conversation

efriis
Copy link
Member

@efriis efriis commented Apr 16, 2024

Comment on lines 445 to 451
return {
**{"model_kwargs": _model_kwargs},
"model_id": self.model_id,
"provider": self._get_provider(),
"stream": self.streaming,
"guardrails": self.guardrails,
**_model_kwargs,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

With this change, would we need to call _get_provider in any of the other functions or can just use self.provider? For example:
https://github.com/langchain-ai/langchain-aws/blob/main/libs/aws/langchain_aws/llms/bedrock.py#L462

provider = self._get_provider()

Copy link
Member Author

Choose a reason for hiding this comment

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

I think fixed! This might have been a comment from before I changed self.provider to self._get_provider()

Copy link
Member Author

Choose a reason for hiding this comment

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

Also just calling out - this moves the model_kwargs into a flat structure of invocation params to match most other model providers. Let me know if that sounds good to you.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I misunderstood the question. Still need to use self._get_provider() everywhere because provider isn't always set.

Although Likely worth adding a root validator that populates that field based on model string.

Comment on lines +623 to 625
if k := self.provider_stop_sequence_key_name_map.get(provider):
_model_kwargs[k] = stop

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is great. Ty.

@efriis efriis merged commit 6042d9d into main Apr 16, 2024
12 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.

2 participants