Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/canwhite/AgentEval
/ functions
Functions
112 in github.com/canwhite/AgentEval
⨍
Functions
112
◇
Types & classes
45
↓ 7 callers
Function
is_safe_session_id
(s: &str)
src/web/mod.rs:200
↓ 7 callers
Function
resolve_path
Resolve a tool argument path relative to the source project directory. Returns an error if the path contains `..` or resolves outside the source dir.
src/probe/tools.rs:15
↓ 5 callers
Method
build
(&self)
src/eval/mod.rs:216
↓ 5 callers
Function
run
( mut rx: UnboundedReceiver<TurnRecord>, log_dir: String, jsonl_stem: String, grader_config: G
src/eval/mod.rs:15
↓ 4 callers
Method
register
(&mut self, tool: Box<dyn Tool>)
src/probe/tool.rs:23
↓ 3 callers
Function
extract_json_block
从 LLM 输出中提取 JSON(可能被 ```json ... ``` 包裹)
src/grader/judge.rs:66
↓ 3 callers
Function
extract_json_block
Extract a JSON block from text that may be wrapped in markdown fences.
src/probe/mod.rs:153
↓ 3 callers
Function
parse_probe_output
Parse the LLM's raw output into a ProbeReport. Tries strict JSON parsing first, then falls back to extracting a JSON block from markdown-wrapped outp
src/probe/mod.rs:118
↓ 3 callers
Function
read_existing
Read an existing .probe.json.
src/probe/mod.rs:106
↓ 3 callers
Function
run_pipeline
运行完整的 grading pipeline: 1. 规则统计 → MetricsSnapshot 2. LLM 评审 → task_completion + response_quality 3. 汇总加权 → GradeReport
src/grader/mod.rs:16
↓ 3 callers
Function
write_json_file
(path: &str, value: &impl serde::Serialize)
src/eval/mod.rs:284
↓ 2 callers
Function
body_to_json
(body: &[u8])
src/proxy.rs:220
↓ 2 callers
Function
build_with_id
(builder: &SessionBuilder, session_id: &str)
src/eval/mod.rs:256
↓ 2 callers
Function
common_prefix_len
(prev: &[Value], current: &[Value])
src/eval/mod.rs:238
↓ 2 callers
Function
extract_text_content
从 message value 提取可读文本(content 可能是 string 或 array)
src/format/openai.rs:249
↓ 2 callers
Function
headers_to_value
(headers: &HeaderMap)
src/proxy.rs:210
↓ 2 callers
Function
parse_request_messages
从 request body 提取 messages 数组
src/format/openai.rs:6
↓ 2 callers
Function
read_diagnose_summary
(log_dir: &str, session_id: &str)
src/web/mod.rs:204
↓ 2 callers
Function
read_probe_summary
(log_dir: &str, session_id: &str)
src/web/mod.rs:216
↓ 2 callers
Function
write_grade_json
(report: &grader::types::GradeReport, log_dir: &str)
src/eval/mod.rs:279
↓ 2 callers
Function
write_view_final
(view: &SessionView, log_dir: &str)
src/eval/mod.rs:274
↓ 1 callers
Method
as_openai_tools
Return the tool definitions in OpenAI function-calling JSON format.
src/probe/tool.rs:36
↓ 1 callers
Function
build_judge_prompt
构造完整的 LLM 评审 prompt
src/grader/prompt.rs:67
↓ 1 callers
Function
build_system_prompt
Build the system prompt that defines the probe agent's role and methodology.
src/probe/prompt.rs:10
↓ 1 callers
Function
build_user_prompt
Build the user prompt: diagnose issues (JSON) + session summary (compact text).
src/probe/prompt.rs:15
↓ 1 callers
Function
calc_performance
性能评分(0.0~1.0)
src/grader/rules.rs:110
↓ 1 callers
Function
calc_tool_efficiency
工具效率评分(0.0~1.0)
src/grader/rules.rs:82
↓ 1 callers
Method
call
(&self, args: Value)
src/probe/tools.rs:87
↓ 1 callers
Method
chat
( &self, messages: &[Message], tools: &Value, )
src/probe/backend.rs:31
↓ 1 callers
Function
diff_messages
(prev: &[Value], current: &'a [Value])
src/eval/mod.rs:229
↓ 1 callers
Method
dispatch
(&self, name: &str, args: Value)
src/probe/tool.rs:27
↓ 1 callers
Function
extract_content
Extract text content from a message value (content may be string or array of blocks).
src/diagnose/rules.rs:617
↓ 1 callers
Function
extract_metrics
(view: &SessionView)
src/grader/rules.rs:4
↓ 1 callers
Function
extract_model
(body: &Value)
src/eval/mod.rs:249
↓ 1 callers
Function
format_session
把 SessionView 格式化成 LLM 易读的会话摘要
src/grader/prompt.rs:5
↓ 1 callers
Function
format_session_summary
Build a compact session summary from SessionView. - diagnose-marked turns are expanded with detail - normal turns get a one-line summary - large gaps
src/probe/prompt.rs:32
↓ 1 callers
Method
has_tool_calls
(&self)
src/probe/types.rs:123
↓ 1 callers
Function
is_new_session
(prev: &[Value], current: &[Value])
src/eval/mod.rs:245
↓ 1 callers
Function
is_streaming_request
(body: &[u8])
src/proxy.rs:230
↓ 1 callers
Function
judge
调用评测 LLM,返回 task_completion 和 response_quality 评分
src/grader/judge.rs:8
↓ 1 callers
Function
judge_llm
( view: &SessionView, metrics: &types::MetricsSnapshot, config: &GraderConfig, )
src/grader/mod.rs:106
↓ 1 callers
Method
name
(&self)
src/probe/tools.rs:65
↓ 1 callers
Function
normalize_args
Normalize JSON arguments for comparison: parse + re-serialize with sorted keys.
src/diagnose/rules.rs:590
↓ 1 callers
Function
parse_json_response
(body: &str)
src/probe/types.rs:178
↓ 1 callers
Function
parse_llm_response
Convert an OpenAI chat completion response body into an LlmResponse. Handles both streaming (SSE) and non-streaming (JSON) responses.
src/probe/types.rs:170
↓ 1 callers
Function
parse_non_streaming
(body: &Value)
src/format/openai.rs:61
↓ 1 callers
Function
parse_response_steps
从 response body 提取 model 步骤 自动区分非流式(JSON)和流式(SSE 文本)响应。
src/format/openai.rs:16
↓ 1 callers
Function
parse_response_usage
从 response body 提取 usage 信息
src/format/openai.rs:25
↓ 1 callers
Function
parse_sse
(sse_text: &str)
src/format/openai.rs:143
↓ 1 callers
Function
parse_sse_response
(sse_text: &str)
src/probe/types.rs:235
↓ 1 callers
Method
process
( &mut self, request_body: &Value, response_body: &Value, duration_ms: u64,
src/eval/mod.rs:128
↓ 1 callers
Function
prompt_bloat
System prompt content > 3000 chars.
src/diagnose/rules.rs:249
↓ 1 callers
Function
prompt_context_overflow
Signs of history truncation: tool role message with no matching tool_calls in preceding assistant messages within the same request.
src/diagnose/rules.rs:296
↓ 1 callers
Function
read_jsonl_entries
Read specific JSONL entries by their `id` fields.
src/diagnose/mod.rs:173
↓ 1 callers
Function
read_raw_jsonl
Read raw JSONL lines by IDs (for the raw JSONL API).
src/diagnose/mod.rs:209
↓ 1 callers
Method
run
Run the agent loop. Returns the final text content from the LLM (which should be the JSON probe report).
src/probe/agent.rs:48
↓ 1 callers
Function
run_all
(view: &SessionView, jsonl_entries: &[JsonlEntry])
src/diagnose/rules.rs:18
↓ 1 callers
Function
run_diagnose_cli
(args: &[String])
src/main.rs:82
↓ 1 callers
Function
run_probe_cli
(args: &[String])
src/main.rs:158
↓ 1 callers
Function
seal_and_grade_bg
封口当前 session:立即写 view.json,后台 spawn 评分任务(不阻塞主循环)
src/eval/mod.rs:293
↓ 1 callers
Function
sse_has_content
Check if an SSE stream has any meaningful content (text or tool calls).
src/diagnose/rules.rs:430
↓ 1 callers
Function
summarize_issues
Call the judge LLM to generate a 2-3 sentence summary of diagnose issues. Returns None if no API key is configured, there are no issues, or the LLM ca
src/diagnose/mod.rs:75
↓ 1 callers
Function
timestamp_ms
()
src/proxy.rs:202
↓ 1 callers
Function
token_empty_response
response_body.choices empty or content empty (handles both SSE string and JSON object).
src/diagnose/rules.rs:363
↓ 1 callers
Function
token_excessive_input
input > 30000 AND output < 1000.
src/diagnose/rules.rs:519
↓ 1 callers
Function
token_waste
output/input < 2% AND input > 5000 tokens.
src/diagnose/rules.rs:474
↓ 1 callers
Function
tool_duplicate_3plus
Same name + same arguments called ≥ 3 times.
src/diagnose/rules.rs:137
↓ 1 callers
Function
tool_result_empty
tool_result.content is empty or whitespace-only.
src/diagnose/rules.rs:190
↓ 1 callers
Function
tool_result_error
tool_result.is_error == true.
src/diagnose/rules.rs:86
↓ 1 callers
Function
tool_result_missing
tool_call.result is None (not backfilled cross-turn).
src/diagnose/rules.rs:45
↓ 1 callers
Function
view_mismatch
Data integrity: turns.len() != jsonl_ids.len().
src/diagnose/rules.rs:558
↓ 1 callers
Function
write_view_json
(builder: &SessionBuilder, log_dir: &str)
src/eval/mod.rs:268
Function
accepts_normal_path
()
src/probe/tools.rs:393
Method
assistant_with_tool_calls
(tool_calls: Vec<ToolCall>)
src/probe/types.rs:101
Method
default
()
src/probe/tool.rs:56
Method
description
(&self)
src/probe/tools.rs:69
Function
diagnose_session
( State(state): State<Arc<AppState>>, Path(session_id): Path<String>, )
src/web/mod.rs:231
Method
from_issues
(issues: &[DiagnoseIssue])
src/diagnose/types.rs:22
Method
from_report
(report: &ProbeReport)
src/probe/types.rs:46
Function
get_diagnose
( State(state): State<Arc<AppState>>, Path(session_id): Path<String>, )
src/web/mod.rs:246
Function
get_probe
( State(state): State<Arc<AppState>>, Path(session_id): Path<String>, )
src/web/mod.rs:305
Function
get_raw_jsonl
( State(state): State<Arc<AppState>>, Path(jsonl_stem): Path<String>, axum::extract::Query(query):
src/web/mod.rs:265
Function
get_session
( State(state): State<Arc<AppState>>, Path(session_id): Path<String>, )
src/web/mod.rs:142
Function
grade_session
( State(state): State<Arc<AppState>>, Path(session_id): Path<String>, )
src/web/mod.rs:168
Function
handler
( State(state): State<std::sync::Arc<AppState>>, method: Method, uri: Uri, headers: HeaderMap,
src/proxy.rs:62
Function
list_sessions
( State(state): State<Arc<AppState>>, )
src/web/mod.rs:64
Method
load
加载配置,优先从环境变量获取,如果没有则使用默认值
src/config.rs:16
Function
main
()
src/main.rs:20
Method
new
(config: &Config, eval_tx: tokio::sync::mpsc::UnboundedSender<TurnRecord>, grader_config: GraderConfig, probe_
src/proxy.rs:34
Method
new
(session_id: String, model: String)
src/eval/mod.rs:116
Method
new
(source_dir: &str)
src/probe/tools.rs:57
Method
new
( backend: OpenAiBackend, tools: Registry, system_prompt: &str, user_prompt: &
src/probe/agent.rs:26
Method
new
(api_base: &str, model: &str, api_key: &str)
src/probe/backend.rs:18
Method
new
()
src/probe/tool.rs:19
Function
probe_session
( State(state): State<Arc<AppState>>, Path(session_id): Path<String>, )
src/web/mod.rs:290
Function
read_existing
Read an existing .diagnose.json.
src/diagnose/mod.rs:65
Function
rejects_dotdot_in_middle
()
src/probe/tools.rs:386
Function
rejects_parent_traversal
()
src/probe/tools.rs:379
Function
run
Run all diagnostic rules against a session. Reads `{log_dir}/{session_id}.view.json` and the corresponding `.jsonl`, runs all 10 rules, writes `{log_
src/diagnose/mod.rs:18
Function
run
Run the probe agent against a session. 1. Read diagnose issues from .diagnose.json 2. Read session view from .view.json 3. Build system + user prompt
src/probe/mod.rs:29
next →
1–100 of 112, ranked by callers