docs: standard params (#23199)

This commit is contained in:
Bagatur 2024-06-19 17:57:05 -07:00 committed by GitHub
parent a4bcb45f65
commit bd5c92a113
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -144,8 +144,19 @@ LangChain does not host any Chat Models, rather we rely on third party integrati
We have some standardized parameters when constructing ChatModels: We have some standardized parameters when constructing ChatModels:
- `model`: the name of the model - `model`: the name of the model
- `temperature`: the sampling temperature
- `timeout`: request timeout
- `max_tokens`: max tokens to generate
- `stop`: default stop sequences
- `max_retries`: max number of times to retry requests
- `api_key`: API key for the model provider
- `base_url`: endpoint to send requests to
ChatModels also accept other parameters that are specific to that integration. Some important things to note:
- standard params only apply to model providers that expose parameters with the intended functionality. For example, some providers do not expose a configuration for maximum output tokens, so max_tokens can't be supported on these.
- standard params are currently only enforced on integrations that have their own integration packages (e.g. `langchain-openai`, `langchain-anthropic`, etc.), they're not enforced on models in ``langchain-community``.
ChatModels also accept other parameters that are specific to that integration. To find all the parameters supported by a ChatModel head to the API reference for that model.
:::important :::important
**Tool Calling** Some chat models have been fine-tuned for tool calling and provide a dedicated API for tool calling. **Tool Calling** Some chat models have been fine-tuned for tool calling and provide a dedicated API for tool calling.