Skip to content

Commit

Permalink
add similar chain for langchain-eval
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu chandola authored and himanshu chandola committed Jun 6, 2024
1 parent 0f5999b commit e980154
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Result:


class LangChainEvaluator:
def __init__(self, custom_connection: CustomConnection):
def __init__(self, custom_connection: CustomConnection, deployment_name: str):
self.custom_connection = custom_connection

# create llm according to the secrets in custom connection
Expand All @@ -27,7 +27,7 @@ def __init__(self, custom_connection: CustomConnection):
)
elif "openai_api_key" in self.custom_connection.secrets:
self.llm = AzureChatOpenAI(
deployment_name="gpt-35-turbo",
deployment_name=deployment_name,
openai_api_key=self.custom_connection.secrets["openai_api_key"],
azure_endpoint=self.custom_connection.configs["azure_endpoint"],
openai_api_type="azure",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@
"print(conn)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Deployment name"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"deployment_name = \"gpt-35-turbo\""
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -141,6 +157,7 @@
" # reference custom connection by name\n",
" init={\n",
" \"custom_connection\": \"my_llm_connection\",\n",
" \"deployment_name\": deployment_name,\n",
" },\n",
" data=data,\n",
" column_mapping={\n",
Expand Down

0 comments on commit e980154

Please sign in to comment.