Home / Function/ _default_params() — langchain Function Reference

_default_params() — langchain Function Reference

Architecture documentation for the _default_params() function in huggingface_endpoint.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  8e24ce72_41ef_c5c2_c345_4569d6774bb0["_default_params()"]
  e6b830e0_e492_47f6_6d0a_65d69c36da10["HuggingFaceEndpoint"]
  8e24ce72_41ef_c5c2_c345_4569d6774bb0 -->|defined in| e6b830e0_e492_47f6_6d0a_65d69c36da10
  style 8e24ce72_41ef_c5c2_c345_4569d6774bb0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/huggingface/langchain_huggingface/llms/huggingface_endpoint.py lines 283–299

    def _default_params(self) -> dict[str, Any]:
        """Get the default parameters for calling text generation inference API."""
        return {
            "max_new_tokens": self.max_new_tokens,
            "top_k": self.top_k,
            "top_p": self.top_p,
            "typical_p": self.typical_p,
            "temperature": self.temperature,
            "repetition_penalty": self.repetition_penalty,
            "return_full_text": self.return_full_text,
            "truncate": self.truncate,
            "stop": self.stop_sequences,
            "seed": self.seed,
            "do_sample": self.do_sample,
            "watermark": self.watermark,
            **self.model_kwargs,
        }

Domain

Subdomains

Frequently Asked Questions

What does _default_params() do?
_default_params() is a function in the langchain codebase, defined in libs/partners/huggingface/langchain_huggingface/llms/huggingface_endpoint.py.
Where is _default_params() defined?
_default_params() is defined in libs/partners/huggingface/langchain_huggingface/llms/huggingface_endpoint.py at line 283.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free