Skip to content

Commit

Permalink
update docs (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
isahers1 authored Feb 1, 2025
1 parent 2810139 commit 9ede9b5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/evaluation/tutorials/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ class Grade(TypedDict):
score: Annotated[
bool,
...,
"Return True if the answer is fully frounded in the source documents, otherwise False.",
"Return True if the answer is fully grounded in the source documents, otherwise False.",
]
judge_llm = init_chat_model("gpt-4o").with_structured_output(Grade)
Expand All @@ -644,7 +644,7 @@ def test_grounded_in_source_info() -> None:
result = agent.invoke({"messages": [{"role": "user", "content": query}]})
# Grab all the search calls made by the LLM
search_results = "\n\n".join(
search_results = "\\n\\n".join(
msg.content
for msg in result["messages"]
if msg.type == "tool" and msg.name == search_tool.name
Expand All @@ -666,8 +666,8 @@ def test_grounded_in_source_info() -> None:
"Return False if the ANSWER is not grounded in the DOCUMENTS."
)
answer_and_docs = (
f"ANSWER: {result['structured_response'].get('text_answer', '')}\n"
f"DOCUMENTS:\n{search_results}"
f"ANSWER: {result['structured_response'].get('text_answer', '')}\\n"
f"DOCUMENTS:\\n{search_results}"
)
# Run the judge LLM
Expand Down Expand Up @@ -1100,7 +1100,7 @@ class Grade(TypedDict):
score: Annotated[
bool,
...,
"Return True if the answer is fully frounded in the source documents, otherwise False.",
"Return True if the answer is fully grounded in the source documents, otherwise False.",
]
judge_llm = init_chat_model("gpt-4o").with_structured_output(Grade)
Expand All @@ -1114,7 +1114,7 @@ def test_grounded_in_source_info() -> None:
result = agent.invoke({"messages": [{"role": "user", "content": query}]})
# Grab all the search calls made by the LLM
search_results = "\n\n".join(
search_results = "\\n\\n".join(
msg.content
for msg in result["messages"]
if msg.type == "tool" and msg.name == search_tool.name
Expand All @@ -1136,8 +1136,8 @@ def test_grounded_in_source_info() -> None:
"Return False if the ANSWER is not grounded in the DOCUMENTS."
)
answer_and_docs = (
f"ANSWER: {result['structured_response'].get('text_answer', '')}\n"
f"DOCUMENTS:\n{search_results}"
f"ANSWER: {result['structured_response'].get('text_answer', '')}\\n"
f"DOCUMENTS:\\n{search_results}"
)
# Run the judge LLM
Expand Down

0 comments on commit 9ede9b5

Please sign in to comment.