mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-31 10:23:18 +00:00
community: Update Replicate LLM and fix tests (#27655)
**Description:** - Fix bug in Replicate LLM class, where it was looking for parameter names in a place where they no longer exist in pydantic 2, resulting in the "Field required" validation error described in the issue. - Fix Replicate LLM integration tests to: - Use active models on Replicate. - Use the correct model parameter `max_new_tokens` as shown in the [Replicate docs](https://replicate.com/docs/guides/language-models/how-to-use#minimum-and-maximum-new-tokens). - Use callbacks instead of deprecated callback_manager. **Issue:** #26937 **Dependencies:** n/a **Twitter handle:** n/a --------- Signed-off-by: Fayvor Love <fayvor@gmail.com> Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
@@ -78,7 +78,7 @@ class Replicate(LLM):
|
||||
@classmethod
|
||||
def build_extra(cls, values: Dict[str, Any]) -> Any:
|
||||
"""Build extra kwargs from additional params that were passed in."""
|
||||
all_required_field_names = {field.alias for field in get_fields(cls).values()}
|
||||
all_required_field_names = {field for field in get_fields(cls).keys()}
|
||||
|
||||
input = values.pop("input", {})
|
||||
if input:
|
||||
|
Reference in New Issue
Block a user