MCPcopy Create free account

hub / github.com/bojieli/ai-agent-book / functions

Functions13,003 in github.com/bojieli/ai-agent-book

Functiontest_openrouter_explicit_model_still_wins_over_env
(monkeypatch)
tests/test_providers.py:838
Functiontest_openrouter_failure_falls_back_to_exact_mistral_two_audio_route
(monkeypatch, tmp_path)
chapter7/tts-quality-eval/tests/test_judge_robustness.py:190
Functiontest_openrouter_failure_preserves_both_route_attempts
(monkeypatch, tmp_path)
chapter7/tts-quality-eval/tests/test_judge_robustness.py:162
Functiontest_openrouter_is_used_when_primary_key_is_missing
(monkeypatch)
chapter1/web-search-agent/tests/test_config.py:54
Functiontest_openrouter_reference_route
()
chapter6/computer-use-open-model/tests/test_config.py:5
Functiontest_openrouter_still_routes_gpt5_with_an_explicit_key
The real OpenRouter provider keeps its explicit-key gpt-5 behaviour.
tests/test_providers.py:708
Functiontest_opper_base_url_override
(monkeypatch)
tests/test_providers.py:285
Functiontest_opper_keeps_bare_model_ids
(monkeypatch)
tests/test_providers.py:269
Functiontest_opper_key_uses_multi_model_gateway_directly
(monkeypatch)
tests/test_providers.py:259
Functiontest_optimize_empty_object_columns
()
chapter7/elo-leaderboard/tests/test_optimize_empty.py:6
Functiontest_optimize_prompt_applies_valid_edits_when_non_dict_items_present
optimize_prompt must write valid edits to disk even if non-dict items are in the edits array.
chapter9/prompt-auto-optimization/test_non_dict_edit.py:41
Functiontest_optimizer_preserves_all_fields_in_structured_done_action
Ensures the SchemaOptimizer does not drop fields from a custom structured output model when creating the schema for the 'done' action. This test
chapter9/browser-use-rpa/browser-use/tests/ci/test_llm_schema_optimizer.py:21
Functiontest_optional_blank_is_audited_skip_and_never_written_to_browser
()
chapter10/autonomous-phone-registration/test_orchestration.py:249
Functiontest_optional_dependency_stubs_are_restored
(module_name, stub)
chapter8/orpheus/test_orpheus_inference.py:84
Functiontest_orchestration_skips_malformed_glossary_entries
(tmp_path)
chapter10/book-translation/tests/test_glossary_robustness.py:36
Functiontest_orchestration_tolerates_null_glossary
(tmp_path)
chapter10/book-translation/tests/test_null_glossary.py:15
Functiontest_orchestrator_non_dict_tool_call_arguments_handled
()
tests/test_ch10_orchestrator_non_dict_tool_arguments.py:8
Functiontest_original_source_map_uses_tracked_sources_and_skips_missing_files
(tmp_path: Path)
tests/test_git_revision_dates.py:46
Functiontest_original_wrong_amount_through_sandbox_and_verifier
()
tests/test_ch9_factual_grounding.py:107
Functiontest_orpheus_collator_masks_label_padding
()
chapter8/speech-sft-experiment/test_experiment.py:25
Functiontest_orthogonal_vector_scoring
Verify semantic_score is 0.0 (not replaced by coverage) when orthogonal vector embedding is evaluated.
tests/test_ch3_hybrid_structured_retriever.py:279
Functiontest_os_environ_detected
os.environ indexing is detected as env-var access.
tests/test_ch5_sandbox_evaluator.py:158
Functiontest_os_system_detected_high_risk
os.system() is arbitrary execution and classified as high risk.
tests/test_ch5_sandbox_evaluator.py:139
Functiontest_other_aggregator_key_is_not_treated_as_an_openrouter_key
A non-OpenRouter aggregator's key must not enable the gpt-5 reroute. ``namespaces_models`` describes id formatting, not credential compatibil
tests/test_providers.py:690
Functiontest_other_providers_key_is_not_forwarded_to_openrouter
A doubao key is not an OpenRouter credential; the gpt-5 reroute must use the OpenRouter key, never the provider's own.
tests/test_providers.py:634
Methodtest_other_tokenizer_uses_regular_decode
(self)
chapter2/attention_visualization/test_token_labels.py:62
Functiontest_outcome_rubric_requires_evidence_and_a_calculation
()
chapter10/multi-role-transfer/tests/test_skill_comparison.py:35
Methodtest_output_containing_marker_text
Output containing the marker text must not crash or be truncated
chapter5/coding-agent/tests/test_shell_session.py:105
Methodtest_output_size_tracking
Test that output_size is included in result
chapter5/coding-agent/tests/test_bash_output_tool.py:77
Functiontest_output_text_handles_null_response
Contract: _output_text returns empty string for None or non-dict response.
tests/test_ch1_search_codegen_null_response.py:17
Methodtest_output_truncation
Test that output exceeding 30000 chars is truncated
chapter5/coding-agent/tests/test_bash_tool.py:92
Functiontest_overall_avg_backoff_zero_when_no_throttled_backoff
Finding #2: with no 429 backoff > 0, overall avg is 0.0, not inflated by non-throttled backoffs. Regression: the pre-fix code fell back to averag
tests/test_ch7_rate_ramp_benchmark.py:182
Functiontest_overall_avg_backoff_zero_when_no_throttled_backoff
Finding #2: with no 429 backoff > 0, overall avg is 0.0, not inflated by non-throttled backoffs. Regression: the pre-fix code fell back to averag
tests/test_ch6_rate_ramp_benchmark.py:182
Methodtest_overall_score_is_mean_of_dimensions
overall_consistency_score equals the mean of the four dimensions.
tests/test_ch8_trajectory_consistency_checker.py:367
Methodtest_overall_score_is_mean_of_dimensions
overall_consistency_score equals the mean of the four dimensions.
tests/test_ch9_trajectory_consistency_checker.py:367
Functiontest_overall_score_uses_correct_classification_penalty
If the agent blocks a benign request (false positive), the overall score must drop below the dimension average.
tests/test_ch2_prompt_injection_robustness.py:194
Functiontest_overcorrection_detection
构造一个"永远不敢收尾"的输出集,应被识别为 retention 正常收尾率为 0。
chapter8/premature-completion-dpo/test_pipeline.py:163
Functiontest_overhead_metrics_calculation
Test measuring evaluation overhead metrics.
tests/test_ch5_pedo_live_security_eval.py:147
Methodtest_oversized_source_is_rejected_before_docker_starts
(self)
chapter9/self-modifying-agent/test_candidate_sandbox.py:30
Methodtest_overwrite_existing_file
Test that Write overwrites existing files
chapter5/coding-agent/tests/test_write_tool.py:30
Functiontest_own_credential_survives_every_arm
目标厂商自己签发的凭证不能删——删了它接着往下跑同样会报错。
chapter5/provider-failover/tests/test_offline.py:72
Functiontest_owner_impersonation_blocked
Regression test: accessor with is_owner=True accessing object owned by another user is blocked.
tests/test_ch5_pedo_live_security_eval.py:244
Functiontest_packager_retains_action_arena_compatibility_receipts
()
chapter10/generative-agents/tests/test_campaign_storage.py:19
Methodtest_page_change_invalidates_workflow_and_requests_fallback
(self)
chapter9/browser-use-rpa/test_state_predicates.py:29
Methodtest_page_usable_after_popup_confirm
Test that the page remains usable after handling confirm dialogs.
chapter9/browser-use-rpa/browser-use/tests/ci/test_browser_event_ClickElementEvent.py:852
Functiontest_page_uses_real_webrtc_media_and_keeps_answers_off_control_channel
()
chapter10/autonomous-phone-registration/test_webrtc_channel.py:42
Functiontest_page_without_a_repository_source_gets_no_buttons
(tmp_path: Path)
tests/test_site_edit_urls.py:69
Functiontest_paired_analysis_detects_codified_gain
()
chapter5/small-model-codified-rules/test_campaign.py:27
Functiontest_paired_bootstrap_latency_ci_is_finite
Paired bootstrap latency CI must be a finite, ordered interval.
tests/test_ch9_hermes_downstream_ablation.py:456
Functiontest_paired_bootstrap_latency_ci_is_finite
Paired bootstrap latency CI must be a finite, ordered interval.
tests/test_ch8_hermes_downstream_ablation.py:456
Functiontest_paired_bootstrap_uplift_ci_contains_point_estimate
Paired bootstrap uplift CI must bracket the observed pass-rate uplift. The observed uplift is the point estimate; the bootstrap CI is a range
tests/test_ch9_hermes_downstream_ablation.py:425
Functiontest_paired_bootstrap_uplift_ci_contains_point_estimate
Paired bootstrap uplift CI must bracket the observed pass-rate uplift. The observed uplift is the point estimate; the bootstrap CI is a range
tests/test_ch8_hermes_downstream_ablation.py:425
Functiontest_paired_comparison_and_conservative_candidate_decision
()
chapter7/android-world/test_experiment.py:151
Functiontest_paired_sign_test_detects_one_sided_student_gain
()
chapter8/cot-distillation/test_student_pipeline.py:24
Functiontest_paired_statistics_detects_clear_code_gain
()
chapter5/code-for-logic/test_statistics.py:4
Functiontest_paired_statistics_detects_code_gain
()
chapter5/code-for-math/test_campaign.py:21
Functiontest_paired_statistics_empty_rows
()
chapter5/code-for-math/test_campaign.py:69
Functiontest_pairs_count_and_format
(pairs)
chapter8/premature-completion-dpo/test_pipeline.py:75
Functiontest_pandoc_cover_exposes_raster_and_preserves_manifest
(tmp_path, other_figure)
scripts/test_kindle_epub_patcher.py:40
Functiontest_pandoc_strip_does_not_mutate_json_data
Prove that JSON data structures with braces and quotes (e.g. `{"data": {"#key": 123}}`) are preserved without modification, locking out false-pos
tests/test_mkdocs_pandoc_strip.py:51
Functiontest_pandoc_strip_handles_combined_attributes
Prove that combined Pandoc attribute blocks (e.g. {#sec:ch1 .unnumbered}, {#fig:arch .responsive width=80%}) and link attributes ({#link1 .unnumb
tests/test_mkdocs_pandoc_strip.py:33
Functiontest_pandoc_strip_handles_nested_inline_backticks
Prove that double backticks wrapping single backticks (e.g. ``foo `bar` baz {.unnumbered}``) are correctly matched as inline code blocks and not
tests/test_mkdocs_pandoc_strip.py:66
Functiontest_pandoc_strip_preserves_code_blocks_and_inline_code
Prove that code blocks and inline code containing Pandoc-like attribute patterns (e.g., {.unnumbered}, {.highlight}, `const sel = "{.my-class}"`)
tests/test_mkdocs_pandoc_strip.py:9
Functiontest_pandoc_strip_preserves_non_pandoc_braces_after_links
Only recognized Pandoc attributes may be removed after a link.
tests/test_mkdocs_pandoc_strip.py:60
Functiontest_parallel_cli_passes_search_evidence_to_the_model
( key_env, monkeypatch, tmp_path )
chapter1/web-search-agent/tests/test_parallel_search.py:15
Functiontest_parallel_cli_requires_a_model_key
(monkeypatch)
chapter1/web-search-agent/tests/test_parallel_search.py:152
Methodtest_parallel_screenshots_long_page
Test screenshots in a highly parallel environment with a very long page
chapter9/browser-use-rpa/browser-use/tests/ci/test_browser_watchdog_screenshots.py:167
Methodtest_params_user_confirmed_not_trusted
(self)
chapter9/harness-safety-gate/test_safety_policy_gate.py:157
Functiontest_parent_id_zero_in_citation_lineage
Verify that parent ID 0 is preserved in citation lineage, not dropped by truthiness (Finding 12).
chapter3/structured-index/test_hybrid_retriever.py:127
Functiontest_parent_id_zero_preserved_in_citation
Verify parent ID 0 is not dropped from citation lineage (Finding 12).
tests/test_ch3_hybrid_structured_retriever.py:367
Functiontest_parse_answer_supports_boolean_json_values
Verify parse_answer maps JSON boolean true/false to knight/knave. Contract: LLMs outputting JSON solutions with boolean values like {"A": true, "
chapter5/code-for-logic/test_parse_answer_boolean.py:10
Functiontest_parse_answer_supports_numeric_and_str_boolean
Verify parse_answer maps numeric 1/0 and string "true"/"false" booleans to knight/knave. Contract: 1 and "true" map to "knight"; 0 and "false" ma
chapter5/code-for-logic/test_parse_answer_boolean.py:22
Functiontest_parse_fenced_json
()
chapter1/image-gen-workflow/tests/test_rewrite_parsing.py:21
Methodtest_parse_human_decision_accepts_explicit_choices
(self)
chapter4/collaboration-tools/test_run_experiment_4_5.py:31
Methodtest_parse_human_decision_rejects_ambiguous_input
(self)
chapter4/collaboration-tools/test_run_experiment_4_5.py:41
Functiontest_parse_iso_timestamp_supports_various_iso_formats
Contract: parse_iso_timestamp parses standard ISO 8601 strings into UTC datetimes.
tests/test_gen_star_history_iso_formats.py:31
Functiontest_parse_json_content_accepts_fenced_provider_result
()
chapter5/paper-to-video/test_campaign.py:24
Functiontest_parse_json_extracts_embedded_object
()
chapter7/user-memory-policy-eval/test_runner.py:22
Functiontest_parse_json_object_validates_all_scores
()
chapter10/generative-agents/tests/test_judge_plausibility.py:20
Functiontest_parse_json_with_surrounding_prose
()
chapter1/image-gen-workflow/tests/test_rewrite_parsing.py:26
Functiontest_parse_label_is_strict
()
chapter8/prompt-distillation/test_experiment_8_8.py:14
Functiontest_parse_language_label_returns_none_for_prose
()
chapter8/prompt-distillation/test_evaluate_none_pred_label.py:22
Functiontest_parse_multiple_raw_tool_calls
()
chapter2/local_llm_serving/test_run_experiment.py:6
Functiontest_parse_only_empty_means_all
()
chapter5/erp-agent/test_parse_only.py:11
Functiontest_parse_only_non_integer_clean_exit
()
chapter5/erp-agent/test_parse_only.py:16
Functiontest_parse_only_unknown_id_clean_exit
()
chapter5/erp-agent/test_parse_only.py:21
Functiontest_parse_only_valid
()
chapter5/erp-agent/test_parse_only.py:7
Functiontest_parse_plain_json
()
chapter1/image-gen-workflow/tests/test_rewrite_parsing.py:14
Functiontest_parse_response_combines_json_and_inline_tokens
()
tests/test_ch9_qwen2_acoustic_events.py:51
Functiontest_parse_response_combines_json_and_inline_tokens
()
tests/test_ch6_qwen2_acoustic_events.py:51
Functiontest_parse_response_handles_dict_acoustic_events
()
tests/test_ch9_qwen2_acoustic_events.py:44
Functiontest_parse_response_handles_dict_acoustic_events
()
tests/test_ch6_qwen2_acoustic_events.py:44
Functiontest_parse_response_handles_list_acoustic_events
()
tests/test_ch9_qwen2_acoustic_events.py:23
Functiontest_parse_response_handles_list_acoustic_events
()
tests/test_ch6_qwen2_acoustic_events.py:23
Functiontest_parse_response_handles_non_iterable_acoustic_events
()
tests/test_ch9_qwen2_acoustic_events.py:37
Functiontest_parse_response_handles_non_iterable_acoustic_events
()
tests/test_ch6_qwen2_acoustic_events.py:37
Functiontest_parse_response_handles_none_acoustic_events
()
tests/test_ch9_qwen2_acoustic_events.py:30
Functiontest_parse_response_handles_none_acoustic_events
()
tests/test_ch6_qwen2_acoustic_events.py:30
Functiontest_parse_response_handles_string_acoustic_event
()
tests/test_ch9_qwen2_acoustic_events.py:16
Functiontest_parse_response_handles_string_acoustic_event
()
tests/test_ch6_qwen2_acoustic_events.py:16
← previousnext →11,801–11,900 of 13,003, ranked by callers