mirror of
https://github.com/hwchase17/langchain.git
synced 2026-02-15 09:39:11 +00:00
Compare commits
76 Commits
v0.0.236
...
harrison/f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23a4b65dc6 | ||
|
|
cbf2fc8af8 | ||
|
|
d81d6e874f | ||
|
|
506b21bfc2 | ||
|
|
9854d9e5cb | ||
|
|
9f3073d418 | ||
|
|
86946a47a8 | ||
|
|
8b08687fc4 | ||
|
|
aa0e69bc98 | ||
|
|
95bcf68802 | ||
|
|
8dcabd9205 | ||
|
|
58f65fcf12 | ||
|
|
0faba034b1 | ||
|
|
d353d668e4 | ||
|
|
08c658d3f8 | ||
|
|
344cbd9c90 | ||
|
|
17c06ee456 | ||
|
|
da04760de1 | ||
|
|
f35db9f43e | ||
|
|
623b321e75 | ||
|
|
95e369b38d | ||
|
|
c38965fcba | ||
|
|
355b7d8b86 | ||
|
|
5a084e1b20 | ||
|
|
cf60cff1ef | ||
|
|
1f3b987860 | ||
|
|
ae8bc9e830 | ||
|
|
dc9d6cadab | ||
|
|
f99f497b2c | ||
|
|
56c6ab1715 | ||
|
|
ebc5ff2948 | ||
|
|
ed6a5532ac | ||
|
|
7717c24fc4 | ||
|
|
973593c5c7 | ||
|
|
31b7ddc12c | ||
|
|
995220b797 | ||
|
|
5137f40dd6 | ||
|
|
9226fda58b | ||
|
|
7239d57a53 | ||
|
|
021bb9be84 | ||
|
|
62d0475c29 | ||
|
|
e2a99bd169 | ||
|
|
ec4f93b629 | ||
|
|
5f10d2ea1d | ||
|
|
095937ad52 | ||
|
|
7c24a6b9d1 | ||
|
|
1d7414a371 | ||
|
|
d8c40253c3 | ||
|
|
ea028b66ab | ||
|
|
453d4c3a99 | ||
|
|
d593833e4d | ||
|
|
aea97efe8b | ||
|
|
c416dbe8e0 | ||
|
|
ea149dbd89 | ||
|
|
d6493590da | ||
|
|
812a1643db | ||
|
|
54e02e4392 | ||
|
|
0ffb7fc10c | ||
|
|
493cbc9410 | ||
|
|
73901ef132 | ||
|
|
24b26a922a | ||
|
|
0613ed5b95 | ||
|
|
5694e7b8cf | ||
|
|
4a5894db47 | ||
|
|
19e8472521 | ||
|
|
8edb1db9dc | ||
|
|
df84e1bb64 | ||
|
|
a4c5914c9a | ||
|
|
5d021c0962 | ||
|
|
3adab5e5be | ||
|
|
854a2be0ca | ||
|
|
9aef79c2e3 | ||
|
|
dfc533aa74 | ||
|
|
d9b5bcd691 | ||
|
|
f97535b33e | ||
|
|
7bb843477f |
@@ -2,7 +2,7 @@ version: '3'
|
||||
services:
|
||||
langchain:
|
||||
build:
|
||||
dockerfile: dev.Dockerfile
|
||||
dockerfile: libs/langchain/dev.Dockerfile
|
||||
context: ..
|
||||
volumes:
|
||||
# Update this to wherever you want VS Code to mount the folder of your project
|
||||
|
||||
11
.github/CONTRIBUTING.md
vendored
11
.github/CONTRIBUTING.md
vendored
@@ -69,6 +69,14 @@ This project uses [Poetry](https://python-poetry.org/) as a dependency manager.
|
||||
3. Tell Poetry to use the virtualenv python environment (`poetry config virtualenvs.prefer-active-python true`)
|
||||
4. Continue with the following steps.
|
||||
|
||||
There are two separate projects in this repository:
|
||||
- `langchain`: core langchain code, abstractions, and use cases
|
||||
- `langchain.experimental`: more experimental code
|
||||
|
||||
Each of these has their OWN development environment.
|
||||
In order to run any of the commands below, please move into their respective directories.
|
||||
For example, to contribute to `langchain` run `cd libs/langchain` before getting started with the below.
|
||||
|
||||
To install requirements:
|
||||
|
||||
```bash
|
||||
@@ -248,6 +256,9 @@ When you run `poetry install`, the `langchain` package is installed as editable
|
||||
|
||||
## Documentation
|
||||
|
||||
While the code is split between `langchain` and `langchain.experimental`, the documentation is one holistic thing.
|
||||
This covers how to get started contributing to documentation.
|
||||
|
||||
### Contribute Documentation
|
||||
|
||||
The docs directory contains Documentation and API Reference.
|
||||
|
||||
2
.github/actions/poetry_setup/action.yml
vendored
2
.github/actions/poetry_setup/action.yml
vendored
@@ -52,11 +52,13 @@ runs:
|
||||
|
||||
- name: Check Poetry File
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
run: |
|
||||
poetry check
|
||||
|
||||
- name: Check lock file
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
run: |
|
||||
poetry lock --check
|
||||
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
name: lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
workflow_call:
|
||||
inputs:
|
||||
working-directory:
|
||||
required: true
|
||||
type: string
|
||||
description: "From which folder this pipeline executes"
|
||||
|
||||
env:
|
||||
POETRY_VERSION: "1.4.2"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -31,6 +37,10 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
poetry install
|
||||
- name: Install langchain editable
|
||||
if: ${{ inputs.working-directory != 'langchain' }}
|
||||
run: |
|
||||
pip install -e ../langchain
|
||||
- name: Analysing the code with our lint
|
||||
run: |
|
||||
make lint
|
||||
@@ -1,13 +1,12 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'pyproject.toml'
|
||||
workflow_call:
|
||||
inputs:
|
||||
working-directory:
|
||||
required: true
|
||||
type: string
|
||||
description: "From which folder this pipeline executes"
|
||||
|
||||
env:
|
||||
POETRY_VERSION: "1.4.2"
|
||||
@@ -18,6 +17,9 @@ jobs:
|
||||
${{ github.event.pull_request.merged == true }}
|
||||
&& ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install poetry
|
||||
@@ -1,16 +1,25 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
working-directory:
|
||||
required: true
|
||||
type: string
|
||||
description: "From which folder this pipeline executes"
|
||||
test_type:
|
||||
type: string
|
||||
description: "Test types to run"
|
||||
default: '["core", "extended"]'
|
||||
|
||||
env:
|
||||
POETRY_VERSION: "1.4.2"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -19,9 +28,7 @@ jobs:
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
test_type:
|
||||
- "core"
|
||||
- "extended"
|
||||
test_type: ${{ fromJSON(inputs.test_type) }}
|
||||
name: Python ${{ matrix.python-version }} ${{ matrix.test_type }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -29,6 +36,7 @@ jobs:
|
||||
uses: "./.github/actions/poetry_setup"
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
poetry-version: "1.4.2"
|
||||
cache-key: ${{ matrix.test_type }}
|
||||
install-command: |
|
||||
@@ -39,6 +47,10 @@ jobs:
|
||||
echo "Running extended tests, installing dependencies with poetry..."
|
||||
poetry install -E extended_testing
|
||||
fi
|
||||
- name: Install langchain editable
|
||||
if: ${{ inputs.working-directory != 'langchain' }}
|
||||
run: |
|
||||
pip install -e ../langchain
|
||||
- name: Run ${{matrix.test_type}} tests
|
||||
run: |
|
||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
||||
27
.github/workflows/langchain_ci.yml
vendored
Normal file
27
.github/workflows/langchain_ci.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: libs/langchain CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/_lint.yml'
|
||||
- '.github/workflows/_test.yml'
|
||||
- '.github/workflows/langchain_ci.yml'
|
||||
- 'libs/langchain/**'
|
||||
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
uses:
|
||||
./.github/workflows/_lint.yml
|
||||
with:
|
||||
working-directory: libs/langchain
|
||||
secrets: inherit
|
||||
test:
|
||||
uses:
|
||||
./.github/workflows/_test.yml
|
||||
with:
|
||||
working-directory: libs/langchain
|
||||
secrets: inherit
|
||||
29
.github/workflows/langchain_experimental_ci.yml
vendored
Normal file
29
.github/workflows/langchain_experimental_ci.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
name: libs/langchain-experimental CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/_lint.yml'
|
||||
- '.github/workflows/_test.yml'
|
||||
- '.github/workflows/langchain_experimental_ci.yml'
|
||||
- 'libs/langchain/**'
|
||||
- 'libs/experimental/**'
|
||||
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
uses:
|
||||
./.github/workflows/_lint.yml
|
||||
with:
|
||||
working-directory: libs/experimental
|
||||
secrets: inherit
|
||||
test:
|
||||
uses:
|
||||
./.github/workflows/_test.yml
|
||||
with:
|
||||
working-directory: libs/experimental
|
||||
test_type: '["core"]'
|
||||
secrets: inherit
|
||||
20
.github/workflows/langchain_experimental_release.yml
vendored
Normal file
20
.github/workflows/langchain_experimental_release.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: libs/langchain-experimental Release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'libs/experimental/pyproject.toml'
|
||||
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
|
||||
|
||||
jobs:
|
||||
release:
|
||||
uses:
|
||||
./.github/workflows/_release.yml
|
||||
with:
|
||||
working-directory: libs/experimental
|
||||
secrets: inherit
|
||||
20
.github/workflows/langchain_release.yml
vendored
Normal file
20
.github/workflows/langchain_release.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: libs/langchain Release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'libs/langchain/pyproject.toml'
|
||||
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
|
||||
|
||||
jobs:
|
||||
release:
|
||||
uses:
|
||||
./.github/workflows/_release.yml
|
||||
with:
|
||||
working-directory: libs/langchain
|
||||
secrets: inherit
|
||||
@@ -24,6 +24,6 @@ sphinx:
|
||||
# Optionally declare the Python requirements required to build your docs
|
||||
python:
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
- requirements: docs/api_reference/requirements.txt
|
||||
- method: pip
|
||||
path: .
|
||||
|
||||
57
MIGRATE.md
Normal file
57
MIGRATE.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# Migrating to `langchain_experimental`
|
||||
|
||||
We are moving any experimental components of LangChain, or components with vulnerability issues, into `langchain_experimental`.
|
||||
This guide covers how to migrate.
|
||||
|
||||
## Installation
|
||||
|
||||
Previously:
|
||||
|
||||
`pip install -U langchain`
|
||||
|
||||
Now (only if you want to access things in experimental):
|
||||
|
||||
`pip install -U langchain langchain_experimental`
|
||||
|
||||
## Things in `langchain.experimental`
|
||||
|
||||
Previously:
|
||||
|
||||
`from langchain.experimental import ...`
|
||||
|
||||
Now:
|
||||
|
||||
`from langchain_experimental import ...`
|
||||
|
||||
## PALChain
|
||||
|
||||
Previously:
|
||||
|
||||
`from langchain.chains import PALChain`
|
||||
|
||||
Now:
|
||||
|
||||
`from langchain_experimental.pal_chain import PALChain`
|
||||
|
||||
## SQLDatabaseChain
|
||||
|
||||
Previously:
|
||||
|
||||
`from langchain.chains import SQLDatabaseChain`
|
||||
|
||||
Now:
|
||||
|
||||
`from langchain_experimental.sql import SQLDatabaseChain`
|
||||
|
||||
## `load_prompt` for Python files
|
||||
|
||||
Note: this only applies if you want to load Python files as prompts.
|
||||
If you want to load json/yaml files, no change is needed.
|
||||
|
||||
Previously:
|
||||
|
||||
`from langchain.prompts import load_prompt`
|
||||
|
||||
Now:
|
||||
|
||||
`from langchain_experimental.prompts import load_prompt`
|
||||
61
Makefile
61
Makefile
@@ -1,18 +1,8 @@
|
||||
.PHONY: all clean docs_build docs_clean docs_linkcheck api_docs_build api_docs_clean api_docs_linkcheck format lint test tests test_watch integration_tests docker_tests help extended_tests
|
||||
.PHONY: all clean docs_build docs_clean docs_linkcheck api_docs_build api_docs_clean api_docs_linkcheck
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
all: help
|
||||
|
||||
######################
|
||||
# TESTING AND COVERAGE
|
||||
######################
|
||||
|
||||
# Run unit tests and generate a coverage report.
|
||||
coverage:
|
||||
poetry run pytest --cov \
|
||||
--cov-config=.coveragerc \
|
||||
--cov-report xml \
|
||||
--cov-report term-missing:skip-covered
|
||||
|
||||
######################
|
||||
# DOCUMENTATION
|
||||
@@ -41,46 +31,6 @@ api_docs_clean:
|
||||
api_docs_linkcheck:
|
||||
poetry run linkchecker docs/api_reference/_build/html/index.html
|
||||
|
||||
# Define a variable for the test file path.
|
||||
TEST_FILE ?= tests/unit_tests/
|
||||
|
||||
test:
|
||||
poetry run pytest --disable-socket --allow-unix-socket $(TEST_FILE)
|
||||
|
||||
tests:
|
||||
poetry run pytest --disable-socket --allow-unix-socket $(TEST_FILE)
|
||||
|
||||
extended_tests:
|
||||
poetry run pytest --disable-socket --allow-unix-socket --only-extended tests/unit_tests
|
||||
|
||||
test_watch:
|
||||
poetry run ptw --now . -- tests/unit_tests
|
||||
|
||||
integration_tests:
|
||||
poetry run pytest tests/integration_tests
|
||||
|
||||
docker_tests:
|
||||
docker build -t my-langchain-image:test .
|
||||
docker run --rm my-langchain-image:test
|
||||
|
||||
######################
|
||||
# LINTING AND FORMATTING
|
||||
######################
|
||||
|
||||
# Define a variable for Python and notebook files.
|
||||
PYTHON_FILES=.
|
||||
lint format: PYTHON_FILES=.
|
||||
lint_diff format_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$')
|
||||
|
||||
lint lint_diff:
|
||||
poetry run mypy $(PYTHON_FILES)
|
||||
poetry run black $(PYTHON_FILES) --check
|
||||
poetry run ruff .
|
||||
|
||||
format format_diff:
|
||||
poetry run black $(PYTHON_FILES)
|
||||
poetry run ruff --select I --fix $(PYTHON_FILES)
|
||||
|
||||
spell_check:
|
||||
poetry run codespell --toml pyproject.toml
|
||||
|
||||
@@ -97,12 +47,3 @@ help:
|
||||
@echo 'docs_build - build the documentation'
|
||||
@echo 'docs_clean - clean the documentation build artifacts'
|
||||
@echo 'docs_linkcheck - run linkchecker on the documentation'
|
||||
@echo 'format - run code formatters'
|
||||
@echo 'lint - run linters'
|
||||
@echo 'test - run unit tests'
|
||||
@echo 'tests - run unit tests'
|
||||
@echo 'test TEST_FILE=<test_file> - run all tests in file'
|
||||
@echo 'extended_tests - run only extended unit tests'
|
||||
@echo 'test_watch - run unit tests in watch mode'
|
||||
@echo 'integration_tests - run integration tests'
|
||||
@echo 'docker_tests - run unit tests in docker'
|
||||
|
||||
12
README.md
12
README.md
@@ -3,8 +3,8 @@
|
||||
⚡ Building applications with LLMs through composability ⚡
|
||||
|
||||
[](https://github.com/hwchase17/langchain/releases)
|
||||
[](https://github.com/hwchase17/langchain/actions/workflows/lint.yml)
|
||||
[](https://github.com/hwchase17/langchain/actions/workflows/test.yml)
|
||||
[](https://github.com/hwchase17/langchain/actions/workflows/langchain_ci.yml)
|
||||
[](https://github.com/hwchase17/langchain/actions/workflows/langchain_experimental_ci.yml)
|
||||
[](https://pepy.tech/project/langchain)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://twitter.com/langchainai)
|
||||
@@ -21,6 +21,14 @@ Looking for the JS/TS version? Check out [LangChain.js](https://github.com/hwcha
|
||||
**Production Support:** As you move your LangChains into production, we'd love to offer more comprehensive support.
|
||||
Please fill out [this form](https://forms.gle/57d8AmXBYp8PP8tZA) and we'll set up a dedicated support Slack channel.
|
||||
|
||||
## 🚨Breaking Changes for select chains (SQLDatabase) on 7/28
|
||||
|
||||
In an effort to make `langchain` leaner and safer, we are moving select chains to `langchain_experimental`.
|
||||
This migration has already started, but we are remaining backwards compatible until 7/28.
|
||||
On that date, we will remove functionality from `langchain`.
|
||||
Read more about the motivation and the progress [here](https://github.com/hwchase17/langchain/discussions/8043).
|
||||
Read how to migrate your code [here](MIGRATE.md).
|
||||
|
||||
## Quick Install
|
||||
|
||||
`pip install langchain`
|
||||
|
||||
@@ -17,8 +17,9 @@ import sys
|
||||
import toml
|
||||
|
||||
sys.path.insert(0, os.path.abspath("."))
|
||||
sys.path.insert(0, os.path.abspath("../../libs/langchain"))
|
||||
|
||||
with open("../../pyproject.toml") as f:
|
||||
with open("../../libs/langchain/pyproject.toml") as f:
|
||||
data = toml.load(f)
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
@@ -4,7 +4,7 @@ import re
|
||||
from pathlib import Path
|
||||
|
||||
ROOT_DIR = Path(__file__).parents[2].absolute()
|
||||
PKG_DIR = ROOT_DIR / "langchain"
|
||||
PKG_DIR = ROOT_DIR / "libs" / "langchain" / "langchain"
|
||||
WRITE_FILE = Path(__file__).parent / "api_reference.rst"
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-e libs/langchain
|
||||
autodoc_pydantic==1.8.0
|
||||
myst_parser
|
||||
nbsphinx==0.8.9
|
||||
@@ -9,6 +10,4 @@ sphinx-panels
|
||||
toml
|
||||
myst_nb
|
||||
sphinx_copybutton
|
||||
pydata-sphinx-theme==0.13.1
|
||||
nbdoc
|
||||
urllib3<2
|
||||
pydata-sphinx-theme==0.13.1
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
sidebar_position: 0
|
||||
---
|
||||
# Integrations
|
||||
|
||||
Visit the [Integrations Hub](https://integrations.langchain.com) to further explore, upvote and request integrations across key LangChain components.
|
||||
|
||||
import DocCardList from "@theme/DocCardList";
|
||||
|
||||
<DocCardList />
|
||||
@@ -148,6 +148,28 @@ const config = {
|
||||
navbar: {
|
||||
title: "🦜️🔗 LangChain",
|
||||
items: [
|
||||
{
|
||||
to: "/docs/get_started/introduction",
|
||||
label: "Docs",
|
||||
position: "left",
|
||||
},
|
||||
{
|
||||
type: 'docSidebar',
|
||||
position: 'left',
|
||||
sidebarId: 'use_cases',
|
||||
label: 'Use cases',
|
||||
},
|
||||
{
|
||||
type: 'docSidebar',
|
||||
position: 'left',
|
||||
sidebarId: 'integrations',
|
||||
label: 'Integrations',
|
||||
},
|
||||
{
|
||||
href: "https://api.python.langchain.com",
|
||||
label: "API",
|
||||
position: "left",
|
||||
},
|
||||
{
|
||||
to: "https://smith.langchain.com",
|
||||
label: "LangSmith",
|
||||
@@ -161,8 +183,9 @@ const config = {
|
||||
// Please keep GitHub link to the right for consistency.
|
||||
{
|
||||
href: "https://github.com/hwchase17/langchain",
|
||||
label: "GitHub",
|
||||
position: "right",
|
||||
position: 'right',
|
||||
className: 'header-github-link',
|
||||
'aria-label': 'GitHub repository',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
module.exports = {
|
||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
||||
sidebar: [
|
||||
docs: [
|
||||
{
|
||||
type: "category",
|
||||
label: "Get started",
|
||||
@@ -30,7 +30,7 @@ module.exports = {
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
description: 'Get started with LangChain',
|
||||
slug: "get_started",
|
||||
slug: "get_started",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -44,17 +44,6 @@ module.exports = {
|
||||
id: "modules/index"
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Use cases",
|
||||
collapsed: true,
|
||||
items: [{ type: "autogenerated", dirName: "use_cases" }],
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
description: 'Walkthroughs of common end-to-end use cases',
|
||||
slug: "use_cases",
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Guides",
|
||||
@@ -63,7 +52,7 @@ module.exports = {
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
description: 'Design guides for key parts of the development process',
|
||||
slug: "guides",
|
||||
slug: "guides",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -73,7 +62,7 @@ module.exports = {
|
||||
items: [{ type: "autogenerated", dirName: "ecosystem" }],
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
slug: "ecosystem",
|
||||
slug: "ecosystem",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -83,18 +72,32 @@ module.exports = {
|
||||
items: [{ type: "autogenerated", dirName: "additional_resources" }, { type: "link", label: "Gallery", href: "https://github.com/kyrolabs/awesome-langchain" }],
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
slug: "additional_resources",
|
||||
slug: "additional_resources",
|
||||
},
|
||||
},
|
||||
],
|
||||
integrations: [
|
||||
{
|
||||
type: "html",
|
||||
value: "<hr>",
|
||||
defaultStyle: true,
|
||||
type: "category",
|
||||
label: "Integrations",
|
||||
collapsible: false,
|
||||
items: [{ type: "autogenerated", dirName: "integrations" }],
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
slug: "integrations",
|
||||
},
|
||||
},
|
||||
],
|
||||
use_cases: [
|
||||
{
|
||||
type: "link",
|
||||
href: "https://api.python.langchain.com",
|
||||
label: "API reference",
|
||||
type: "category",
|
||||
label: "Use cases",
|
||||
collapsible: false,
|
||||
items: [{ type: "autogenerated", dirName: "use_cases" }],
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
slug: "use_cases",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -139,4 +139,22 @@
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.header-github-link:hover {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.header-github-link::before {
|
||||
content: '';
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: flex;
|
||||
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
|
||||
no-repeat;
|
||||
}
|
||||
|
||||
[data-theme='dark'] .header-github-link::before {
|
||||
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
|
||||
no-repeat;
|
||||
}
|
||||
BIN
docs/docs_skeleton/static/img/portkey-dashboard.gif
Normal file
BIN
docs/docs_skeleton/static/img/portkey-dashboard.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 483 KiB |
BIN
docs/docs_skeleton/static/img/portkey-tracing.png
Normal file
BIN
docs/docs_skeleton/static/img/portkey-tracing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 291 KiB |
BIN
docs/docs_skeleton/static/img/run_details.png
Normal file
BIN
docs/docs_skeleton/static/img/run_details.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
@@ -6,539 +6,551 @@
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/agent_with_wandb_tracing.html",
|
||||
"destination": "/docs/ecosystem/integrations/agent_with_wandb_tracing"
|
||||
"destination": "/docs/integrations/agent_with_wandb_tracing"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/ai21.html",
|
||||
"destination": "/docs/ecosystem/integrations/ai21"
|
||||
"destination": "/docs/integrations/ai21"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/aim_tracking.html",
|
||||
"destination": "/docs/ecosystem/integrations/aim_tracking"
|
||||
"destination": "/docs/integrations/aim_tracking"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/airbyte.html",
|
||||
"destination": "/docs/ecosystem/integrations/airbyte"
|
||||
"destination": "/docs/integrations/airbyte"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/aleph_alpha.html",
|
||||
"destination": "/docs/ecosystem/integrations/aleph_alpha"
|
||||
"destination": "/docs/integrations/aleph_alpha"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/analyticdb.html",
|
||||
"destination": "/docs/ecosystem/integrations/analyticdb"
|
||||
"destination": "/docs/integrations/analyticdb"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/annoy.html",
|
||||
"destination": "/docs/ecosystem/integrations/annoy"
|
||||
"destination": "/docs/integrations/annoy"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/anyscale.html",
|
||||
"destination": "/docs/ecosystem/integrations/anyscale"
|
||||
"destination": "/docs/integrations/anyscale"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/apify.html",
|
||||
"destination": "/docs/ecosystem/integrations/apify"
|
||||
"destination": "/docs/integrations/apify"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/argilla.html",
|
||||
"destination": "/docs/ecosystem/integrations/argilla"
|
||||
"destination": "/docs/integrations/argilla"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/arxiv.html",
|
||||
"destination": "/docs/ecosystem/integrations/arxiv"
|
||||
"destination": "/docs/integrations/arxiv"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/atlas.html",
|
||||
"destination": "/docs/ecosystem/integrations/atlas"
|
||||
"destination": "/docs/integrations/atlas"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/awadb.html",
|
||||
"destination": "/docs/ecosystem/integrations/awadb"
|
||||
"destination": "/docs/integrations/awadb"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/aws_s3.html",
|
||||
"destination": "/docs/ecosystem/integrations/aws_s3"
|
||||
"destination": "/docs/integrations/aws_s3"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/azlyrics.html",
|
||||
"destination": "/docs/ecosystem/integrations/azlyrics"
|
||||
"destination": "/docs/integrations/azlyrics"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/azure_blob_storage.html",
|
||||
"destination": "/docs/ecosystem/integrations/azure_blob_storage"
|
||||
"destination": "/docs/integrations/azure_blob_storage"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/azure_cognitive_search_.html",
|
||||
"destination": "/docs/ecosystem/integrations/azure_cognitive_search_"
|
||||
"destination": "/docs/integrations/azure_cognitive_search_"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/azure_openai.html",
|
||||
"destination": "/docs/ecosystem/integrations/azure_openai"
|
||||
"destination": "/docs/integrations/azure_openai"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/bananadev.html",
|
||||
"destination": "/docs/ecosystem/integrations/bananadev"
|
||||
"destination": "/docs/integrations/bananadev"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/ecosystem/baseten.html",
|
||||
"destination": "/docs/ecosystem/integrations/baseten"
|
||||
"destination": "/docs/integrations/baseten"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/beam.html",
|
||||
"destination": "/docs/ecosystem/integrations/beam"
|
||||
"destination": "/docs/integrations/beam"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/amazon_bedrock.html",
|
||||
"destination": "/docs/ecosystem/integrations/bedrock"
|
||||
"destination": "/docs/integrations/bedrock"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/bilibili.html",
|
||||
"destination": "/docs/ecosystem/integrations/bilibili"
|
||||
"destination": "/docs/integrations/bilibili"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/blackboard.html",
|
||||
"destination": "/docs/ecosystem/integrations/blackboard"
|
||||
"destination": "/docs/integrations/blackboard"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/cassandra.html",
|
||||
"destination": "/docs/ecosystem/integrations/cassandra"
|
||||
"destination": "/docs/integrations/cassandra"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/cerebriumai.html",
|
||||
"destination": "/docs/ecosystem/integrations/cerebriumai"
|
||||
"destination": "/docs/integrations/cerebriumai"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/chroma.html",
|
||||
"destination": "/docs/ecosystem/integrations/chroma"
|
||||
"destination": "/docs/integrations/chroma"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/clearml_tracking.html",
|
||||
"destination": "/docs/ecosystem/integrations/clearml_tracking"
|
||||
"destination": "/docs/integrations/clearml_tracking"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/cohere.html",
|
||||
"destination": "/docs/ecosystem/integrations/cohere"
|
||||
"destination": "/docs/integrations/cohere"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/college_confidential.html",
|
||||
"destination": "/docs/ecosystem/integrations/college_confidential"
|
||||
"destination": "/docs/integrations/college_confidential"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/comet_tracking.html",
|
||||
"destination": "/docs/ecosystem/integrations/comet_tracking"
|
||||
"destination": "/docs/integrations/comet_tracking"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/confluence.html",
|
||||
"destination": "/docs/ecosystem/integrations/confluence"
|
||||
"destination": "/docs/integrations/confluence"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/ctransformers.html",
|
||||
"destination": "/docs/ecosystem/integrations/ctransformers"
|
||||
"destination": "/docs/integrations/ctransformers"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/databerry.html",
|
||||
"destination": "/docs/ecosystem/integrations/chaindesk"
|
||||
"destination": "/docs/integrations/chaindesk"
|
||||
},
|
||||
{
|
||||
"source": "/docs/ecosystem/integrations/databerry",
|
||||
"destination": "/docs/ecosystem/integrations/chaindesk"
|
||||
"source": "/docs/integrations/databerry",
|
||||
"destination": "/docs/integrations/chaindesk"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/databricks/databricks.html",
|
||||
"destination": "/docs/ecosystem/integrations/databricks"
|
||||
"destination": "/docs/integrations/databricks"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/databricks.html",
|
||||
"destination": "/docs/ecosystem/integrations/databricks"
|
||||
"destination": "/docs/integrations/databricks"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/deepinfra.html",
|
||||
"destination": "/docs/ecosystem/integrations/deepinfra"
|
||||
"destination": "/docs/integrations/deepinfra"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/deeplake.html",
|
||||
"destination": "/docs/ecosystem/integrations/deeplake"
|
||||
"destination": "/docs/integrations/deeplake"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/diffbot.html",
|
||||
"destination": "/docs/ecosystem/integrations/diffbot"
|
||||
"destination": "/docs/integrations/diffbot"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/discord.html",
|
||||
"destination": "/docs/ecosystem/integrations/discord"
|
||||
"destination": "/docs/integrations/discord"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/docugami.html",
|
||||
"destination": "/docs/ecosystem/integrations/docugami"
|
||||
"destination": "/docs/integrations/docugami"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/duckdb.html",
|
||||
"destination": "/docs/ecosystem/integrations/duckdb"
|
||||
"destination": "/docs/integrations/duckdb"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/elasticsearch.html",
|
||||
"destination": "/docs/ecosystem/integrations/elasticsearch"
|
||||
"destination": "/docs/integrations/elasticsearch"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/evernote.html",
|
||||
"destination": "/docs/ecosystem/integrations/evernote"
|
||||
"destination": "/docs/integrations/evernote"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/facebook_chat.html",
|
||||
"destination": "/docs/ecosystem/integrations/facebook_chat"
|
||||
"destination": "/docs/integrations/facebook_chat"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/figma.html",
|
||||
"destination": "/docs/ecosystem/integrations/figma"
|
||||
"destination": "/docs/integrations/figma"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/forefrontai.html",
|
||||
"destination": "/docs/ecosystem/integrations/forefrontai"
|
||||
"destination": "/docs/integrations/forefrontai"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/git.html",
|
||||
"destination": "/docs/ecosystem/integrations/git"
|
||||
"destination": "/docs/integrations/git"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/gitbook.html",
|
||||
"destination": "/docs/ecosystem/integrations/gitbook"
|
||||
"destination": "/docs/integrations/gitbook"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/google_bigquery.html",
|
||||
"destination": "/docs/ecosystem/integrations/google_bigquery"
|
||||
"destination": "/docs/integrations/google_bigquery"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/google_cloud_storage.html",
|
||||
"destination": "/docs/ecosystem/integrations/google_cloud_storage"
|
||||
"destination": "/docs/integrations/google_cloud_storage"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/google_drive.html",
|
||||
"destination": "/docs/ecosystem/integrations/google_drive"
|
||||
"destination": "/docs/integrations/google_drive"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/google_search.html",
|
||||
"destination": "/docs/ecosystem/integrations/google_search"
|
||||
"destination": "/docs/integrations/google_search"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/google_serper.html",
|
||||
"destination": "/docs/ecosystem/integrations/google_serper"
|
||||
"destination": "/docs/integrations/google_serper"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/gooseai.html",
|
||||
"destination": "/docs/ecosystem/integrations/gooseai"
|
||||
"destination": "/docs/integrations/gooseai"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/gpt4all.html",
|
||||
"destination": "/docs/ecosystem/integrations/gpt4all"
|
||||
"destination": "/docs/integrations/gpt4all"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/graphsignal.html",
|
||||
"destination": "/docs/ecosystem/integrations/graphsignal"
|
||||
"destination": "/docs/integrations/graphsignal"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/gutenberg.html",
|
||||
"destination": "/docs/ecosystem/integrations/gutenberg"
|
||||
"destination": "/docs/integrations/gutenberg"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/hacker_news.html",
|
||||
"destination": "/docs/ecosystem/integrations/hacker_news"
|
||||
"destination": "/docs/integrations/hacker_news"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/hazy_research.html",
|
||||
"destination": "/docs/ecosystem/integrations/hazy_research"
|
||||
"destination": "/docs/integrations/hazy_research"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/helicone.html",
|
||||
"destination": "/docs/ecosystem/integrations/helicone"
|
||||
"destination": "/docs/integrations/helicone"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/huggingface.html",
|
||||
"destination": "/docs/ecosystem/integrations/huggingface"
|
||||
"destination": "/docs/integrations/huggingface"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/ifixit.html",
|
||||
"destination": "/docs/ecosystem/integrations/ifixit"
|
||||
"destination": "/docs/integrations/ifixit"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/imsdb.html",
|
||||
"destination": "/docs/ecosystem/integrations/imsdb"
|
||||
"destination": "/docs/integrations/imsdb"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/jina.html",
|
||||
"destination": "/docs/ecosystem/integrations/jina"
|
||||
"destination": "/docs/integrations/jina"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/lancedb.html",
|
||||
"destination": "/docs/ecosystem/integrations/lancedb"
|
||||
"destination": "/docs/integrations/lancedb"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/langchain_decorators.html",
|
||||
"destination": "/docs/ecosystem/integrations/langchain_decorators"
|
||||
"destination": "/docs/integrations/langchain_decorators"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/llamacpp.html",
|
||||
"destination": "/docs/ecosystem/integrations/llamacpp"
|
||||
"destination": "/docs/integrations/llamacpp"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/mediawikidump.html",
|
||||
"destination": "/docs/ecosystem/integrations/mediawikidump"
|
||||
"destination": "/docs/integrations/mediawikidump"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/metal.html",
|
||||
"destination": "/docs/ecosystem/integrations/metal"
|
||||
"destination": "/docs/integrations/metal"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/microsoft_onedrive.html",
|
||||
"destination": "/docs/ecosystem/integrations/microsoft_onedrive"
|
||||
"destination": "/docs/integrations/microsoft_onedrive"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/microsoft_powerpoint.html",
|
||||
"destination": "/docs/ecosystem/integrations/microsoft_powerpoint"
|
||||
"destination": "/docs/integrations/microsoft_powerpoint"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/microsoft_word.html",
|
||||
"destination": "/docs/ecosystem/integrations/microsoft_word"
|
||||
"destination": "/docs/integrations/microsoft_word"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/milvus.html",
|
||||
"destination": "/docs/ecosystem/integrations/milvus"
|
||||
"destination": "/docs/integrations/milvus"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/mlflow_tracking.html",
|
||||
"destination": "/docs/ecosystem/integrations/mlflow_tracking"
|
||||
"destination": "/docs/integrations/mlflow_tracking"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/modal.html",
|
||||
"destination": "/docs/ecosystem/integrations/modal"
|
||||
"destination": "/docs/integrations/modal"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/ecosystem/modelscope.html",
|
||||
"destination": "/docs/ecosystem/integrations/modelscope"
|
||||
"destination": "/docs/integrations/modelscope"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/modern_treasury.html",
|
||||
"destination": "/docs/ecosystem/integrations/modern_treasury"
|
||||
"destination": "/docs/integrations/modern_treasury"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/momento.html",
|
||||
"destination": "/docs/ecosystem/integrations/momento"
|
||||
"destination": "/docs/integrations/momento"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/myscale.html",
|
||||
"destination": "/docs/ecosystem/integrations/myscale"
|
||||
"destination": "/docs/integrations/myscale"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/nlpcloud.html",
|
||||
"destination": "/docs/ecosystem/integrations/nlpcloud"
|
||||
"destination": "/docs/integrations/nlpcloud"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/notion.html",
|
||||
"destination": "/docs/ecosystem/integrations/notion"
|
||||
"destination": "/docs/integrations/notion"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/obsidian.html",
|
||||
"destination": "/docs/ecosystem/integrations/obsidian"
|
||||
"destination": "/docs/integrations/obsidian"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/openai.html",
|
||||
"destination": "/docs/ecosystem/integrations/openai"
|
||||
"destination": "/docs/integrations/openai"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/opensearch.html",
|
||||
"destination": "/docs/ecosystem/integrations/opensearch"
|
||||
"destination": "/docs/integrations/opensearch"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/openweathermap.html",
|
||||
"destination": "/docs/ecosystem/integrations/openweathermap"
|
||||
"destination": "/docs/integrations/openweathermap"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/petals.html",
|
||||
"destination": "/docs/ecosystem/integrations/petals"
|
||||
"destination": "/docs/integrations/petals"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/pgvector.html",
|
||||
"destination": "/docs/ecosystem/integrations/pgvector"
|
||||
"destination": "/docs/integrations/pgvector"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/pinecone.html",
|
||||
"destination": "/docs/ecosystem/integrations/pinecone"
|
||||
"destination": "/docs/integrations/pinecone"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/pipelineai.html",
|
||||
"destination": "/docs/ecosystem/integrations/pipelineai"
|
||||
"destination": "/docs/integrations/pipelineai"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/predictionguard.html",
|
||||
"destination": "/docs/ecosystem/integrations/predictionguard"
|
||||
"destination": "/docs/integrations/predictionguard"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/promptlayer.html",
|
||||
"destination": "/docs/ecosystem/integrations/promptlayer"
|
||||
"destination": "/docs/integrations/promptlayer"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/psychic.html",
|
||||
"destination": "/docs/ecosystem/integrations/psychic"
|
||||
"destination": "/docs/integrations/psychic"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/qdrant.html",
|
||||
"destination": "/docs/ecosystem/integrations/qdrant"
|
||||
"destination": "/docs/integrations/qdrant"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/ray_serve.html",
|
||||
"destination": "/docs/ecosystem/integrations/ray_serve"
|
||||
"destination": "/docs/integrations/ray_serve"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/rebuff.html",
|
||||
"destination": "/docs/ecosystem/integrations/rebuff"
|
||||
"destination": "/docs/integrations/rebuff"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/reddit.html",
|
||||
"destination": "/docs/ecosystem/integrations/reddit"
|
||||
"destination": "/docs/integrations/reddit"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/redis.html",
|
||||
"destination": "/docs/ecosystem/integrations/redis"
|
||||
"destination": "/docs/integrations/redis"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/replicate.html",
|
||||
"destination": "/docs/ecosystem/integrations/replicate"
|
||||
"destination": "/docs/integrations/replicate"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/roam.html",
|
||||
"destination": "/docs/ecosystem/integrations/roam"
|
||||
"destination": "/docs/integrations/roam"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/runhouse.html",
|
||||
"destination": "/docs/ecosystem/integrations/runhouse"
|
||||
"destination": "/docs/integrations/runhouse"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/rwkv.html",
|
||||
"destination": "/docs/ecosystem/integrations/rwkv"
|
||||
"destination": "/docs/integrations/rwkv"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/sagemaker_endpoint.html",
|
||||
"destination": "/docs/ecosystem/integrations/sagemaker_endpoint"
|
||||
"destination": "/docs/integrations/sagemaker_endpoint"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/searx.html",
|
||||
"destination": "/docs/ecosystem/integrations/searx"
|
||||
"destination": "/docs/integrations/searx"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/serpapi.html",
|
||||
"destination": "/docs/ecosystem/integrations/serpapi"
|
||||
"destination": "/docs/integrations/serpapi"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/shaleprotocol.html",
|
||||
"destination": "/docs/ecosystem/integrations/shaleprotocol"
|
||||
"destination": "/docs/integrations/shaleprotocol"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/sklearn.html",
|
||||
"destination": "/docs/ecosystem/integrations/sklearn"
|
||||
"destination": "/docs/integrations/sklearn"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/slack.html",
|
||||
"destination": "/docs/ecosystem/integrations/slack"
|
||||
"destination": "/docs/integrations/slack"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/spacy.html",
|
||||
"destination": "/docs/ecosystem/integrations/spacy"
|
||||
"destination": "/docs/integrations/spacy"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/spreedly.html",
|
||||
"destination": "/docs/ecosystem/integrations/spreedly"
|
||||
"destination": "/docs/integrations/spreedly"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/stochasticai.html",
|
||||
"destination": "/docs/ecosystem/integrations/stochasticai"
|
||||
"destination": "/docs/integrations/stochasticai"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/stripe.html",
|
||||
"destination": "/docs/ecosystem/integrations/stripe"
|
||||
"destination": "/docs/integrations/stripe"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/tair.html",
|
||||
"destination": "/docs/ecosystem/integrations/tair"
|
||||
"destination": "/docs/integrations/tair"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/telegram.html",
|
||||
"destination": "/docs/ecosystem/integrations/telegram"
|
||||
"destination": "/docs/integrations/telegram"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/tomarkdown.html",
|
||||
"destination": "/docs/ecosystem/integrations/tomarkdown"
|
||||
"destination": "/docs/integrations/tomarkdown"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/trello.html",
|
||||
"destination": "/docs/ecosystem/integrations/trello"
|
||||
"destination": "/docs/integrations/trello"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/twitter.html",
|
||||
"destination": "/docs/ecosystem/integrations/twitter"
|
||||
"destination": "/docs/integrations/twitter"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/unstructured.html",
|
||||
"destination": "/docs/ecosystem/integrations/unstructured"
|
||||
"destination": "/docs/integrations/unstructured"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/vectara/vectara_chat.html",
|
||||
"destination": "/docs/ecosystem/integrations/vectara/vectara_chat"
|
||||
"destination": "/docs/integrations/vectara/vectara_chat"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/vectara/vectara_text_generation.html",
|
||||
"destination": "/docs/ecosystem/integrations/vectara/vectara_text_generation"
|
||||
"destination": "/docs/integrations/vectara/vectara_text_generation"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/vespa.html",
|
||||
"destination": "/docs/ecosystem/integrations/vespa"
|
||||
"destination": "/docs/integrations/vespa"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/wandb_tracking.html",
|
||||
"destination": "/docs/ecosystem/integrations/wandb_tracking"
|
||||
"destination": "/docs/integrations/wandb_tracking"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/weather.html",
|
||||
"destination": "/docs/ecosystem/integrations/weather"
|
||||
"destination": "/docs/integrations/weather"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/weaviate.html",
|
||||
"destination": "/docs/ecosystem/integrations/weaviate"
|
||||
"destination": "/docs/integrations/weaviate"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/whatsapp.html",
|
||||
"destination": "/docs/ecosystem/integrations/whatsapp"
|
||||
"destination": "/docs/integrations/whatsapp"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/whylabs_profiling.html",
|
||||
"destination": "/docs/ecosystem/integrations/whylabs_profiling"
|
||||
"destination": "/docs/integrations/whylabs_profiling"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/wikipedia.html",
|
||||
"destination": "/docs/ecosystem/integrations/wikipedia"
|
||||
"destination": "/docs/integrations/wikipedia"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/wolfram_alpha.html",
|
||||
"destination": "/docs/ecosystem/integrations/wolfram_alpha"
|
||||
"destination": "/docs/integrations/wolfram_alpha"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/writer.html",
|
||||
"destination": "/docs/ecosystem/integrations/writer"
|
||||
"destination": "/docs/integrations/writer"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/yeagerai.html",
|
||||
"destination": "/docs/ecosystem/integrations/yeagerai"
|
||||
"destination": "/docs/integrations/yeagerai"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/youtube.html",
|
||||
"destination": "/docs/ecosystem/integrations/youtube"
|
||||
"destination": "/docs/integrations/youtube"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/zep.html",
|
||||
"destination": "/docs/ecosystem/integrations/zep"
|
||||
"destination": "/docs/integrations/zep"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/integrations/zilliz.html",
|
||||
"destination": "/docs/ecosystem/integrations/zilliz"
|
||||
"destination": "/docs/integrations/zilliz"
|
||||
},
|
||||
{
|
||||
"source": "/docs/ecosystem/integrations/:path*",
|
||||
"destination": "/docs/integrations/:path*"
|
||||
},
|
||||
{
|
||||
"source": "/docs/ecosystem/integrations/",
|
||||
"destination": "/docs/integrations/"
|
||||
},
|
||||
{
|
||||
"source": "/docs/ecosystem/integrations",
|
||||
"destination": "/docs/integrations"
|
||||
},
|
||||
{
|
||||
"source": "/en/latest/ecosystem/deployments.html",
|
||||
|
||||
@@ -4,7 +4,7 @@ cd ..
|
||||
python3 --version
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python3 -m pip install -r requirements.txt
|
||||
python3 -m pip install -r vercel_requirements.txt
|
||||
cp -r extras/* docs_skeleton/docs
|
||||
cd docs_skeleton
|
||||
nbdoc_build
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
# Modal
|
||||
|
||||
This page covers how to use the Modal ecosystem within LangChain.
|
||||
It is broken into two parts: installation and setup, and then references to specific Modal wrappers.
|
||||
|
||||
## Installation and Setup
|
||||
- Install with `pip install modal-client`
|
||||
- Run `modal token new`
|
||||
|
||||
## Define your Modal Functions and Webhooks
|
||||
|
||||
You must include a prompt. There is a rigid response structure.
|
||||
|
||||
```python
|
||||
class Item(BaseModel):
|
||||
prompt: str
|
||||
|
||||
@stub.webhook(method="POST")
|
||||
def my_webhook(item: Item):
|
||||
return {"prompt": my_function.call(item.prompt)}
|
||||
```
|
||||
|
||||
An example with GPT2:
|
||||
|
||||
```python
|
||||
from pydantic import BaseModel
|
||||
|
||||
import modal
|
||||
|
||||
stub = modal.Stub("example-get-started")
|
||||
|
||||
volume = modal.SharedVolume().persist("gpt2_model_vol")
|
||||
CACHE_PATH = "/root/model_cache"
|
||||
|
||||
@stub.function(
|
||||
gpu="any",
|
||||
image=modal.Image.debian_slim().pip_install(
|
||||
"tokenizers", "transformers", "torch", "accelerate"
|
||||
),
|
||||
shared_volumes={CACHE_PATH: volume},
|
||||
retries=3,
|
||||
)
|
||||
def run_gpt2(text: str):
|
||||
from transformers import GPT2Tokenizer, GPT2LMHeadModel
|
||||
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
|
||||
model = GPT2LMHeadModel.from_pretrained('gpt2')
|
||||
encoded_input = tokenizer(text, return_tensors='pt').input_ids
|
||||
output = model.generate(encoded_input, max_length=50, do_sample=True)
|
||||
return tokenizer.decode(output[0], skip_special_tokens=True)
|
||||
|
||||
class Item(BaseModel):
|
||||
prompt: str
|
||||
|
||||
@stub.webhook(method="POST")
|
||||
def get_text(item: Item):
|
||||
return {"prompt": run_gpt2.call(item.prompt)}
|
||||
```
|
||||
|
||||
## Wrappers
|
||||
|
||||
### LLM
|
||||
|
||||
There exists an Modal LLM wrapper, which you can access with
|
||||
```python
|
||||
from langchain.llms import Modal
|
||||
```
|
||||
661
docs/extras/guides/debugging.md
Normal file
661
docs/extras/guides/debugging.md
Normal file
@@ -0,0 +1,661 @@
|
||||
# Debugging
|
||||
|
||||
If you're building with LLMs, at some point something will break, and you'll need to debug. A model call will fail, or the model output will be misformatted, or there will be some nested model calls and it won't be clear where along the way an incorrect output was created.
|
||||
|
||||
Here's a few different tools and functionalities to aid in debugging.
|
||||
|
||||
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! Instead, edit the notebook w/the location & name as this file. -->
|
||||
|
||||
## Tracing
|
||||
|
||||
Platforms with tracing capabilities like [LangSmith](/docs/guides/langsmith/) and [WandB](/docs/ecosystem/integrations/agent_with_wandb_tracing) are the most comprehensive solutions for debugging. These platforms make it easy to not only log and visualize LLM apps, but also to actively debug, test and refine them.
|
||||
|
||||
For anyone building production-grade LLM applications, we highly recommend using a platform like this.
|
||||
|
||||

|
||||
|
||||
## `langchain.debug` and `langchain.verbose`
|
||||
|
||||
If you're prototyping in Jupyter Notebooks or running Python scripts, it can be helpful to print out the intermediate steps of a Chain run.
|
||||
|
||||
There's a number of ways to enable printing at varying degrees of verbosity.
|
||||
|
||||
Let's suppose we have a simple agent and want to visualize the actions it takes and tool outputs it receives. Without any debugging, here's what we see:
|
||||
|
||||
|
||||
```python
|
||||
from langchain.agents import AgentType, initialize_agent, load_tools
|
||||
from langchain.chat_models import ChatOpenAI
|
||||
|
||||
llm = ChatOpenAI(model_name="gpt-4", temperature=0)
|
||||
tools = load_tools(["ddg-search", "llm-math"], llm=llm)
|
||||
agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION)
|
||||
```
|
||||
|
||||
|
||||
```python
|
||||
agent.run("Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?")
|
||||
```
|
||||
|
||||
<CodeOutputBlock lang="python">
|
||||
|
||||
```
|
||||
'The director of the 2023 film Oppenheimer is Christopher Nolan and he is approximately 19345 days old in 2023.'
|
||||
```
|
||||
|
||||
</CodeOutputBlock>
|
||||
|
||||
### `langchain.debug = True`
|
||||
|
||||
Setting the global `debug` flag will cause all LangChain components with callback support (chains, models, agents, tools, retrievers) to print the inputs they receive and outputs they generate. This is the most verbose setting and will fully log raw inputs and outputs.
|
||||
|
||||
|
||||
```python
|
||||
import langchain
|
||||
|
||||
langchain.debug = True
|
||||
|
||||
agent.run("Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?")
|
||||
```
|
||||
|
||||
<details> <summary>Console output</summary>
|
||||
|
||||
<CodeOutputBlock lang="python">
|
||||
|
||||
```
|
||||
[chain/start] [1:RunTypeEnum.chain:AgentExecutor] Entering Chain run with input:
|
||||
{
|
||||
"input": "Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?"
|
||||
}
|
||||
[chain/start] [1:RunTypeEnum.chain:AgentExecutor > 2:RunTypeEnum.chain:LLMChain] Entering Chain run with input:
|
||||
{
|
||||
"input": "Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?",
|
||||
"agent_scratchpad": "",
|
||||
"stop": [
|
||||
"\nObservation:",
|
||||
"\n\tObservation:"
|
||||
]
|
||||
}
|
||||
[llm/start] [1:RunTypeEnum.chain:AgentExecutor > 2:RunTypeEnum.chain:LLMChain > 3:RunTypeEnum.llm:ChatOpenAI] Entering LLM run with input:
|
||||
{
|
||||
"prompts": [
|
||||
"Human: Answer the following questions as best you can. You have access to the following tools:\n\nduckduckgo_search: A wrapper around DuckDuckGo Search. Useful for when you need to answer questions about current events. Input should be a search query.\nCalculator: Useful for when you need to answer questions about math.\n\nUse the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [duckduckgo_search, Calculator]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n\nBegin!\n\nQuestion: Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?\nThought:"
|
||||
]
|
||||
}
|
||||
[llm/end] [1:RunTypeEnum.chain:AgentExecutor > 2:RunTypeEnum.chain:LLMChain > 3:RunTypeEnum.llm:ChatOpenAI] [5.53s] Exiting LLM run with output:
|
||||
{
|
||||
"generations": [
|
||||
[
|
||||
{
|
||||
"text": "I need to find out who directed the 2023 film Oppenheimer and their age. Then, I need to calculate their age in days. I will use DuckDuckGo to find out the director and their age.\nAction: duckduckgo_search\nAction Input: \"Director of the 2023 film Oppenheimer and their age\"",
|
||||
"generation_info": {
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
"message": {
|
||||
"lc": 1,
|
||||
"type": "constructor",
|
||||
"id": [
|
||||
"langchain",
|
||||
"schema",
|
||||
"messages",
|
||||
"AIMessage"
|
||||
],
|
||||
"kwargs": {
|
||||
"content": "I need to find out who directed the 2023 film Oppenheimer and their age. Then, I need to calculate their age in days. I will use DuckDuckGo to find out the director and their age.\nAction: duckduckgo_search\nAction Input: \"Director of the 2023 film Oppenheimer and their age\"",
|
||||
"additional_kwargs": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"llm_output": {
|
||||
"token_usage": {
|
||||
"prompt_tokens": 206,
|
||||
"completion_tokens": 71,
|
||||
"total_tokens": 277
|
||||
},
|
||||
"model_name": "gpt-4"
|
||||
},
|
||||
"run": null
|
||||
}
|
||||
[chain/end] [1:RunTypeEnum.chain:AgentExecutor > 2:RunTypeEnum.chain:LLMChain] [5.53s] Exiting Chain run with output:
|
||||
{
|
||||
"text": "I need to find out who directed the 2023 film Oppenheimer and their age. Then, I need to calculate their age in days. I will use DuckDuckGo to find out the director and their age.\nAction: duckduckgo_search\nAction Input: \"Director of the 2023 film Oppenheimer and their age\""
|
||||
}
|
||||
[tool/start] [1:RunTypeEnum.chain:AgentExecutor > 4:RunTypeEnum.tool:duckduckgo_search] Entering Tool run with input:
|
||||
"Director of the 2023 film Oppenheimer and their age"
|
||||
[tool/end] [1:RunTypeEnum.chain:AgentExecutor > 4:RunTypeEnum.tool:duckduckgo_search] [1.51s] Exiting Tool run with output:
|
||||
"Capturing the mad scramble to build the first atomic bomb required rapid-fire filming, strict set rules and the construction of an entire 1940s western town. By Jada Yuan. July 19, 2023 at 5:00 a ... In Christopher Nolan's new film, "Oppenheimer," Cillian Murphy stars as J. Robert Oppenheimer, the American physicist who oversaw the Manhattan Project in Los Alamos, N.M. Universal Pictures... Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. Christopher Nolan goes deep on 'Oppenheimer,' his most 'extreme' film to date. By Kenneth Turan. July 11, 2023 5 AM PT. For Subscribers. Christopher Nolan is photographed in Los Angeles ... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age."
|
||||
[chain/start] [1:RunTypeEnum.chain:AgentExecutor > 5:RunTypeEnum.chain:LLMChain] Entering Chain run with input:
|
||||
{
|
||||
"input": "Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?",
|
||||
"agent_scratchpad": "I need to find out who directed the 2023 film Oppenheimer and their age. Then, I need to calculate their age in days. I will use DuckDuckGo to find out the director and their age.\nAction: duckduckgo_search\nAction Input: \"Director of the 2023 film Oppenheimer and their age\"\nObservation: Capturing the mad scramble to build the first atomic bomb required rapid-fire filming, strict set rules and the construction of an entire 1940s western town. By Jada Yuan. July 19, 2023 at 5:00 a ... In Christopher Nolan's new film, \"Oppenheimer,\" Cillian Murphy stars as J. Robert Oppenheimer, the American physicist who oversaw the Manhattan Project in Los Alamos, N.M. Universal Pictures... Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. Christopher Nolan goes deep on 'Oppenheimer,' his most 'extreme' film to date. By Kenneth Turan. July 11, 2023 5 AM PT. For Subscribers. Christopher Nolan is photographed in Los Angeles ... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.\nThought:",
|
||||
"stop": [
|
||||
"\nObservation:",
|
||||
"\n\tObservation:"
|
||||
]
|
||||
}
|
||||
[llm/start] [1:RunTypeEnum.chain:AgentExecutor > 5:RunTypeEnum.chain:LLMChain > 6:RunTypeEnum.llm:ChatOpenAI] Entering LLM run with input:
|
||||
{
|
||||
"prompts": [
|
||||
"Human: Answer the following questions as best you can. You have access to the following tools:\n\nduckduckgo_search: A wrapper around DuckDuckGo Search. Useful for when you need to answer questions about current events. Input should be a search query.\nCalculator: Useful for when you need to answer questions about math.\n\nUse the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [duckduckgo_search, Calculator]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n\nBegin!\n\nQuestion: Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?\nThought:I need to find out who directed the 2023 film Oppenheimer and their age. Then, I need to calculate their age in days. I will use DuckDuckGo to find out the director and their age.\nAction: duckduckgo_search\nAction Input: \"Director of the 2023 film Oppenheimer and their age\"\nObservation: Capturing the mad scramble to build the first atomic bomb required rapid-fire filming, strict set rules and the construction of an entire 1940s western town. By Jada Yuan. July 19, 2023 at 5:00 a ... In Christopher Nolan's new film, \"Oppenheimer,\" Cillian Murphy stars as J. Robert Oppenheimer, the American physicist who oversaw the Manhattan Project in Los Alamos, N.M. Universal Pictures... Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. Christopher Nolan goes deep on 'Oppenheimer,' his most 'extreme' film to date. By Kenneth Turan. July 11, 2023 5 AM PT. For Subscribers. Christopher Nolan is photographed in Los Angeles ... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.\nThought:"
|
||||
]
|
||||
}
|
||||
[llm/end] [1:RunTypeEnum.chain:AgentExecutor > 5:RunTypeEnum.chain:LLMChain > 6:RunTypeEnum.llm:ChatOpenAI] [4.46s] Exiting LLM run with output:
|
||||
{
|
||||
"generations": [
|
||||
[
|
||||
{
|
||||
"text": "The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his age.\nAction: duckduckgo_search\nAction Input: \"Christopher Nolan age\"",
|
||||
"generation_info": {
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
"message": {
|
||||
"lc": 1,
|
||||
"type": "constructor",
|
||||
"id": [
|
||||
"langchain",
|
||||
"schema",
|
||||
"messages",
|
||||
"AIMessage"
|
||||
],
|
||||
"kwargs": {
|
||||
"content": "The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his age.\nAction: duckduckgo_search\nAction Input: \"Christopher Nolan age\"",
|
||||
"additional_kwargs": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"llm_output": {
|
||||
"token_usage": {
|
||||
"prompt_tokens": 550,
|
||||
"completion_tokens": 39,
|
||||
"total_tokens": 589
|
||||
},
|
||||
"model_name": "gpt-4"
|
||||
},
|
||||
"run": null
|
||||
}
|
||||
[chain/end] [1:RunTypeEnum.chain:AgentExecutor > 5:RunTypeEnum.chain:LLMChain] [4.46s] Exiting Chain run with output:
|
||||
{
|
||||
"text": "The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his age.\nAction: duckduckgo_search\nAction Input: \"Christopher Nolan age\""
|
||||
}
|
||||
[tool/start] [1:RunTypeEnum.chain:AgentExecutor > 7:RunTypeEnum.tool:duckduckgo_search] Entering Tool run with input:
|
||||
"Christopher Nolan age"
|
||||
[tool/end] [1:RunTypeEnum.chain:AgentExecutor > 7:RunTypeEnum.tool:duckduckgo_search] [1.33s] Exiting Tool run with output:
|
||||
"Christopher Edward Nolan CBE (born 30 July 1970) is a British and American filmmaker. Known for his Hollywood blockbusters with complex storytelling, Nolan is considered a leading filmmaker of the 21st century. His films have grossed $5 billion worldwide. The recipient of many accolades, he has been nominated for five Academy Awards, five BAFTA Awards and six Golden Globe Awards. July 30, 1970 (age 52) London England Notable Works: "Dunkirk" "Tenet" "The Prestige" See all related content → Recent News Jul. 13, 2023, 11:11 AM ET (AP) Cillian Murphy, playing Oppenheimer, finally gets to lead a Christopher Nolan film July 11, 2023 5 AM PT For Subscribers Christopher Nolan is photographed in Los Angeles. (Joe Pugliese / For The Times) This is not the story I was supposed to write. Oppenheimer director Christopher Nolan, Cillian Murphy, Emily Blunt and Matt Damon on the stakes of making a three-hour, CGI-free summer film. Christopher Nolan, the director behind such films as "Dunkirk," "Inception," "Interstellar," and the "Dark Knight" trilogy, has spent the last three years living in Oppenheimer's world, writing ..."
|
||||
[chain/start] [1:RunTypeEnum.chain:AgentExecutor > 8:RunTypeEnum.chain:LLMChain] Entering Chain run with input:
|
||||
{
|
||||
"input": "Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?",
|
||||
"agent_scratchpad": "I need to find out who directed the 2023 film Oppenheimer and their age. Then, I need to calculate their age in days. I will use DuckDuckGo to find out the director and their age.\nAction: duckduckgo_search\nAction Input: \"Director of the 2023 film Oppenheimer and their age\"\nObservation: Capturing the mad scramble to build the first atomic bomb required rapid-fire filming, strict set rules and the construction of an entire 1940s western town. By Jada Yuan. July 19, 2023 at 5:00 a ... In Christopher Nolan's new film, \"Oppenheimer,\" Cillian Murphy stars as J. Robert Oppenheimer, the American physicist who oversaw the Manhattan Project in Los Alamos, N.M. Universal Pictures... Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. Christopher Nolan goes deep on 'Oppenheimer,' his most 'extreme' film to date. By Kenneth Turan. July 11, 2023 5 AM PT. For Subscribers. Christopher Nolan is photographed in Los Angeles ... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.\nThought:The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his age.\nAction: duckduckgo_search\nAction Input: \"Christopher Nolan age\"\nObservation: Christopher Edward Nolan CBE (born 30 July 1970) is a British and American filmmaker. Known for his Hollywood blockbusters with complex storytelling, Nolan is considered a leading filmmaker of the 21st century. His films have grossed $5 billion worldwide. The recipient of many accolades, he has been nominated for five Academy Awards, five BAFTA Awards and six Golden Globe Awards. July 30, 1970 (age 52) London England Notable Works: \"Dunkirk\" \"Tenet\" \"The Prestige\" See all related content → Recent News Jul. 13, 2023, 11:11 AM ET (AP) Cillian Murphy, playing Oppenheimer, finally gets to lead a Christopher Nolan film July 11, 2023 5 AM PT For Subscribers Christopher Nolan is photographed in Los Angeles. (Joe Pugliese / For The Times) This is not the story I was supposed to write. Oppenheimer director Christopher Nolan, Cillian Murphy, Emily Blunt and Matt Damon on the stakes of making a three-hour, CGI-free summer film. Christopher Nolan, the director behind such films as \"Dunkirk,\" \"Inception,\" \"Interstellar,\" and the \"Dark Knight\" trilogy, has spent the last three years living in Oppenheimer's world, writing ...\nThought:",
|
||||
"stop": [
|
||||
"\nObservation:",
|
||||
"\n\tObservation:"
|
||||
]
|
||||
}
|
||||
[llm/start] [1:RunTypeEnum.chain:AgentExecutor > 8:RunTypeEnum.chain:LLMChain > 9:RunTypeEnum.llm:ChatOpenAI] Entering LLM run with input:
|
||||
{
|
||||
"prompts": [
|
||||
"Human: Answer the following questions as best you can. You have access to the following tools:\n\nduckduckgo_search: A wrapper around DuckDuckGo Search. Useful for when you need to answer questions about current events. Input should be a search query.\nCalculator: Useful for when you need to answer questions about math.\n\nUse the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [duckduckgo_search, Calculator]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n\nBegin!\n\nQuestion: Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?\nThought:I need to find out who directed the 2023 film Oppenheimer and their age. Then, I need to calculate their age in days. I will use DuckDuckGo to find out the director and their age.\nAction: duckduckgo_search\nAction Input: \"Director of the 2023 film Oppenheimer and their age\"\nObservation: Capturing the mad scramble to build the first atomic bomb required rapid-fire filming, strict set rules and the construction of an entire 1940s western town. By Jada Yuan. July 19, 2023 at 5:00 a ... In Christopher Nolan's new film, \"Oppenheimer,\" Cillian Murphy stars as J. Robert Oppenheimer, the American physicist who oversaw the Manhattan Project in Los Alamos, N.M. Universal Pictures... Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. Christopher Nolan goes deep on 'Oppenheimer,' his most 'extreme' film to date. By Kenneth Turan. July 11, 2023 5 AM PT. For Subscribers. Christopher Nolan is photographed in Los Angeles ... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.\nThought:The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his age.\nAction: duckduckgo_search\nAction Input: \"Christopher Nolan age\"\nObservation: Christopher Edward Nolan CBE (born 30 July 1970) is a British and American filmmaker. Known for his Hollywood blockbusters with complex storytelling, Nolan is considered a leading filmmaker of the 21st century. His films have grossed $5 billion worldwide. The recipient of many accolades, he has been nominated for five Academy Awards, five BAFTA Awards and six Golden Globe Awards. July 30, 1970 (age 52) London England Notable Works: \"Dunkirk\" \"Tenet\" \"The Prestige\" See all related content → Recent News Jul. 13, 2023, 11:11 AM ET (AP) Cillian Murphy, playing Oppenheimer, finally gets to lead a Christopher Nolan film July 11, 2023 5 AM PT For Subscribers Christopher Nolan is photographed in Los Angeles. (Joe Pugliese / For The Times) This is not the story I was supposed to write. Oppenheimer director Christopher Nolan, Cillian Murphy, Emily Blunt and Matt Damon on the stakes of making a three-hour, CGI-free summer film. Christopher Nolan, the director behind such films as \"Dunkirk,\" \"Inception,\" \"Interstellar,\" and the \"Dark Knight\" trilogy, has spent the last three years living in Oppenheimer's world, writing ...\nThought:"
|
||||
]
|
||||
}
|
||||
[llm/end] [1:RunTypeEnum.chain:AgentExecutor > 8:RunTypeEnum.chain:LLMChain > 9:RunTypeEnum.llm:ChatOpenAI] [2.69s] Exiting LLM run with output:
|
||||
{
|
||||
"generations": [
|
||||
[
|
||||
{
|
||||
"text": "Christopher Nolan was born on July 30, 1970, which makes him 52 years old in 2023. Now I need to calculate his age in days.\nAction: Calculator\nAction Input: 52*365",
|
||||
"generation_info": {
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
"message": {
|
||||
"lc": 1,
|
||||
"type": "constructor",
|
||||
"id": [
|
||||
"langchain",
|
||||
"schema",
|
||||
"messages",
|
||||
"AIMessage"
|
||||
],
|
||||
"kwargs": {
|
||||
"content": "Christopher Nolan was born on July 30, 1970, which makes him 52 years old in 2023. Now I need to calculate his age in days.\nAction: Calculator\nAction Input: 52*365",
|
||||
"additional_kwargs": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"llm_output": {
|
||||
"token_usage": {
|
||||
"prompt_tokens": 868,
|
||||
"completion_tokens": 46,
|
||||
"total_tokens": 914
|
||||
},
|
||||
"model_name": "gpt-4"
|
||||
},
|
||||
"run": null
|
||||
}
|
||||
[chain/end] [1:RunTypeEnum.chain:AgentExecutor > 8:RunTypeEnum.chain:LLMChain] [2.69s] Exiting Chain run with output:
|
||||
{
|
||||
"text": "Christopher Nolan was born on July 30, 1970, which makes him 52 years old in 2023. Now I need to calculate his age in days.\nAction: Calculator\nAction Input: 52*365"
|
||||
}
|
||||
[tool/start] [1:RunTypeEnum.chain:AgentExecutor > 10:RunTypeEnum.tool:Calculator] Entering Tool run with input:
|
||||
"52*365"
|
||||
[chain/start] [1:RunTypeEnum.chain:AgentExecutor > 10:RunTypeEnum.tool:Calculator > 11:RunTypeEnum.chain:LLMMathChain] Entering Chain run with input:
|
||||
{
|
||||
"question": "52*365"
|
||||
}
|
||||
[chain/start] [1:RunTypeEnum.chain:AgentExecutor > 10:RunTypeEnum.tool:Calculator > 11:RunTypeEnum.chain:LLMMathChain > 12:RunTypeEnum.chain:LLMChain] Entering Chain run with input:
|
||||
{
|
||||
"question": "52*365",
|
||||
"stop": [
|
||||
"```output"
|
||||
]
|
||||
}
|
||||
[llm/start] [1:RunTypeEnum.chain:AgentExecutor > 10:RunTypeEnum.tool:Calculator > 11:RunTypeEnum.chain:LLMMathChain > 12:RunTypeEnum.chain:LLMChain > 13:RunTypeEnum.llm:ChatOpenAI] Entering LLM run with input:
|
||||
{
|
||||
"prompts": [
|
||||
"Human: Translate a math problem into a expression that can be executed using Python's numexpr library. Use the output of running this code to answer the question.\n\nQuestion: ${Question with math problem.}\n```text\n${single line mathematical expression that solves the problem}\n```\n...numexpr.evaluate(text)...\n```output\n${Output of running the code}\n```\nAnswer: ${Answer}\n\nBegin.\n\nQuestion: What is 37593 * 67?\n```text\n37593 * 67\n```\n...numexpr.evaluate(\"37593 * 67\")...\n```output\n2518731\n```\nAnswer: 2518731\n\nQuestion: 37593^(1/5)\n```text\n37593**(1/5)\n```\n...numexpr.evaluate(\"37593**(1/5)\")...\n```output\n8.222831614237718\n```\nAnswer: 8.222831614237718\n\nQuestion: 52*365"
|
||||
]
|
||||
}
|
||||
[llm/end] [1:RunTypeEnum.chain:AgentExecutor > 10:RunTypeEnum.tool:Calculator > 11:RunTypeEnum.chain:LLMMathChain > 12:RunTypeEnum.chain:LLMChain > 13:RunTypeEnum.llm:ChatOpenAI] [2.89s] Exiting LLM run with output:
|
||||
{
|
||||
"generations": [
|
||||
[
|
||||
{
|
||||
"text": "```text\n52*365\n```\n...numexpr.evaluate(\"52*365\")...\n",
|
||||
"generation_info": {
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
"message": {
|
||||
"lc": 1,
|
||||
"type": "constructor",
|
||||
"id": [
|
||||
"langchain",
|
||||
"schema",
|
||||
"messages",
|
||||
"AIMessage"
|
||||
],
|
||||
"kwargs": {
|
||||
"content": "```text\n52*365\n```\n...numexpr.evaluate(\"52*365\")...\n",
|
||||
"additional_kwargs": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"llm_output": {
|
||||
"token_usage": {
|
||||
"prompt_tokens": 203,
|
||||
"completion_tokens": 19,
|
||||
"total_tokens": 222
|
||||
},
|
||||
"model_name": "gpt-4"
|
||||
},
|
||||
"run": null
|
||||
}
|
||||
[chain/end] [1:RunTypeEnum.chain:AgentExecutor > 10:RunTypeEnum.tool:Calculator > 11:RunTypeEnum.chain:LLMMathChain > 12:RunTypeEnum.chain:LLMChain] [2.89s] Exiting Chain run with output:
|
||||
{
|
||||
"text": "```text\n52*365\n```\n...numexpr.evaluate(\"52*365\")...\n"
|
||||
}
|
||||
[chain/end] [1:RunTypeEnum.chain:AgentExecutor > 10:RunTypeEnum.tool:Calculator > 11:RunTypeEnum.chain:LLMMathChain] [2.90s] Exiting Chain run with output:
|
||||
{
|
||||
"answer": "Answer: 18980"
|
||||
}
|
||||
[tool/end] [1:RunTypeEnum.chain:AgentExecutor > 10:RunTypeEnum.tool:Calculator] [2.90s] Exiting Tool run with output:
|
||||
"Answer: 18980"
|
||||
[chain/start] [1:RunTypeEnum.chain:AgentExecutor > 14:RunTypeEnum.chain:LLMChain] Entering Chain run with input:
|
||||
{
|
||||
"input": "Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?",
|
||||
"agent_scratchpad": "I need to find out who directed the 2023 film Oppenheimer and their age. Then, I need to calculate their age in days. I will use DuckDuckGo to find out the director and their age.\nAction: duckduckgo_search\nAction Input: \"Director of the 2023 film Oppenheimer and their age\"\nObservation: Capturing the mad scramble to build the first atomic bomb required rapid-fire filming, strict set rules and the construction of an entire 1940s western town. By Jada Yuan. July 19, 2023 at 5:00 a ... In Christopher Nolan's new film, \"Oppenheimer,\" Cillian Murphy stars as J. Robert Oppenheimer, the American physicist who oversaw the Manhattan Project in Los Alamos, N.M. Universal Pictures... Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. Christopher Nolan goes deep on 'Oppenheimer,' his most 'extreme' film to date. By Kenneth Turan. July 11, 2023 5 AM PT. For Subscribers. Christopher Nolan is photographed in Los Angeles ... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.\nThought:The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his age.\nAction: duckduckgo_search\nAction Input: \"Christopher Nolan age\"\nObservation: Christopher Edward Nolan CBE (born 30 July 1970) is a British and American filmmaker. Known for his Hollywood blockbusters with complex storytelling, Nolan is considered a leading filmmaker of the 21st century. His films have grossed $5 billion worldwide. The recipient of many accolades, he has been nominated for five Academy Awards, five BAFTA Awards and six Golden Globe Awards. July 30, 1970 (age 52) London England Notable Works: \"Dunkirk\" \"Tenet\" \"The Prestige\" See all related content → Recent News Jul. 13, 2023, 11:11 AM ET (AP) Cillian Murphy, playing Oppenheimer, finally gets to lead a Christopher Nolan film July 11, 2023 5 AM PT For Subscribers Christopher Nolan is photographed in Los Angeles. (Joe Pugliese / For The Times) This is not the story I was supposed to write. Oppenheimer director Christopher Nolan, Cillian Murphy, Emily Blunt and Matt Damon on the stakes of making a three-hour, CGI-free summer film. Christopher Nolan, the director behind such films as \"Dunkirk,\" \"Inception,\" \"Interstellar,\" and the \"Dark Knight\" trilogy, has spent the last three years living in Oppenheimer's world, writing ...\nThought:Christopher Nolan was born on July 30, 1970, which makes him 52 years old in 2023. Now I need to calculate his age in days.\nAction: Calculator\nAction Input: 52*365\nObservation: Answer: 18980\nThought:",
|
||||
"stop": [
|
||||
"\nObservation:",
|
||||
"\n\tObservation:"
|
||||
]
|
||||
}
|
||||
[llm/start] [1:RunTypeEnum.chain:AgentExecutor > 14:RunTypeEnum.chain:LLMChain > 15:RunTypeEnum.llm:ChatOpenAI] Entering LLM run with input:
|
||||
{
|
||||
"prompts": [
|
||||
"Human: Answer the following questions as best you can. You have access to the following tools:\n\nduckduckgo_search: A wrapper around DuckDuckGo Search. Useful for when you need to answer questions about current events. Input should be a search query.\nCalculator: Useful for when you need to answer questions about math.\n\nUse the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [duckduckgo_search, Calculator]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n\nBegin!\n\nQuestion: Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?\nThought:I need to find out who directed the 2023 film Oppenheimer and their age. Then, I need to calculate their age in days. I will use DuckDuckGo to find out the director and their age.\nAction: duckduckgo_search\nAction Input: \"Director of the 2023 film Oppenheimer and their age\"\nObservation: Capturing the mad scramble to build the first atomic bomb required rapid-fire filming, strict set rules and the construction of an entire 1940s western town. By Jada Yuan. July 19, 2023 at 5:00 a ... In Christopher Nolan's new film, \"Oppenheimer,\" Cillian Murphy stars as J. Robert Oppenheimer, the American physicist who oversaw the Manhattan Project in Los Alamos, N.M. Universal Pictures... Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. Christopher Nolan goes deep on 'Oppenheimer,' his most 'extreme' film to date. By Kenneth Turan. July 11, 2023 5 AM PT. For Subscribers. Christopher Nolan is photographed in Los Angeles ... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.\nThought:The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his age.\nAction: duckduckgo_search\nAction Input: \"Christopher Nolan age\"\nObservation: Christopher Edward Nolan CBE (born 30 July 1970) is a British and American filmmaker. Known for his Hollywood blockbusters with complex storytelling, Nolan is considered a leading filmmaker of the 21st century. His films have grossed $5 billion worldwide. The recipient of many accolades, he has been nominated for five Academy Awards, five BAFTA Awards and six Golden Globe Awards. July 30, 1970 (age 52) London England Notable Works: \"Dunkirk\" \"Tenet\" \"The Prestige\" See all related content → Recent News Jul. 13, 2023, 11:11 AM ET (AP) Cillian Murphy, playing Oppenheimer, finally gets to lead a Christopher Nolan film July 11, 2023 5 AM PT For Subscribers Christopher Nolan is photographed in Los Angeles. (Joe Pugliese / For The Times) This is not the story I was supposed to write. Oppenheimer director Christopher Nolan, Cillian Murphy, Emily Blunt and Matt Damon on the stakes of making a three-hour, CGI-free summer film. Christopher Nolan, the director behind such films as \"Dunkirk,\" \"Inception,\" \"Interstellar,\" and the \"Dark Knight\" trilogy, has spent the last three years living in Oppenheimer's world, writing ...\nThought:Christopher Nolan was born on July 30, 1970, which makes him 52 years old in 2023. Now I need to calculate his age in days.\nAction: Calculator\nAction Input: 52*365\nObservation: Answer: 18980\nThought:"
|
||||
]
|
||||
}
|
||||
[llm/end] [1:RunTypeEnum.chain:AgentExecutor > 14:RunTypeEnum.chain:LLMChain > 15:RunTypeEnum.llm:ChatOpenAI] [3.52s] Exiting LLM run with output:
|
||||
{
|
||||
"generations": [
|
||||
[
|
||||
{
|
||||
"text": "I now know the final answer\nFinal Answer: The director of the 2023 film Oppenheimer is Christopher Nolan and he is 52 years old. His age in days is approximately 18980 days.",
|
||||
"generation_info": {
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
"message": {
|
||||
"lc": 1,
|
||||
"type": "constructor",
|
||||
"id": [
|
||||
"langchain",
|
||||
"schema",
|
||||
"messages",
|
||||
"AIMessage"
|
||||
],
|
||||
"kwargs": {
|
||||
"content": "I now know the final answer\nFinal Answer: The director of the 2023 film Oppenheimer is Christopher Nolan and he is 52 years old. His age in days is approximately 18980 days.",
|
||||
"additional_kwargs": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"llm_output": {
|
||||
"token_usage": {
|
||||
"prompt_tokens": 926,
|
||||
"completion_tokens": 43,
|
||||
"total_tokens": 969
|
||||
},
|
||||
"model_name": "gpt-4"
|
||||
},
|
||||
"run": null
|
||||
}
|
||||
[chain/end] [1:RunTypeEnum.chain:AgentExecutor > 14:RunTypeEnum.chain:LLMChain] [3.52s] Exiting Chain run with output:
|
||||
{
|
||||
"text": "I now know the final answer\nFinal Answer: The director of the 2023 film Oppenheimer is Christopher Nolan and he is 52 years old. His age in days is approximately 18980 days."
|
||||
}
|
||||
[chain/end] [1:RunTypeEnum.chain:AgentExecutor] [21.96s] Exiting Chain run with output:
|
||||
{
|
||||
"output": "The director of the 2023 film Oppenheimer is Christopher Nolan and he is 52 years old. His age in days is approximately 18980 days."
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'The director of the 2023 film Oppenheimer is Christopher Nolan and he is 52 years old. His age in days is approximately 18980 days.'
|
||||
```
|
||||
|
||||
</CodeOutputBlock>
|
||||
|
||||
</details>
|
||||
|
||||
### `langchain.verbose = True`
|
||||
|
||||
Setting the `verbose` flag will print out inputs and outputs in a slightly more readable format and will skip logging certain raw outputs (like the token usage stats for an LLM call) so that you can focus on application logic.
|
||||
|
||||
|
||||
```python
|
||||
import langchain
|
||||
|
||||
langchain.verbose = True
|
||||
|
||||
agent.run("Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?")
|
||||
```
|
||||
|
||||
<details> <summary>Console output</summary>
|
||||
|
||||
<CodeOutputBlock lang="python">
|
||||
|
||||
```
|
||||
|
||||
|
||||
> Entering new AgentExecutor chain...
|
||||
|
||||
|
||||
> Entering new LLMChain chain...
|
||||
Prompt after formatting:
|
||||
Answer the following questions as best you can. You have access to the following tools:
|
||||
|
||||
duckduckgo_search: A wrapper around DuckDuckGo Search. Useful for when you need to answer questions about current events. Input should be a search query.
|
||||
Calculator: Useful for when you need to answer questions about math.
|
||||
|
||||
Use the following format:
|
||||
|
||||
Question: the input question you must answer
|
||||
Thought: you should always think about what to do
|
||||
Action: the action to take, should be one of [duckduckgo_search, Calculator]
|
||||
Action Input: the input to the action
|
||||
Observation: the result of the action
|
||||
... (this Thought/Action/Action Input/Observation can repeat N times)
|
||||
Thought: I now know the final answer
|
||||
Final Answer: the final answer to the original input question
|
||||
|
||||
Begin!
|
||||
|
||||
Question: Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?
|
||||
Thought:
|
||||
|
||||
> Finished chain.
|
||||
First, I need to find out who directed the film Oppenheimer in 2023 and their birth date to calculate their age.
|
||||
Action: duckduckgo_search
|
||||
Action Input: "Director of the 2023 film Oppenheimer"
|
||||
Observation: Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. In Christopher Nolan's new film, "Oppenheimer," Cillian Murphy stars as J. Robert ... 2023, 12:16 p.m. ET. ... including his role as the director of the Manhattan Engineer District, better ... J Robert Oppenheimer was the director of the secret Los Alamos Laboratory. It was established under US president Franklin D Roosevelt as part of the Manhattan Project to build the first atomic bomb. He oversaw the first atomic bomb detonation in the New Mexico desert in July 1945, code-named "Trinity". In this opening salvo of 2023's Oscar battle, Nolan has enjoined a star-studded cast for a retelling of the brilliant and haunted life of J. Robert Oppenheimer, the American physicist whose... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.
|
||||
Thought:
|
||||
|
||||
> Entering new LLMChain chain...
|
||||
Prompt after formatting:
|
||||
Answer the following questions as best you can. You have access to the following tools:
|
||||
|
||||
duckduckgo_search: A wrapper around DuckDuckGo Search. Useful for when you need to answer questions about current events. Input should be a search query.
|
||||
Calculator: Useful for when you need to answer questions about math.
|
||||
|
||||
Use the following format:
|
||||
|
||||
Question: the input question you must answer
|
||||
Thought: you should always think about what to do
|
||||
Action: the action to take, should be one of [duckduckgo_search, Calculator]
|
||||
Action Input: the input to the action
|
||||
Observation: the result of the action
|
||||
... (this Thought/Action/Action Input/Observation can repeat N times)
|
||||
Thought: I now know the final answer
|
||||
Final Answer: the final answer to the original input question
|
||||
|
||||
Begin!
|
||||
|
||||
Question: Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?
|
||||
Thought:First, I need to find out who directed the film Oppenheimer in 2023 and their birth date to calculate their age.
|
||||
Action: duckduckgo_search
|
||||
Action Input: "Director of the 2023 film Oppenheimer"
|
||||
Observation: Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. In Christopher Nolan's new film, "Oppenheimer," Cillian Murphy stars as J. Robert ... 2023, 12:16 p.m. ET. ... including his role as the director of the Manhattan Engineer District, better ... J Robert Oppenheimer was the director of the secret Los Alamos Laboratory. It was established under US president Franklin D Roosevelt as part of the Manhattan Project to build the first atomic bomb. He oversaw the first atomic bomb detonation in the New Mexico desert in July 1945, code-named "Trinity". In this opening salvo of 2023's Oscar battle, Nolan has enjoined a star-studded cast for a retelling of the brilliant and haunted life of J. Robert Oppenheimer, the American physicist whose... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.
|
||||
Thought:
|
||||
|
||||
> Finished chain.
|
||||
The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his birth date to calculate his age.
|
||||
Action: duckduckgo_search
|
||||
Action Input: "Christopher Nolan birth date"
|
||||
Observation: July 30, 1970 (age 52) London England Notable Works: "Dunkirk" "Tenet" "The Prestige" See all related content → Recent News Jul. 13, 2023, 11:11 AM ET (AP) Cillian Murphy, playing Oppenheimer, finally gets to lead a Christopher Nolan film Christopher Edward Nolan CBE (born 30 July 1970) is a British and American filmmaker. Known for his Hollywood blockbusters with complex storytelling, Nolan is considered a leading filmmaker of the 21st century. His films have grossed $5 billion worldwide. The recipient of many accolades, he has been nominated for five Academy Awards, five BAFTA Awards and six Golden Globe Awards. Christopher Nolan is currently 52 according to his birthdate July 30, 1970 Sun Sign Leo Born Place Westminster, London, England, United Kingdom Residence Los Angeles, California, United States Nationality Education Chris attended Haileybury and Imperial Service College, in Hertford Heath, Hertfordshire. Christopher Nolan's next movie will study the man who developed the atomic bomb, J. Robert Oppenheimer. Here's the release date, plot, trailers & more. July 2023 sees the release of Christopher Nolan's new film, Oppenheimer, his first movie since 2020's Tenet and his split from Warner Bros. Billed as an epic thriller about "the man who ...
|
||||
Thought:
|
||||
|
||||
> Entering new LLMChain chain...
|
||||
Prompt after formatting:
|
||||
Answer the following questions as best you can. You have access to the following tools:
|
||||
|
||||
duckduckgo_search: A wrapper around DuckDuckGo Search. Useful for when you need to answer questions about current events. Input should be a search query.
|
||||
Calculator: Useful for when you need to answer questions about math.
|
||||
|
||||
Use the following format:
|
||||
|
||||
Question: the input question you must answer
|
||||
Thought: you should always think about what to do
|
||||
Action: the action to take, should be one of [duckduckgo_search, Calculator]
|
||||
Action Input: the input to the action
|
||||
Observation: the result of the action
|
||||
... (this Thought/Action/Action Input/Observation can repeat N times)
|
||||
Thought: I now know the final answer
|
||||
Final Answer: the final answer to the original input question
|
||||
|
||||
Begin!
|
||||
|
||||
Question: Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?
|
||||
Thought:First, I need to find out who directed the film Oppenheimer in 2023 and their birth date to calculate their age.
|
||||
Action: duckduckgo_search
|
||||
Action Input: "Director of the 2023 film Oppenheimer"
|
||||
Observation: Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. In Christopher Nolan's new film, "Oppenheimer," Cillian Murphy stars as J. Robert ... 2023, 12:16 p.m. ET. ... including his role as the director of the Manhattan Engineer District, better ... J Robert Oppenheimer was the director of the secret Los Alamos Laboratory. It was established under US president Franklin D Roosevelt as part of the Manhattan Project to build the first atomic bomb. He oversaw the first atomic bomb detonation in the New Mexico desert in July 1945, code-named "Trinity". In this opening salvo of 2023's Oscar battle, Nolan has enjoined a star-studded cast for a retelling of the brilliant and haunted life of J. Robert Oppenheimer, the American physicist whose... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.
|
||||
Thought:The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his birth date to calculate his age.
|
||||
Action: duckduckgo_search
|
||||
Action Input: "Christopher Nolan birth date"
|
||||
Observation: July 30, 1970 (age 52) London England Notable Works: "Dunkirk" "Tenet" "The Prestige" See all related content → Recent News Jul. 13, 2023, 11:11 AM ET (AP) Cillian Murphy, playing Oppenheimer, finally gets to lead a Christopher Nolan film Christopher Edward Nolan CBE (born 30 July 1970) is a British and American filmmaker. Known for his Hollywood blockbusters with complex storytelling, Nolan is considered a leading filmmaker of the 21st century. His films have grossed $5 billion worldwide. The recipient of many accolades, he has been nominated for five Academy Awards, five BAFTA Awards and six Golden Globe Awards. Christopher Nolan is currently 52 according to his birthdate July 30, 1970 Sun Sign Leo Born Place Westminster, London, England, United Kingdom Residence Los Angeles, California, United States Nationality Education Chris attended Haileybury and Imperial Service College, in Hertford Heath, Hertfordshire. Christopher Nolan's next movie will study the man who developed the atomic bomb, J. Robert Oppenheimer. Here's the release date, plot, trailers & more. July 2023 sees the release of Christopher Nolan's new film, Oppenheimer, his first movie since 2020's Tenet and his split from Warner Bros. Billed as an epic thriller about "the man who ...
|
||||
Thought:
|
||||
|
||||
> Finished chain.
|
||||
Christopher Nolan was born on July 30, 1970. Now I need to calculate his age in 2023 and then convert it into days.
|
||||
Action: Calculator
|
||||
Action Input: (2023 - 1970) * 365
|
||||
|
||||
> Entering new LLMMathChain chain...
|
||||
(2023 - 1970) * 365
|
||||
|
||||
> Entering new LLMChain chain...
|
||||
Prompt after formatting:
|
||||
Translate a math problem into a expression that can be executed using Python's numexpr library. Use the output of running this code to answer the question.
|
||||
|
||||
Question: ${Question with math problem.}
|
||||
```text
|
||||
${single line mathematical expression that solves the problem}
|
||||
```
|
||||
...numexpr.evaluate(text)...
|
||||
```output
|
||||
${Output of running the code}
|
||||
```
|
||||
Answer: ${Answer}
|
||||
|
||||
Begin.
|
||||
|
||||
Question: What is 37593 * 67?
|
||||
```text
|
||||
37593 * 67
|
||||
```
|
||||
...numexpr.evaluate("37593 * 67")...
|
||||
```output
|
||||
2518731
|
||||
```
|
||||
Answer: 2518731
|
||||
|
||||
Question: 37593^(1/5)
|
||||
```text
|
||||
37593**(1/5)
|
||||
```
|
||||
...numexpr.evaluate("37593**(1/5)")...
|
||||
```output
|
||||
8.222831614237718
|
||||
```
|
||||
Answer: 8.222831614237718
|
||||
|
||||
Question: (2023 - 1970) * 365
|
||||
|
||||
|
||||
> Finished chain.
|
||||
```text
|
||||
(2023 - 1970) * 365
|
||||
```
|
||||
...numexpr.evaluate("(2023 - 1970) * 365")...
|
||||
|
||||
Answer: 19345
|
||||
> Finished chain.
|
||||
|
||||
Observation: Answer: 19345
|
||||
Thought:
|
||||
|
||||
> Entering new LLMChain chain...
|
||||
Prompt after formatting:
|
||||
Answer the following questions as best you can. You have access to the following tools:
|
||||
|
||||
duckduckgo_search: A wrapper around DuckDuckGo Search. Useful for when you need to answer questions about current events. Input should be a search query.
|
||||
Calculator: Useful for when you need to answer questions about math.
|
||||
|
||||
Use the following format:
|
||||
|
||||
Question: the input question you must answer
|
||||
Thought: you should always think about what to do
|
||||
Action: the action to take, should be one of [duckduckgo_search, Calculator]
|
||||
Action Input: the input to the action
|
||||
Observation: the result of the action
|
||||
... (this Thought/Action/Action Input/Observation can repeat N times)
|
||||
Thought: I now know the final answer
|
||||
Final Answer: the final answer to the original input question
|
||||
|
||||
Begin!
|
||||
|
||||
Question: Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?
|
||||
Thought:First, I need to find out who directed the film Oppenheimer in 2023 and their birth date to calculate their age.
|
||||
Action: duckduckgo_search
|
||||
Action Input: "Director of the 2023 film Oppenheimer"
|
||||
Observation: Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. In Christopher Nolan's new film, "Oppenheimer," Cillian Murphy stars as J. Robert ... 2023, 12:16 p.m. ET. ... including his role as the director of the Manhattan Engineer District, better ... J Robert Oppenheimer was the director of the secret Los Alamos Laboratory. It was established under US president Franklin D Roosevelt as part of the Manhattan Project to build the first atomic bomb. He oversaw the first atomic bomb detonation in the New Mexico desert in July 1945, code-named "Trinity". In this opening salvo of 2023's Oscar battle, Nolan has enjoined a star-studded cast for a retelling of the brilliant and haunted life of J. Robert Oppenheimer, the American physicist whose... Oppenheimer is a 2023 epic biographical thriller film written and directed by Christopher Nolan.It is based on the 2005 biography American Prometheus by Kai Bird and Martin J. Sherwin about J. Robert Oppenheimer, a theoretical physicist who was pivotal in developing the first nuclear weapons as part of the Manhattan Project and thereby ushering in the Atomic Age.
|
||||
Thought:The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his birth date to calculate his age.
|
||||
Action: duckduckgo_search
|
||||
Action Input: "Christopher Nolan birth date"
|
||||
Observation: July 30, 1970 (age 52) London England Notable Works: "Dunkirk" "Tenet" "The Prestige" See all related content → Recent News Jul. 13, 2023, 11:11 AM ET (AP) Cillian Murphy, playing Oppenheimer, finally gets to lead a Christopher Nolan film Christopher Edward Nolan CBE (born 30 July 1970) is a British and American filmmaker. Known for his Hollywood blockbusters with complex storytelling, Nolan is considered a leading filmmaker of the 21st century. His films have grossed $5 billion worldwide. The recipient of many accolades, he has been nominated for five Academy Awards, five BAFTA Awards and six Golden Globe Awards. Christopher Nolan is currently 52 according to his birthdate July 30, 1970 Sun Sign Leo Born Place Westminster, London, England, United Kingdom Residence Los Angeles, California, United States Nationality Education Chris attended Haileybury and Imperial Service College, in Hertford Heath, Hertfordshire. Christopher Nolan's next movie will study the man who developed the atomic bomb, J. Robert Oppenheimer. Here's the release date, plot, trailers & more. July 2023 sees the release of Christopher Nolan's new film, Oppenheimer, his first movie since 2020's Tenet and his split from Warner Bros. Billed as an epic thriller about "the man who ...
|
||||
Thought:Christopher Nolan was born on July 30, 1970. Now I need to calculate his age in 2023 and then convert it into days.
|
||||
Action: Calculator
|
||||
Action Input: (2023 - 1970) * 365
|
||||
Observation: Answer: 19345
|
||||
Thought:
|
||||
|
||||
> Finished chain.
|
||||
I now know the final answer
|
||||
Final Answer: The director of the 2023 film Oppenheimer is Christopher Nolan and he is 53 years old in 2023. His age in days is 19345 days.
|
||||
|
||||
> Finished chain.
|
||||
|
||||
|
||||
'The director of the 2023 film Oppenheimer is Christopher Nolan and he is 53 years old in 2023. His age in days is 19345 days.'
|
||||
```
|
||||
|
||||
</CodeOutputBlock>
|
||||
|
||||
</details>
|
||||
|
||||
### `Chain(..., verbose=True)`
|
||||
|
||||
You can also scope verbosity down to a single object, in which case only the inputs and outputs to that object are printed (along with any additional callbacks calls made specifically by that object).
|
||||
|
||||
|
||||
```python
|
||||
# Passing verbose=True to initialize_agent will pass that along to the AgentExecutor (which is a Chain).
|
||||
agent = initialize_agent(
|
||||
tools,
|
||||
llm,
|
||||
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
agent.run("Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?")
|
||||
```
|
||||
|
||||
<details> <summary>Console output</summary>
|
||||
|
||||
<CodeOutputBlock lang="python">
|
||||
|
||||
```
|
||||
> Entering new AgentExecutor chain...
|
||||
First, I need to find out who directed the film Oppenheimer in 2023 and their birth date. Then, I can calculate their age in years and days.
|
||||
Action: duckduckgo_search
|
||||
Action Input: "Director of 2023 film Oppenheimer"
|
||||
Observation: Oppenheimer: Directed by Christopher Nolan. With Cillian Murphy, Emily Blunt, Robert Downey Jr., Alden Ehrenreich. The story of American scientist J. Robert Oppenheimer and his role in the development of the atomic bomb. In Christopher Nolan's new film, "Oppenheimer," Cillian Murphy stars as J. Robert Oppenheimer, the American physicist who oversaw the Manhattan Project in Los Alamos, N.M. Universal Pictures... J Robert Oppenheimer was the director of the secret Los Alamos Laboratory. It was established under US president Franklin D Roosevelt as part of the Manhattan Project to build the first atomic bomb. He oversaw the first atomic bomb detonation in the New Mexico desert in July 1945, code-named "Trinity". A Review of Christopher Nolan's new film 'Oppenheimer' , the story of the man who fathered the Atomic Bomb. Cillian Murphy leads an all star cast ... Release Date: July 21, 2023. Director ... For his new film, "Oppenheimer," starring Cillian Murphy and Emily Blunt, director Christopher Nolan set out to build an entire 1940s western town.
|
||||
Thought:The director of the 2023 film Oppenheimer is Christopher Nolan. Now I need to find out his birth date to calculate his age.
|
||||
Action: duckduckgo_search
|
||||
Action Input: "Christopher Nolan birth date"
|
||||
Observation: July 30, 1970 (age 52) London England Notable Works: "Dunkirk" "Tenet" "The Prestige" See all related content → Recent News Jul. 13, 2023, 11:11 AM ET (AP) Cillian Murphy, playing Oppenheimer, finally gets to lead a Christopher Nolan film Christopher Edward Nolan CBE (born 30 July 1970) is a British and American filmmaker. Known for his Hollywood blockbusters with complex storytelling, Nolan is considered a leading filmmaker of the 21st century. His films have grossed $5 billion worldwide. The recipient of many accolades, he has been nominated for five Academy Awards, five BAFTA Awards and six Golden Globe Awards. Christopher Nolan is currently 52 according to his birthdate July 30, 1970 Sun Sign Leo Born Place Westminster, London, England, United Kingdom Residence Los Angeles, California, United States Nationality Education Chris attended Haileybury and Imperial Service College, in Hertford Heath, Hertfordshire. Christopher Nolan's next movie will study the man who developed the atomic bomb, J. Robert Oppenheimer. Here's the release date, plot, trailers & more. Date of Birth: 30 July 1970 . ... Christopher Nolan is a British-American film director, producer, and screenwriter. His films have grossed more than US$5 billion worldwide, and have garnered 11 Academy Awards from 36 nominations. ...
|
||||
Thought:Christopher Nolan was born on July 30, 1970. Now I can calculate his age in years and then in days.
|
||||
Action: Calculator
|
||||
Action Input: {"operation": "subtract", "operands": [2023, 1970]}
|
||||
Observation: Answer: 53
|
||||
Thought:Christopher Nolan is 53 years old in 2023. Now I need to calculate his age in days.
|
||||
Action: Calculator
|
||||
Action Input: {"operation": "multiply", "operands": [53, 365]}
|
||||
Observation: Answer: 19345
|
||||
Thought:I now know the final answer
|
||||
Final Answer: The director of the 2023 film Oppenheimer is Christopher Nolan. He is 53 years old in 2023, which is approximately 19345 days.
|
||||
|
||||
> Finished chain.
|
||||
|
||||
|
||||
'The director of the 2023 film Oppenheimer is Christopher Nolan. He is 53 years old in 2023, which is approximately 19345 days.'
|
||||
```
|
||||
|
||||
</CodeOutputBlock>
|
||||
|
||||
</details>
|
||||
|
||||
## Other callbacks
|
||||
|
||||
`Callbacks` are what we use to execute any functionality within a component outside the primary component logic. All of the above solutions use `Callbacks` under the hood to log intermediate steps of components. There's a number of `Callbacks` relevant for debugging that come with LangChain out of the box, like the [FileCallbackHandler](/docs/modules/callbacks/how_to/filecallbackhandler). You can also implement your own callbacks to execute custom functionality.
|
||||
|
||||
See here for more info on [Callbacks](/docs/modules/callbacks/), how to use them, and customize them.
|
||||
88
docs/extras/integrations/datadog.mdx
Normal file
88
docs/extras/integrations/datadog.mdx
Normal file
@@ -0,0 +1,88 @@
|
||||
# Datadog Tracing
|
||||
|
||||
>[ddtrace](https://github.com/DataDog/dd-trace-py) is a Datadog application performance monitoring (APM) library which provides an integration to monitor your LangChain application.
|
||||
|
||||
Key features of the ddtrace integration for LangChain:
|
||||
- Traces: Capture LangChain requests, parameters, prompt-completions, and help visualize LangChain operations.
|
||||
- Metrics: Capture LangChain request latency, errors, and token/cost usage (for OpenAI LLMs and Chat Models).
|
||||
- Logs: Store prompt completion data for each LangChain operation.
|
||||
- Dashboard: Combine metrics, logs, and trace data into a single plane to monitor LangChain requests.
|
||||
- Monitors: Provide alerts in response to spikes in LangChain request latency or error rate.
|
||||
|
||||
Note: The ddtrace LangChain integration currently provides tracing for LLMs, Chat Models, Text Embedding Models, Chains, and Vectorstores.
|
||||
|
||||
## Installation and Setup
|
||||
|
||||
1. Enable APM and StatsD in your Datadog Agent, along with a Datadog API key. For example, in Docker:
|
||||
|
||||
```
|
||||
docker run -d --cgroupns host \
|
||||
--pid host \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
-v /proc/:/host/proc/:ro \
|
||||
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
|
||||
-e DD_API_KEY=<DATADOG_API_KEY> \
|
||||
-p 127.0.0.1:8126:8126/tcp \
|
||||
-p 127.0.0.1:8125:8125/udp \
|
||||
-e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \
|
||||
-e DD_APM_ENABLED=true \
|
||||
gcr.io/datadoghq/agent:latest
|
||||
```
|
||||
|
||||
2. Install the Datadog APM Python library.
|
||||
|
||||
```
|
||||
pip install ddtrace>=1.17
|
||||
```
|
||||
|
||||
|
||||
3. The LangChain integration can be enabled automatically when you prefix your LangChain Python application command with `ddtrace-run`:
|
||||
|
||||
```
|
||||
DD_SERVICE="my-service" DD_ENV="staging" DD_API_KEY=<DATADOG_API_KEY> ddtrace-run python <your-app>.py
|
||||
```
|
||||
|
||||
**Note**: If the Agent is using a non-default hostname or port, be sure to also set `DD_AGENT_HOST`, `DD_TRACE_AGENT_PORT`, or `DD_DOGSTATSD_PORT`.
|
||||
|
||||
Additionally, the LangChain integration can be enabled programmatically by adding `patch_all()` or `patch(langchain=True)` before the first import of `langchain` in your application.
|
||||
|
||||
Note that using `ddtrace-run` or `patch_all()` will also enable the `requests` and `aiohttp` integrations which trace HTTP requests to LLM providers, as well as the `openai` integration which traces requests to the OpenAI library.
|
||||
|
||||
```python
|
||||
from ddtrace import config, patch
|
||||
|
||||
# Note: be sure to configure the integration before calling ``patch()``!
|
||||
# eg. config.langchain["logs_enabled"] = True
|
||||
|
||||
patch(langchain=True)
|
||||
|
||||
# to trace synchronous HTTP requests
|
||||
# patch(langchain=True, requests=True)
|
||||
|
||||
# to trace asynchronous HTTP requests (to the OpenAI library)
|
||||
# patch(langchain=True, aiohttp=True)
|
||||
|
||||
# to include underlying OpenAI spans from the OpenAI integration
|
||||
# patch(langchain=True, openai=True)patch_all
|
||||
```
|
||||
|
||||
See the [APM Python library documentation][https://ddtrace.readthedocs.io/en/stable/installation_quickstart.html] for more advanced usage.
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
See the [APM Python library documentation][https://ddtrace.readthedocs.io/en/stable/integrations.html#langchain] for all the available configuration options.
|
||||
|
||||
|
||||
### Log Prompt & Completion Sampling
|
||||
|
||||
To enable log prompt and completion sampling, set the `DD_LANGCHAIN_LOGS_ENABLED=1` environment variable. By default, 10% of traced requests will emit logs containing the prompts and completions.
|
||||
|
||||
To adjust the log sample rate, see the [APM library documentation][https://ddtrace.readthedocs.io/en/stable/integrations.html#langchain].
|
||||
|
||||
**Note**: Logs submission requires `DD_API_KEY` to be specified when running `ddtrace-run`.
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Need help? Create an issue on [ddtrace](https://github.com/DataDog/dd-trace-py) or contact [Datadog support][https://docs.datadoghq.com/help/].
|
||||
34
docs/extras/integrations/golden.mdx
Normal file
34
docs/extras/integrations/golden.mdx
Normal file
@@ -0,0 +1,34 @@
|
||||
# Golden
|
||||
|
||||
>[Golden](https://golden.com) provides a set of natural language APIs for querying and enrichment using the Golden Knowledge Graph e.g. queries such as: `Products from OpenAI`, `Generative ai companies with series a funding`, and `rappers who invest` can be used to retrieve relevant structured data about relevant entities.
|
||||
>
|
||||
>The `golden-query` langchain tool is a wrapper on top of the [Golden Query API](https://docs.golden.com/reference/query-api) which enables programmatic access to these results.
|
||||
>See the [Golden Query API docs](https://docs.golden.com/reference/query-api) for more information.
|
||||
|
||||
## Installation and Setup
|
||||
- Go to the [Golden API docs](https://docs.golden.com/) to get an overview about the Golden API.
|
||||
- Get your API key from the [Golden API Settings](https://golden.com/settings/api) page.
|
||||
- Save your API key into GOLDEN_API_KEY env variable
|
||||
|
||||
## Wrappers
|
||||
|
||||
### Utility
|
||||
|
||||
There exists a GoldenQueryAPIWrapper utility which wraps this API. To import this utility:
|
||||
|
||||
```python
|
||||
from langchain.utilities.golden_query import GoldenQueryAPIWrapper
|
||||
```
|
||||
|
||||
For a more detailed walkthrough of this wrapper, see [this notebook](/docs/modules/agents/tools/integrations/golden_query.html).
|
||||
|
||||
### Tool
|
||||
|
||||
You can also easily load this wrapper as a Tool (to use with an Agent).
|
||||
You can do this with:
|
||||
```python
|
||||
from langchain.agents import load_tools
|
||||
tools = load_tools(["golden-query"])
|
||||
```
|
||||
|
||||
For more information on tools, see [this page](/docs/modules/agents/tools/).
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user