Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bojieli/ai-agent-book
/ functions
Functions
13,003 in github.com/bojieli/ai-agent-book
⨍
Functions
13,003
◇
Types & classes
1,574
↳
Endpoints
161
Function
test_tokens_per_tool_call_aggregate
()
tests/test_ch6_cost_efficiency_analyzer.py:198
Function
test_tokens_per_tool_call_aggregate
()
tests/test_ch7_cost_efficiency_analyzer.py:198
Function
test_tokens_per_tool_call_zero_when_no_tools
()
tests/test_ch6_cost_efficiency_analyzer.py:208
Function
test_tokens_per_tool_call_zero_when_no_tools
()
tests/test_ch7_cost_efficiency_analyzer.py:208
Method
test_tool_call_statistics_in_hint
Test that tool calls are tracked in system hint
chapter5/coding-agent/tests/test_integration.py:26
Function
test_tool_calls_explicit_field_overrides_tool_presence
()
tests/test_ch6_cost_efficiency_analyzer.py:147
Function
test_tool_calls_explicit_field_overrides_tool_presence
()
tests/test_ch7_cost_efficiency_analyzer.py:147
Function
test_tool_calls_zero_when_no_tool
()
tests/test_ch6_cost_efficiency_analyzer.py:153
Function
test_tool_calls_zero_when_no_tool
()
tests/test_ch7_cost_efficiency_analyzer.py:153
Function
test_tool_definition_is_available_for_moonshot_only
()
chapter1/web-search-agent/tests/test_agent.py:72
Method
test_tool_execution
Test tool execution
chapter1/context/tests/test_agent.py:153
Function
test_tool_items_handles_null_response
Contract: _tool_items returns empty list for None or non-dict response.
tests/test_ch1_search_codegen_null_response.py:24
Method
test_tool_name_casing_normalization
(self)
chapter9/harness-safety-gate/test_safety_policy_gate.py:175
Function
test_tool_protocol_rejects_non_tool_between_call_and_result
()
chapter2/system-hint/test_experiment_2_8.py:38
Function
test_tool_targets_are_valid_json_and_direct_targets_are_exact
()
chapter8/exact-copy-sft/tests/test_copy_pipeline.py:31
Method
test_tool_warning_after_three_calls
Test that system hint warns after 3+ tool calls
chapter5/coding-agent/tests/test_integration.py:38
Function
test_tools_are_deterministic
()
chapter5/provider-failover/tests/test_offline.py:166
Method
test_tools_initialization
Test tools initialization
chapter4/multimodal-agent/test_multimodal.py:187
Function
test_tools_off_disables_tool_execution
()
chapter4/multimodal-agent/test_interactive_tools_toggle.py:31
Function
test_tools_on_configures_complete_tool_state
()
chapter4/multimodal-agent/test_interactive_tools_toggle.py:19
Function
test_top_k
Test that different top_k values return the correct number of results
chapter3/agentic-rag-for-user-memory/test_top_k.py:17
Function
test_top_k
Test that different top_k values return the correct number of results
chapter3/contextual-retrieval-for-user-memory/test_top_k.py:17
Function
test_top_k_zero
Verify top_k=0 returns empty results list.
tests/test_ch3_hybrid_structured_retriever.py:272
Function
test_top_k_zero_returns_empty_list
Verify that top_k == 0 returns an empty list immediately.
chapter3/structured-index/test_hybrid_retriever.py:104
Method
test_trace_computes_pre_edit_boundary
(self)
chapter7/model-action-threshold/tests/test_experiment.py:22
Function
test_trailing_comma_does_not_raise
()
chapter4/perception-tools/test_parse_page_range_trailing_comma.py:16
Method
test_trajectory_reset
Test trajectory reset
chapter1/context/tests/test_agent.py:165
Function
test_trajectory_verifier_handles_empty_dimensions
()
chapter9/trajectory-verifier/test_empty_dimensions_score.py:8
Method
test_transcript_structure
Test the structure of transcript data.
chapter4/perception-tools/test_youtube_tools.py:216
Function
test_transfer_efficiency_none_accuracy
()
tests/test_ch7_evaluate_multilingual.py:277
Function
test_transfer_efficiency_none_accuracy
()
tests/test_ch8_evaluate_multilingual.py:277
Function
test_transfer_efficiency_zero_reference
()
tests/test_ch7_evaluate_multilingual.py:183
Function
test_transfer_efficiency_zero_reference
()
tests/test_ch8_evaluate_multilingual.py:183
Function
test_translation_unit_split_never_changes_source_or_cuts_fences
()
chapter10/book-translation/test_official_experiment.py:75
Method
test_trigger_rollback_failure
(self)
chapter9/harness-safety-gate/test_safety_policy_gate.py:223
Method
test_trigger_rollback_success
(self)
chapter9/harness-safety-gate/test_safety_policy_gate.py:216
Function
test_truly_empty_file_still_warns
(system_state, temp_dir)
chapter5/coding-agent/tests/test_read_limit_zero.py:19
Function
test_truncated_reply_cannot_be_recorded_as_a_selection
()
chapter4/active-tool-discovery/test_selection_ablation.py:47
Function
test_truncated_rsa_pem_without_end_redacted
()
chapter3/log-sanitization/tests/test_truncated_pem.py:9
Function
test_try_finally_cleanup_on_dispatch_exception
Test that pending requests and decision events are cleaned up even if dispatch raises an exception.
tests/test_ch4_notification_dispatcher.py:320
Function
test_turn_id_from_step_string
()
tests/test_ch6_cost_efficiency_analyzer.py:159
Function
test_turn_id_from_step_string
()
tests/test_ch7_cost_efficiency_analyzer.py:159
Method
test_txt_file_creation
Test TxtFile creation and basic properties.
chapter9/browser-use-rpa/browser-use/tests/ci/test_filesystem.py:35
Method
test_type1_with_multiple_special_params
Type 1 with multiple special params should work
chapter9/browser-use-rpa/browser-use/tests/ci/test_registry.py:578
Method
test_type1_with_param_model
Type 1: action(params: Model, special_args...) should work
chapter9/browser-use-rpa/browser-use/tests/ci/test_registry.py:551
Method
test_type2_no_action_params
Type 2 with only special params should work
chapter9/browser-use-rpa/browser-use/tests/ci/test_registry.py:629
Method
test_type2_simple_action
Type 2: action(arg1, arg2, special_args...) should work
chapter9/browser-use-rpa/browser-use/tests/ci/test_registry.py:598
Method
test_type2_with_defaults
Type 2 with default values should preserve defaults
chapter9/browser-use-rpa/browser-use/tests/ci/test_registry.py:615
Method
test_type_filtering
Test type parameter for file type filtering
chapter5/coding-agent/tests/test_grep_tool.py:134
Function
test_uberllm_base_url_override
(monkeypatch)
tests/test_providers.py:316
Function
test_uberllm_key_uses_multi_model_gateway_directly
(monkeypatch)
tests/test_providers.py:291
Function
test_uberllm_namespaces_bare_model_ids
(monkeypatch)
tests/test_providers.py:301
Function
test_uint8_energy_normalization
Verify uint8 PCM energy is normalized to [-1, 1).
tests/test_ch6_interruption_manager.py:171
Function
test_uint8_energy_normalization
Verify uint8 PCM energy is normalized to [-1, 1).
tests/test_ch9_interruption_manager.py:171
Function
test_uint8_normalization_around_128
Verify 8-bit unsigned audio is normalized around 128 correctly.
tests/test_ch6_interruption_manager.py:243
Function
test_uint8_normalization_around_128
Verify 8-bit unsigned audio is normalized around 128 correctly.
tests/test_ch9_interruption_manager.py:243
Function
test_unannotated_math_and_source_text_survive
(tmp_path, monkeypatch)
scripts/test_kindle_epub_patcher.py:11
Function
test_unapproved_commands_are_rejected_before_execution
()
chapter6/async-agent/test_real_tasks.py:20
Method
test_unary_minus
(self)
chapter1/context/tests/test_calc_sandbox.py:40
Method
test_unbounded_tools_are_rejected
(self)
chapter6/gemini-xlerobot-navigation/test_validator.py:26
Function
test_unconfigured_production_channel_fails_explicitly
Regression: an unconfigured production channel must fail explicitly, not silently succeed. Closes the class where mock channels reported success
tests/test_ch4_notification_dispatcher.py:577
Function
test_unconfigured_webhook_fails_explicitly
Regression: webhook channel without webhook_url in channel_config must fail explicitly.
tests/test_ch4_notification_dispatcher.py:593
Method
test_undo_move
Test undoing a move.
chapter4/collaboration-tools/test_chess_tools.py:277
Method
test_undo_no_moves
Test undoing when no moves have been made.
chapter4/collaboration-tools/test_chess_tools.py:296
Function
test_unexpected_phone_failure_cancels_peer_and_closes_channel
()
chapter10/autonomous-phone-registration/test_orchestration.py:116
Function
test_unfinished_status_raises
A non-finished data.status (with no audio) raises rather than returning empty audio.
chapter7/tts-quality-eval/test_minimax_t2a_refresh.py:97
Method
test_ungrounded_claims_flagged
A claim with no supporting evidence is flagged as ungrounded.
tests/test_ch8_trajectory_consistency_checker.py:77
Method
test_ungrounded_claims_flagged
A claim with no supporting evidence is flagged as ungrounded.
tests/test_ch9_trajectory_consistency_checker.py:77
Function
test_unhashable_evidence_in_result
()
chapter7/public-health-reporting-eval/tests/test_null_result.py:54
Function
test_unhashable_evidence_remains_order_independent
()
chapter7/public-health-reporting-eval/tests/test_null_result.py:62
Function
test_unhashable_target_role_in_transfer_to_agent_returns_error_string_not_crash
Regression test: when transfer_to_agent receives an unhashable target_role (e.g. list or dict), the orchestrator must not crash with TypeError: un
tests/test_ch10_multi_role_transfer_unhashable_target.py:44
Method
test_unicode_casefold_and_duplicate_detection
(self)
chapter7/model-action-threshold/tasks/crosscutting_identity/repo/tests/test_accounts.py:27
Method
test_unicode_content
Test writing Unicode content
chapter5/coding-agent/tests/test_write_tool.py:106
Method
test_uniqueness_check
Test that Edit fails if old_string is not unique (without replace_all)
chapter5/coding-agent/tests/test_edit_tool.py:64
Function
test_unknown_int_dtype_uses_value_range_scale
Regression: unknown integer dtypes must use a standard scale based on value range, not chunk max, so relative volume is preserved.
tests/test_ch6_interruption_manager.py:257
Function
test_unknown_int_dtype_uses_value_range_scale
Regression: unknown integer dtypes must use a standard scale based on value range, not chunk max, so relative volume is preserved.
tests/test_ch9_interruption_manager.py:257
Function
test_unknown_model_falls_back_to_default_when_openrouter_model_env_is_empty
Empty or whitespace OPENROUTER_MODEL must fall back to the package default. Locks out regression where OPENROUTER_MODEL set to empty string or wh
tests/test_providers.py:101
Function
test_unknown_model_falls_back_to_openrouter_model_env
Substituting a working default is opt-in, for callers that cannot send an unmapped id at all.
tests/test_providers.py:92
Function
test_unknown_model_is_kept_when_not_substituting
Rerouting for credential reasons keeps the model the reader asked for.
chapter1/web-search-agent/tests/test_config.py:36
Function
test_unknown_model_is_returned_unchanged_by_default
The default keeps the reader's model id, so an unhosted one is rejected by name rather than silently answered by a different vendor's model.
tests/test_providers.py:111
Function
test_unknown_model_uses_configured_openrouter_default
Substitution is opt-in, for callers that cannot send an unmapped id.
chapter1/web-search-agent/tests/test_config.py:28
Function
test_unknown_outcome_falls_back_to_tie
An unrecognized label degrades to a tie rather than NaN.
chapter7/elo-leaderboard/tests/test_tie_bothbad.py:41
Function
test_unknown_provider_lists_supported_ones
()
tests/test_providers.py:483
Function
test_unknown_requirement_id
()
chapter1/image-gen-workflow/tests/test_manifest_schema.py:70
Function
test_unknown_tool_still_reported
()
chapter4/multimodal-agent/test_execute_tool_robust.py:65
Function
test_unknown_tool_still_returns_error
()
chapter2/agent-skills-ppt/tests/test_dispatch.py:35
Function
test_unparsed_change_date_requires_review
()
tests/test_ch9_factual_grounding.py:91
Function
test_unquoted_secret_still_redacted
()
chapter3/log-sanitization/tests/test_quoted_secret_spaces.py:20
Function
test_unrelated_bad_requests_are_not_swallowed
()
chapter2/agent-skills-ppt/tests/test_reasoning_degrade.py:80
Method
test_unsafe_candidate_is_not_executed_during_validation
(self)
chapter9/self-modifying-agent/test_evolution.py:95
Method
test_unsafe_candidate_is_rejected_before_execution
(self)
chapter9/harness-safety-gate/test_evolution.py:212
Function
test_unsafe_domain_patterns
Test that unsafe domain patterns are rejected
chapter9/browser-use-rpa/browser-use/tests/ci/test_agent_sensitive_data.py:135
Function
test_unsupported_claim_loses_grounding_point
()
chapter7/public-health-reporting-eval/tests/test_offline.py:56
Method
test_unsupported_conclusion_flagged
A final answer with no evidence support is flagged.
tests/test_ch8_trajectory_consistency_checker.py:183
Method
test_unsupported_conclusion_flagged
A final answer with no evidence support is flagged.
tests/test_ch9_trajectory_consistency_checker.py:183
Function
test_unsupported_list_means_the_same_thing_in_every_branch
()
chapter1/context/test_grounding.py:109
Function
test_unverifiable_detail_requires_review
(text, result, arguments)
tests/test_ch9_factual_grounding.py:75
Method
test_unwhitelisted_names_and_calls
(self)
chapter1/context/tests/test_calc_sandbox.py:72
Function
test_update
(store, writer_ctx, reader_ctx)
chapter5/permission-embedded-data-objects/tests/test_core.py:79
Method
test_update_file_content
Test updating a line in file.
chapter4/execution-tools/test_terminal_controller.py:185
← previous
next →
12,601–12,700 of 13,003, ranked by callers