Skip to content

Commit

Permalink
docs: Update docs_v2 with integrations and installation
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit cd04736756d9ec9f4b9533c85007d474db8ba558
Author: Douglas Bett <bettdalpha@gmail.com>
Date:   Wed Sep 18 08:53:39 2024 +0300

    update sidebars.js

commit d3fed3c17185fc29f1a4d7221f6be86265d60cf3
Author: Douglas Bett <bettdalpha@gmail.com>
Date:   Wed Sep 18 08:53:20 2024 +0300

    Add installation docs

commit 36fd583db116c69be132edaa5a4ec092bbbfbd92
Author: Douglas Bett <bettdalpha@gmail.com>
Date:   Wed Sep 18 08:52:09 2024 +0300

    Add concepts documentation

commit 48317baef7119d8dd0d1b5892d21a87ec69818c8
Author: Douglas Bett <bettdalpha@gmail.com>
Date:   Wed Sep 18 07:43:23 2024 +0300

    Add integrations

commit bedfcda18e10af33cf64a95ccf9925226233e098
Author: Douglas Bett <bettdalpha@gmail.com>
Date:   Wed Sep 18 07:42:57 2024 +0300

    switch to autogenerated sidebar
  • Loading branch information
bettdouglas committed Sep 18, 2024
1 parent 90c5a0f commit 65bcef8
Show file tree
Hide file tree
Showing 19 changed files with 2,437 additions and 75 deletions.
70 changes: 48 additions & 22 deletions docs_v2/docs/03-how_to/01-installation.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,51 @@
# Installation
Langchain as a framework consists of a number of packages. They're split into different packages allowing you to choose exactly what pieces of the framework to install and use.

LangChain as a framework consists of a number of packages.

### [`langchain_core`](https://pub.dev/packages/langchain_core)
This package contains base abstractions of different components and ways to compose them together.
The interfaces for core components like LLMs, vector stores, retrievers and more are defined here.
No third party integrations are defined here.

> Depend on this package to build frameworks on top of LangChain.dart or to interoperate with it.
## Installing essential Langchain.dart packages

### [`langchain`](https://pub.dev/packages/langchain)

Contains higher-level and use-case specific chains, agents, and retrieval algorithms that are at the core of the application's cognitive architecture.

> Depend on this package to build LLM applications with LangChain.dart.
> Depend on this package to build LLM applications with Langchain.dart.
>
> This package exposes `langchain_core` so you don't need to depend on it explicitly.
### [`langchain_community`](https://pub.dev/packages/langchain_community)
```bash
dart pub add langchain
```

Contains third-party integrations and community-contributed components that are not part of the core LangChain.dart API.
### [`langchain_core`](https://pub.dev/packages/langchain_core)
This package contains base abstractions of different components and ways to compose them together.
The interfaces for core components like LLMs, vector stores, retrievers and more are defined here.
> Depend on this package to build frameworks on top of Langchain.dart or to interoperate with it.
> Depend on this package if you want to use any of the integrations or components it provides.
To install this package in your Dart or Flutter project
```bash
dart pub add langchain_core
```

To start using LangChain.dart, add `langchain` as a dependency to your `pubspec.yaml` file.
```yaml
dependencies:
langchain: {version}
langchain_community: {version}
langchain_openai: {version}
langchain_google: {version}
...
### [`langchain_community`](https://pub.dev/packages/langchain_community)
Contains third-party integrations and community-contributed components that are not part of the core Langchain.dart API.
> Depend on this package if you want to use any of the integrations or components it provides like CSV,JSON,Text or HTML loaders and more.
```bash
dart pub add langchain langchain_community
```

Let's say you're using [OpenAI](https://platform.openai.com/), you'd choose the `langchain_openai` package.
## Integration packages
Certain integrations like OpenAI and Anthropic have their own packages. Any integrations that require their own package will be documented as such in the Integration docs.
<!-- //TODO(bettdouglas): Add Integration Docs -->

Let's say you're using [OpenAI](https://platform.openai.com/), install the `langchain_openai` package.
```bash
dart pub add langchain langchain_community langchain_openai
```

Let's say you want Google integration to use (GoogleAI, VertexAI, Gemini etc), install the `langchain_google` package.
```bash
dart pub add langchain langchain_community langchain_google
```
The following table contains the list of existing Langchain.dart integration packages.

| Package | Version | Description |
|---------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand All @@ -49,3 +60,18 @@ Let's say you're using [OpenAI](https://platform.openai.com/), you'd choose the
| [langchain_pinecone](https://pub.dev/packages/langchain_pinecone) | [![langchain_pinecone](https://img.shields.io/pub/v/langchain_pinecone.svg)](https://pub.dev/packages/langchain_pinecone) | Pinecone vector database integration |
| [langchain_chroma](https://pub.dev/packages/langchain_chroma) | [![langchain_chroma](https://img.shields.io/pub/v/langchain_chroma.svg)](https://pub.dev/packages/langchain_chroma) | Chroma vector database integration |
| [langchain_supabase](https://pub.dev/packages/langchain_supabase) | [![langchain_supabase](https://img.shields.io/pub/v/langchain_supabase.svg)](https://pub.dev/packages/langchain_supabase) | Supabase Vector database integration |
## Documentation

Detailed documentation for various integrations can be found in the `/docs/05-integration/` directory:

- [Anthropic](/docs/integrations/anthropic)
- [Anyscale](/docs/integrations/anyscale)
- [Firebase VertexAI](/docs/integrations/firebase_vertex_ai)
- [GCP VertexAI](/docs/integrations/gcp_vertex_ai)
- [GoogleAI](/docs/integrations/googleai)
- [MistralAI](/docs/integrations/mistralai)
- [Ollama](/docs/integrations/ollama)
- [OpenRouter](/docs/integrations/open_router)
- [OpenAI](/docs/integrations/openai)
- [PrEM](/docs/integrations/prem)
- [TogetherAI](/docs/integrations/together_ai)
14 changes: 14 additions & 0 deletions docs_v2/docs/03-how_to/02-structured_output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
sidebar_position: 3
keywords: [structured output, json, information extraction, with_structured_output]
---
# How to return structured data from a model

> This guide assumes familiarity with the following concepts:
> - [Chat models](/docs/concepts/#chat-models)
> - [Function/tool calling](/docs/concepts/#functiontool-calling)

It is often useful to have a model return output that matches a specific schema. One common use-case is extracting data from text to insert into a database or use with some other downstream system. This guide covers a few strategies for getting structured outputs from a model.


Loading

0 comments on commit 65bcef8

Please sign in to comment.