Skip to content

Commit

Permalink
added grader_llm_config usage in the notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk669 committed Dec 19, 2024
1 parent c830aaa commit 73914a1
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions notebook/agentchat_reasoning_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3667,6 +3667,42 @@
"print(res.summary)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Use a different Model for Grading \n",
"\n",
"To use a different model for grading instead of gpt-4o, pass the `grader_llm_config` argument when initializing the `ReasoningAgent`. This ensures that the grading of trajectories is performed using the specified configuration from the `config_list`, separate from the main `llm_config`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"grader_config_list = [{\"model\": \"gpt-4o-mini\", \"api_key\": api_key}]\n",
"\n",
"grader_llm_config = {\"config_list\": grader_config_list}\n",
"\n",
"writer = AssistantAgent(\n",
" name=\"Writer\",\n",
" llm_config={\"config_list\": config_list},\n",
" system_message=\"\"\"\n",
" You are a professional writer, known for your insightful and engaging articles.\n",
" You transform complex concepts into compelling narratives.\n",
" You should improve the quality of the content based on the feedback from the user.\n",
" \"\"\",\n",
")\n",
"reason_agent_for_writer = ReasoningAgent(\n",
" name=\"reason_agent\",\n",
" llm_config={\"config_list\": config_list},\n",
" verbose=verbose,\n",
" reason_config={\"method\": \"lats\", \"nsim\": 2, \"max_depth\": 3},\n",
")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -3759,14 +3795,14 @@
"\n",
"GROUND_TRUTH:\n",
"We define X as the highest outcome among the three rolls.\n",
"ight)^3 for each m from 1 to 6.ast m is 1 - \\left(\f",
"ight)^3 for each m from 1 to 6.ast m is 1 - \\left(\f\n",
"rac{m-1}{6}\n",
"Summing these probabilities gives the expectation E(X) = \\sum_{m=1}^{6} [1 - (\f",
"Summing these probabilities gives the expectation E(X) = \\sum_{m=1}^{6} [1 - (\f\n",
"rac{m-1}{6})^3].\n",
"Calculating this sum results in E(X) = 6 - \f",
"rac{225}{216} = \f",
"Calculating this sum results in E(X) = 6 - \f\n",
"rac{225}{216} = \f\n",
"rac{119}{24}, which approximates to 4.9583.\n",
"Therefore, the expected maximum value when rolling a six-sided die three times is \f",
"Therefore, the expected maximum value when rolling a six-sided die three times is \f\n",
"rac{119}{24} or approximately 4.9583.\n",
"\n",
"\n",
Expand Down Expand Up @@ -6785,7 +6821,7 @@
]
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -6799,7 +6835,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
"version": "3.10.15"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 73914a1

Please sign in to comment.