You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/community/langchain_community/chat_models
Congyu dd5139e304
community[patch]: truncate zhipuai `temperature` and `top_p` parameters to [0.01, 0.99] (#20261)
ZhipuAI API only accepts `temperature` parameter between `(0, 1)` open
interval, and if `0` is passed, it responds with status code `400`.

However, 0 and 1 is often accepted by other APIs, for example, OpenAI
allows `[0, 2]` for temperature closed range.

This PR truncates temperature parameter passed to `[0.01, 0.99]` to
improve the compatibility between langchain's ecosystem's and ZhipuAI
(e.g., ragas `evaluate` often generates temperature 0, which results in
a lot of 400 invalid responses). The PR also truncates `top_p` parameter
since it has the same restriction.

Reference: [glm-4 doc](https://open.bigmodel.cn/dev/api#glm-4) (which
unfortunately is in Chinese though).

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
4 months ago
..
__init__.py community[minor]: add ChatOctoAI (#20059) 4 months ago
anthropic.py community[patch]: move pdf text tests to integration (#18746) 6 months ago
anyscale.py community[minor]: Add async_client for Anyscale Chat model (#18050) 6 months ago
azure_openai.py community[patch]: more deprecations (#15782) 8 months ago
azureml_endpoint.py community[patch]: Support Streaming in Azure Machine Learning (#18246) 5 months ago
baichuan.py community[patch]: standardize baichuan init args (#20209) 5 months ago
baidu_qianfan_endpoint.py community[patch]: standardize init args (#20166) 4 months ago
bedrock.py docs: aws docs updates (#20571) 4 months ago
cohere.py community[patch]: fix bug in cohere that `async for` a coroutine in ChatCohere (#19381) 5 months ago
dappier.py community[minor]: Dappier chat model integration (#19370) 5 months ago
databricks.py community[patch]: Make ChatDatabricks model supports streaming response (#19912) 4 months ago
deepinfra.py community[patch]: callback before yield for _stream/_astream (#17907) 6 months ago
edenai.py community[patch]: callback before yield for _stream/_astream (#17907) 6 months ago
ernie.py community[patch]: chat model mypy fixes (#17061) 7 months ago
everlyai.py Do not issue beta or deprecation warnings on internal calls (#15641) 8 months ago
fake.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 8 months ago
fireworks.py community[patch]: deprecate community fireworks (#18544) 6 months ago
friendli.py community[minor]: Integration for `Friendli` LLM and `ChatFriendli` ChatModel. (#17913) 6 months ago
gigachat.py community[minor]: Added GigaChat Embeddings support + updated previous GigaChat integration (#19516) 5 months ago
google_palm.py Refactor: use SecretStr for palm chat-model (#15100) 8 months ago
gpt_router.py community[patch]: callback before yield for _stream/_astream (#17907) 6 months ago
huggingface.py community[patch]: Add streaming logic in ChatHuggingFace (#18784) 4 months ago
human.py infra: add print rule to ruff (#16221) 6 months ago
hunyuan.py community[patch]: callback before yield for _stream/_astream (#17907) 6 months ago
javelin_ai_gateway.py community[patch]: chat model mypy fixes (#17061) 7 months ago
jinachat.py community[patch]: callback before yield for _stream/_astream (#17907) 6 months ago
kinetica.py community[patch]: type ignore fixes (#18395) 6 months ago
konko.py community: fix openai streaming throws 'AIMessageChunk' object has no attribute 'text' (#18006) 6 months ago
litellm.py community[patch]: docstrings update (#20301) 4 months ago
litellm_router.py community[patch]: callback before yield for _stream/_astream (#17907) 6 months ago
llama_edge.py community: fix openai streaming throws 'AIMessageChunk' object has no attribute 'text' (#18006) 6 months ago
maritalk.py community: Add model argument for maritalk models and better error handling (#19187) 5 months ago
meta.py docs: docstrings `langchain_community` update (#14889) 8 months ago
minimax.py community[patch]: docstrings update (#20301) 4 months ago
mlflow.py community[patch]: Make ChatDatabricks model supports streaming response (#19912) 4 months ago
mlflow_ai_gateway.py community[patch]: chat model mypy fixes (#17061) 7 months ago
mlx.py community[minor]: Add support for MLX models (chat & llm) (#18152) 5 months ago
moonshot.py community[patch]: docstrings update (#20301) 4 months ago
octoai.py community[minor]: add ChatOctoAI (#20059) 4 months ago
ollama.py community[patch]: Add "model" attribute to the payload sent to Ollama in `ChatOllama` (#20354) 4 months ago
openai.py docs: use standard openai params (#20160) 5 months ago
pai_eas_endpoint.py community[patch]: docstrings update (#20301) 4 months ago
perplexity.py community[patch]: Invoke callback prior to yielding token (#18449) 6 months ago
premai.py community[patch]: docstrings update (#20301) 4 months ago
promptlayer_openai.py docs: use standard openai params (#20160) 5 months ago
solar.py upstage: init package (#20574) 4 months ago
sparkllm.py community[patch]:sparkllm standardize init args (#20194) 4 months ago
tongyi.py community[patch]: Add function call support in Tongyi chat model. (#20119) 4 months ago
vertexai.py community[patch]: add missing chunk parameter for _stream/_astream (#17807) 6 months ago
volcengine_maas.py community[patch]: add stop parameter support to volcengine maas (#19052) 5 months ago
yandex.py community[patch]: docstrings update (#20301) 4 months ago
yuan2.py community[patch]: fix yuan2 chat model errors while invoke. (#19015) 5 months ago
zhipuai.py community[patch]: truncate zhipuai `temperature` and `top_p` parameters to [0.01, 0.99] (#20261) 4 months ago