langchain/libs/community/tests/integration_tests/chat_models
shroominic dee72c46c1
community: Outlines integration (#27449)
In collaboration with @rlouf I build an
[outlines](https://dottxt-ai.github.io/outlines/latest/) integration for
langchain!

I think this is really useful for doing any type of structured output
locally.
[Dottxt](https://dottxt.co) spend alot of work optimising this process
at a lower level
([outlines-core](https://pypi.org/project/outlines-core/0.1.14/) written
in rust) so I think this is a better alternative over all current
approaches in langchain to do structured output.
It also implements the `.with_structured_output` method so it should be
a drop in replacement for a lot of applications.

The integration includes:
- **Outlines LLM class**
- **ChatOutlines class**
- **Tutorial Cookbooks**
- **Documentation Page**
- **Validation and error messages** 
- **Exposes Outlines Structured output features**
- **Support for multiple backends**
- **Integration and Unit Tests**

Dependencies: `outlines` + additional (depending on backend used)

I am not sure if the unit-tests comply with all requirements, if not I
suggest to just remove them since I don't see a useful way to do it
differently.

### Quick overview:

Chat Models:
<img width="698" alt="image"
src="https://github.com/user-attachments/assets/05a499b9-858c-4397-a9ff-165c2b3e7acc">

Structured Output:
<img width="955" alt="image"
src="https://github.com/user-attachments/assets/b9fcac11-d3e5-4698-b1ae-8c4cb3d54c45">

---------

Co-authored-by: Vadym Barda <vadym@langchain.dev>
2024-11-20 16:31:31 -05:00
..
cassettes community[minor]: add Kinetica LLM wrapper (#17879) 2024-02-22 16:02:00 -08:00
__init__.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_anthropic.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_azure_openai.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_azureml_endpoint.py community[patch]: Support Streaming in Azure Machine Learning (#18246) 2024-03-28 23:38:20 +00:00
test_baichuan.py community[patch]: Improve ChatBaichuan init args and role (#23878) 2024-07-15 15:17:00 -04:00
test_baiduqianfan.py community: Improve QianfanChatEndpoint tool result to model (#24466) 2024-07-22 11:29:00 -04:00
test_bedrock.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_coze.py community[patch]: upgrade to recent version of mypy (#21616) 2024-05-13 14:55:07 -04:00
test_dappier.py community[patch]: upgrade to recent version of mypy (#21616) 2024-05-13 14:55:07 -04:00
test_deepinfra.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
test_edenai.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_ernie.py patch: remove usage of llm, chat model __call__ (#20788) 2024-04-24 19:39:23 -04:00
test_fireworks.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_friendli.py patch: remove usage of llm, chat model __call__ (#20788) 2024-04-24 19:39:23 -04:00
test_google_palm.py community[patch]: upgrade to recent version of mypy (#21616) 2024-05-13 14:55:07 -04:00
test_gpt_router.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
test_hunyuan.py Feature/update hunyuan (#25779) 2024-09-02 12:55:08 +00:00
test_javelin_ai_gateway.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
test_jinachat.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
test_kinetica.py community[patch]: upgrade to recent version of mypy (#21616) 2024-05-13 14:55:07 -04:00
test_konko.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
test_litellm_router.py multiple: rely on asyncio_mode auto in tests (#27200) 2024-10-15 16:26:38 +00:00
test_litellm_standard.py standard-tests: rename langchain_standard_tests to langchain_tests, release 0.3.2 (#28203) 2024-11-18 19:10:39 -08:00
test_litellm.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_llama_edge.py patch: remove usage of llm, chat model __call__ (#20788) 2024-04-24 19:39:23 -04:00
test_llamacpp.py community[patch]: fix structured_output in llamacpp integration (#27202) 2024-10-08 15:16:59 -04:00
test_minimax.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
test_moonshot.py standard-tests: rename langchain_standard_tests to langchain_tests, release 0.3.2 (#28203) 2024-11-18 19:10:39 -08:00
test_naver.py community: Add Naver chat model & embeddings (#25162) 2024-10-24 20:54:13 +00:00
test_octoai.py patch: remove usage of llm, chat model __call__ (#20788) 2024-04-24 19:39:23 -04:00
test_openai.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
test_outlines.py community: Outlines integration (#27449) 2024-11-20 16:31:31 -05:00
test_pai_eas_chat_endpoint.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_premai.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_promptlayer_openai.py community[patch]: upgrade to recent version of mypy (#21616) 2024-05-13 14:55:07 -04:00
test_qianfan_endpoint.py multiple: rely on asyncio_mode auto in tests (#27200) 2024-10-15 16:26:38 +00:00
test_reka.py community: add reka chat model integration (#27379) 2024-11-15 13:37:14 -05:00
test_sambanova.py community: sambastudio chat model (#27056) 2024-10-07 14:31:39 -04:00
test_snowflake.py community[minor]: add ChatSnowflakeCortex chat model (#21490) 2024-06-17 09:47:05 -07:00
test_sparkllm.py community(sparkllm): Add function call support in Sparkllm chat model. (#20607) 2024-08-29 14:38:39 +00:00
test_tongyi.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
test_vertexai.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_volcengine_maas.py community[patch]: upgrade to recent version of mypy (#21616) 2024-05-13 14:55:07 -04:00
test_yuan2.py multiple: rely on asyncio_mode auto in tests (#27200) 2024-10-15 16:26:38 +00:00
test_zhipuai.py Improvement[Community] Add tool-calling test case for ChatZhipuAI (#25884) 2024-08-30 12:05:43 -04:00
text_mlx.py community[minor]: Add support for MLX models (chat & llm) (#18152) 2024-04-09 14:17:07 +00:00