mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-07 22:11:51 +00:00
core[patch]: fix beta, deprecated typing (#18877)
**Description:** While not technically incorrect, the TypeVar used for the `@beta` decorator prevented pyright (and thus most vscode users) from correctly seeing the types of functions/classes decorated with `@beta`. This is in part due to a small bug in pyright (https://github.com/microsoft/pyright/issues/7448 ) - however, the `Type` bound in the typevar `C = TypeVar("C", Type, Callable)` is not doing anything - classes are `Callables` by default, so by my understanding binding to `Type` does not actually provide any more safety - the modified annotation still works correctly for both functions, properties, and classes. --------- Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
@@ -23,7 +23,9 @@ def _fake_runnable(
|
||||
class FakeStructuredChatModel(FakeListChatModel):
|
||||
"""Fake ChatModel for testing purposes."""
|
||||
|
||||
def with_structured_output(self, schema: Union[Dict, Type[BaseModel]]) -> Runnable:
|
||||
def with_structured_output(
|
||||
self, schema: Union[Dict, Type[BaseModel]], **kwargs: Any
|
||||
) -> Runnable:
|
||||
return RunnableLambda(partial(_fake_runnable, schema))
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user