mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-25 20:43:23 +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 | ||
konko.py | ||
test_anthropic.py | ||
test_azureml_endpoint.py | ||
test_azureopenai.py | ||
test_baichuan.py | ||
test_bedrock.py | ||
test_cloudflare_workersai.py | ||
test_dappier.py | ||
test_deepinfra.py | ||
test_edenai.py | ||
test_ernie.py | ||
test_fireworks.py | ||
test_friendli.py | ||
test_google_palm.py | ||
test_huggingface.py | ||
test_hunyuan.py | ||
test_imports.py | ||
test_kinetica.py | ||
test_litellm.py | ||
test_llama_edge.py | ||
test_mlflow.py | ||
test_mlx.py | ||
test_naver.py | ||
test_oci_data_science.py | ||
test_oci_generative_ai.py | ||
test_oci_model_deployment_endpoint.py | ||
test_octoai.py | ||
test_ollama.py | ||
test_openai.py | ||
test_outlines.py | ||
test_perplexity.py | ||
test_premai.py | ||
test_reka.py | ||
test_snowflake.py | ||
test_sparkllm.py | ||
test_tongyi.py | ||
test_writer.py | ||
test_yandex.py | ||
test_yuan2.py | ||
test_zhipuai.py |