langchain/libs/community/tests/unit_tests
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
..
agent_toolkits community[patch]: Fix requests alias for load_tools (#23734) 2024-07-01 15:02:14 -07:00
agents multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
callbacks core[patch]: Fix "argument of type 'NoneType' is not iterable" error in LangChainTracer (#26576) 2024-09-17 10:29:46 -07:00
chains multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
chat_loaders infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
chat_message_histories community[patch]: restore compatibility with SQLAlchemy 1.x (#22546) 2024-06-19 17:58:57 +00:00
chat_models community: Outlines integration (#27449) 2024-11-20 16:31:31 -05:00
cross_encoders community[patch]: cross_encoders flatten namespaces (#20183) 2024-04-08 20:50:23 -04:00
data community: Resolve refs recursively when generating openai_fn from OpenAPI spec (#19002) 2024-09-02 13:17:39 -07:00
docstore infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
document_compressors community: add InfinityRerank (#27043) 2024-11-06 17:26:30 -08:00
document_loaders community: add AzureOpenAIWhisperParser (#27796) 2024-10-31 12:37:41 -04:00
document_transformers infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
embeddings community: Add Naver chat model & embeddings (#25162) 2024-10-24 20:54:13 +00:00
evaluation infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
examples community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
graph_vectorstores community: Cassandra Vector Store: modernize implementation (#27253) 2024-10-22 18:11:11 +00:00
graphs community[minor]: add graph store implementation for apache age (#20582) 2024-04-20 14:31:04 -07:00
imports community[minor]: Adds a vector store for Azure Cosmos DB for NoSQL (#21676) 2024-06-11 10:34:01 -07:00
indexes community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
llms community: Outlines integration (#27449) 2024-11-20 16:31:31 -05:00
load multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
query_constructors add neo4j query constructor for self query (#25288) 2024-08-30 14:54:33 +00:00
retrievers multiple: rely on asyncio_mode auto in tests (#27200) 2024-10-15 16:26:38 +00:00
storage infra: add min version testing to pr test flow (#24358) 2024-07-19 22:03:19 +00:00
tools Community: Google Books API Tool (#27307) 2024-11-07 15:29:35 -08:00
utilities Community: Google Books API Tool (#27307) 2024-11-07 15:29:35 -08:00
utils partners: Use simsimd types (#25299) 2024-08-23 10:41:39 -04:00
vectorstores standard-tests: rename langchain_standard_tests to langchain_tests, release 0.3.2 (#28203) 2024-11-18 19:10:39 -08:00
__init__.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
conftest.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_cache.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_dependencies.py multiple: langchain-standard-tests -> langchain-tests (#28139) 2024-11-15 11:32:04 -08:00
test_document_transformers.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_graph_vectorstores.py core, community: move graph vectorstores to community (#26678) 2024-09-19 11:38:14 -07:00
test_imports.py community[patch]: Fix remaining __inits__ in community (#22037) 2024-05-22 17:42:17 +00:00
test_sql_database_schema.py infra: add min version testing to pr test flow (#24358) 2024-07-19 22:03:19 +00:00
test_sql_database.py infra: add min version testing to pr test flow (#24358) 2024-07-19 22:03:19 +00:00
test_sqlalchemy.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00