-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathtest_pytest_mcp_url.py
More file actions
44 lines (40 loc) · 1.48 KB
/
test_pytest_mcp_url.py
File metadata and controls
44 lines (40 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from eval_protocol.models import EvaluateResult, EvaluationRow, Message
from eval_protocol.pytest import AgentRolloutProcessor, evaluation_test
@evaluation_test(
input_messages=[
[
[
Message(
role="system",
content=(
"You are a helpful assistant that can answer questions about Fireworks.\n"
"ALWAYS provide code or commands to execute to answer the question."
),
),
Message(
role="user",
content=("Can you teach me about how to manage deployments on Fireworks"),
),
]
]
],
rollout_processor=AgentRolloutProcessor(),
completion_params=[{"model": "fireworks_ai/accounts/fireworks/models/kimi-k2-instruct-0905"}],
mode="pointwise",
mcp_config_path="tests/pytest/mcp_configurations/docs_mcp_config.json",
)
def test_pytest_mcp_url(row: EvaluationRow) -> EvaluationRow:
"""Run math evaluation on sample dataset using pytest interface."""
# filter for all tool calls
tool_calls = [msg for msg in row.messages if msg.role == "tool"]
if len(tool_calls) == 0:
row.evaluation_result = EvaluateResult(
score=0,
reason="No tool calls made",
)
return row
row.evaluation_result = EvaluateResult(
score=1,
reason="At least one tool call was made",
)
return row