Skip to content

Commit 2a54e73

Browse files
authored
bump version to 0063 (#616)
1 parent 57bbc5d commit 2a54e73

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed

docs/modules/utils/examples/serpapi.ipynb

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,55 @@
5151
"search.run(\"Obama's first name?\")"
5252
]
5353
},
54+
{
55+
"cell_type": "markdown",
56+
"id": "fe3ee213",
57+
"metadata": {},
58+
"source": [
59+
"## Custom Parameters\n",
60+
"You can also customize the SerpAPI wrapper with arbitrary parameters. For example, in the below example we will use `bing` instead of `google`."
61+
]
62+
},
63+
{
64+
"cell_type": "code",
65+
"execution_count": 2,
66+
"id": "deffcc8b",
67+
"metadata": {},
68+
"outputs": [],
69+
"source": [
70+
"params = {\n",
71+
" \"engine\": \"bing\",\n",
72+
" \"gl\": \"us\",\n",
73+
" \"hl\": \"en\",\n",
74+
"}\n",
75+
"search = SerpAPIWrapper(params=params)"
76+
]
77+
},
78+
{
79+
"cell_type": "code",
80+
"execution_count": 3,
81+
"id": "2c752d08",
82+
"metadata": {},
83+
"outputs": [
84+
{
85+
"data": {
86+
"text/plain": [
87+
"'Barack Hussein Obama II is an American politician who served as the 44th president of the United States from 2009 to 2017. A member of the Democratic Party, Obama was the first African-American presi…New content will be added above the current area of focus upon selectionBarack Hussein Obama II is an American politician who served as the 44th president of the United States from 2009 to 2017. A member of the Democratic Party, Obama was the first African-American president of the United States. He previously served as a U.S. senator from Illinois from 2005 to 2008 and as an Illinois state senator from 1997 to 2004, and previously worked as a civil rights lawyer before entering politics.Wikipediabarackobama.com'"
88+
]
89+
},
90+
"execution_count": 3,
91+
"metadata": {},
92+
"output_type": "execute_result"
93+
}
94+
],
95+
"source": [
96+
"search.run(\"Obama's first name?\")"
97+
]
98+
},
5499
{
55100
"cell_type": "code",
56101
"execution_count": null,
57-
"id": "27f5959a",
102+
"id": "e0a1dc1c",
58103
"metadata": {},
59104
"outputs": [],
60105
"source": []

langchain/evaluation/qa/eval_chain.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ def from_llm(
3131
Returns:
3232
QAEvalChain: the loaded QA eval chain.
3333
"""
34+
expected_input_vars = {"query", "answer", "result"}
35+
if expected_input_vars != set(prompt.input_variables):
36+
raise ValueError(
37+
f"Input variables should be {expected_input_vars}, "
38+
f"but got {prompt.input_variables}"
39+
)
3440
return cls(llm=llm, prompt=prompt, **kwargs)
3541

3642
def evaluate(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "langchain"
3-
version = "0.0.62"
3+
version = "0.0.63"
44
description = "Building applications with LLMs through composability"
55
authors = []
66
license = "MIT"

0 commit comments

Comments
 (0)