Skip to content

Commit b3aee9d

Browse files
hinthornweyurtsev
andauthored
Add RAG tasks (#43)
Still need to tidy up notebooks but rest is OK for now --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
1 parent d99756a commit b3aee9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3223
-37
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,4 @@ cython_debug/
159159
# and can be added to the global gitignore or merged into this file. For a more nuclear
160160
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
161161
#.idea/
162-
162+
.DS_Store

csv-qa/pandas_agent_instruct.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
)
66
from langchain.embeddings import OpenAIEmbeddings
77
from langchain.llms import OpenAI
8-
from langchain.prompts import PromptTemplate
98
from langchain.smith import RunEvalConfig, run_on_dataset
109
from langchain.tools import PythonAstREPLTool
1110
from langchain.vectorstores import FAISS

csv-qa/pandas_ai.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import pandas as pd
2-
from langchain.agents.agent_toolkits import create_pandas_dataframe_agent
3-
from langchain.agents.agent_types import AgentType
42
from langchain.chat_models import ChatOpenAI
53
from langchain.prompts import ChatPromptTemplate
64
from langchain.schema.output_parser import StrOutputParser

docs/source/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
chromadb/

docs/source/notebooks/extraction.ipynb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,11 @@
272272
},
273273
"outputs": [],
274274
"source": [
275+
"from langchain.chat_models import ChatOpenAI\n",
276+
"\n",
275277
"from langchain_benchmarks.extraction.implementations import (\n",
276278
" create_openai_function_based_extractor,\n",
277-
")\n",
278-
"from langchain.chat_models import ChatOpenAI"
279+
")"
279280
]
280281
},
281282
{
@@ -354,8 +355,9 @@
354355
},
355356
"outputs": [],
356357
"source": [
357-
"from langchain_benchmarks.extraction import get_eval_config\n",
358-
"from langsmith.client import Client"
358+
"from langsmith.client import Client\n",
359+
"\n",
360+
"from langchain_benchmarks.extraction import get_eval_config"
359361
]
360362
},
361363
{

docs/source/notebooks/rag_evaluations.ipynb

Lines changed: 958 additions & 0 deletions
Large diffs are not rendered by default.

docs/source/notebooks/rag_langchain_docs.ipynb

Lines changed: 409 additions & 0 deletions
Large diffs are not rendered by default.

docs/source/notebooks/rag_semi_structured.ipynb

Lines changed: 440 additions & 0 deletions
Large diffs are not rendered by default.

docs/source/notebooks/tool_usage.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,9 @@
301301
},
302302
"outputs": [],
303303
"source": [
304-
"from langchain_benchmarks.tool_usage import STANDARD_AGENT_EVALUATOR\n",
305-
"from langsmith.client import Client"
304+
"from langsmith.client import Client\n",
305+
"\n",
306+
"from langchain_benchmarks.tool_usage import STANDARD_AGENT_EVALUATOR"
306307
]
307308
},
308309
{

langchain-docs-benchmarking/packages/chat-langchain/chat_langchain/chain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def create_response_chain(
134134
]
135135
)
136136

137-
response_synthesizer = (prompt | llm | StrOutputParser()).with_config(
137+
response_generator = (prompt | llm | StrOutputParser()).with_config(
138138
run_name="GenerateResponse",
139139
)
140140
return (
@@ -147,7 +147,7 @@ def create_response_chain(
147147
),
148148
}
149149
| _context
150-
| response_synthesizer
150+
| response_generator
151151
)
152152

153153

0 commit comments

Comments
 (0)