mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-28 15:00:23 +00:00
community[patch]: assign missed default (#26326)
Assigning missed defaults in various classes. Most clients were being assigned during the `model_validator(mode="before")` step, so this change should amount to a no-op in those cases. --- This PR was autogenerated using gritql ```shell grit apply 'class_definition(name=$C, $body, superclasses=$S) where { $C <: ! "Config", // Does not work in this scope, but works after class_definition $body <: block($statements), $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where { or { $y <: `Field($z)`, $x <: "model_config" } }, // And has either Any or Optional fields without a default $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where { $t <: or { r"Optional.*", r"Any", r"Union[None, .*]", r"Union[.*, None, .*]", r"Union[.*, None]", }, $y <: ., // Match empty node $t => `$t = None`, }, } ' --language python . ```
This commit is contained in:
@@ -19,7 +19,7 @@ class LlamaCppEmbeddings(BaseModel, Embeddings):
|
||||
llama = LlamaCppEmbeddings(model_path="/path/to/model.bin")
|
||||
"""
|
||||
|
||||
client: Any #: :meta private:
|
||||
client: Any = None #: :meta private:
|
||||
model_path: str
|
||||
|
||||
n_ctx: int = Field(512, alias="n_ctx")
|
||||
|
Reference in New Issue
Block a user