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:
Eugene Yurtsev
2024-09-11 11:13:11 -04:00
committed by GitHub
parent c417bbc313
commit 844955d6e1
83 changed files with 109 additions and 109 deletions

View File

@@ -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")