mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-23 03:22:38 +00:00
This pull request includes enhancements to the `perplexity.py` file in the `chat_models` module, focusing on improving the handling of additional keyword arguments (`additional_kwargs`) in message processing methods. Additionally, new unit tests have been added to ensure the correct inclusion of citations, images, and related questions in the `additional_kwargs`. Issue: resolves https://github.com/langchain-ai/langchain/issues/30439 Enhancements to `perplexity.py`: * [`libs/community/langchain_community/chat_models/perplexity.py`](diffhunk://#diff-d3e4d7b277608683913b53dcfdbd006f0f4a94d110d8b9ac7acf855f1f22207fL208-L212): Modified the `_convert_delta_to_message_chunk`, `_stream`, and `_generate` methods to handle `additional_kwargs`, which include citations, images, and related questions. [[1]](diffhunk://#diff-d3e4d7b277608683913b53dcfdbd006f0f4a94d110d8b9ac7acf855f1f22207fL208-L212) [[2]](diffhunk://#diff-d3e4d7b277608683913b53dcfdbd006f0f4a94d110d8b9ac7acf855f1f22207fL277-L286) [[3]](diffhunk://#diff-d3e4d7b277608683913b53dcfdbd006f0f4a94d110d8b9ac7acf855f1f22207fR324-R331) New unit tests: * [`libs/community/tests/unit_tests/chat_models/test_perplexity.py`](diffhunk://#diff-dab956d79bd7d17a0f5dea3f38ceab0d583b43b63eb1b29138ee9b6b271ba1d9R119-R275): Added new tests `test_perplexity_stream_includes_citations_and_images` and `test_perplexity_stream_includes_citations_and_related_questions` to verify that the `stream` method correctly includes citations, images, and related questions in the `additional_kwargs`. |
||
---|---|---|
.. | ||
__init__.py | ||
anthropic.py | ||
anyscale.py | ||
azure_openai.py | ||
azureml_endpoint.py | ||
baichuan.py | ||
baidu_qianfan_endpoint.py | ||
bedrock.py | ||
cloudflare_workersai.py | ||
cohere.py | ||
coze.py | ||
dappier.py | ||
databricks.py | ||
deepinfra.py | ||
edenai.py | ||
ernie.py | ||
everlyai.py | ||
fake.py | ||
fireworks.py | ||
friendli.py | ||
gigachat.py | ||
google_palm.py | ||
gpt_router.py | ||
huggingface.py | ||
human.py | ||
hunyuan.py | ||
javelin_ai_gateway.py | ||
jinachat.py | ||
kinetica.py | ||
konko.py | ||
litellm_router.py | ||
litellm.py | ||
llama_edge.py | ||
llamacpp.py | ||
maritalk.py | ||
meta.py | ||
minimax.py | ||
mlflow_ai_gateway.py | ||
mlflow.py | ||
mlx.py | ||
moonshot.py | ||
naver.py | ||
oci_data_science.py | ||
oci_generative_ai.py | ||
octoai.py | ||
ollama.py | ||
openai.py | ||
outlines.py | ||
pai_eas_endpoint.py | ||
perplexity.py | ||
premai.py | ||
promptlayer_openai.py | ||
reka.py | ||
sambanova.py | ||
snowflake.py | ||
solar.py | ||
sparkllm.py | ||
symblai_nebula.py | ||
tongyi.py | ||
vertexai.py | ||
volcengine_maas.py | ||
writer.py | ||
yandex.py | ||
yi.py | ||
yuan2.py | ||
zhipuai.py |