MCPcopy Create free account

hub / github.com/AIcling/agentic_geo / functions

Functions107 in github.com/AIcling/agentic_geo

↓ 14 callersFunctionformat_number_7decimals
Format number to 7 decimal places.
src/run_geo.py:24
↓ 14 callersFunctionformat_scores_7decimals
Format scores (can be nested lists/arrays) to 7 decimal places.
src/run_geo.py:33
↓ 10 callersFunctioncall_gpt
Synchronous wrapper that calls async or sync version based on config. Note: Caching has been removed to prevent cache corruption from concurr
src/geo_functions.py:131
↓ 8 callersFunctionload_config
Load configuration from an INI file. Uses Python's standard configparser module. Args: config_file: Path to the configuratio
src/config_loader.py:15
↓ 7 callersFunctionget_local_llm_model
Get local LLM model name from config.
src/config_loader.py:131
↓ 7 callersFunctionimpression_subjective_impression
(sentences, query, n = 5, normalize = True, idx = 0, metric = 'subjective_impression')
src/utils.py:149
↓ 7 callersFunctionuse_local_llm
Check if local LLM should be used.
src/config_loader.py:121
↓ 6 callersFunctionextract_citations_new
(text)
src/utils.py:36
↓ 4 callersFunctionget_answer
Get answer for a query using cached sources and real-time LLM generation. Args: query: The query string summaries: Optional l
src/utils.py:301
↓ 4 callersFunctionget_effective_api_config
Get the effective API configuration based on USE_LOCAL_LLM setting.
src/config_loader.py:141
↓ 4 callersFunctionsearch_handler
(req, source_count = 8)
src/search_try.py:172
↓ 3 callersFunctionget_model_name
Get the current LLM model name for file naming.
src/run_geo.py:181
↓ 3 callersFunctionget_num_words
(line)
src/utils.py:33
↓ 3 callersFunctionuse_async
Check if async mode should be used.
src/config_loader.py:136
↓ 2 callersFunction_safe_write_cache
Safely write cache JSON to disk using atomic write (temp file + rename). If writing fails, does not interrupt main process. Note: This no
src/utils.py:255
↓ 2 callersFunctioncall_gpt_async
Async version of call_gpt using AsyncOpenAI client. Note: Caching has been removed to prevent cache corruption from concurrent writes. Al
src/geo_functions.py:62
↓ 2 callersFunctionclean_source_gpt35_async
Async version of clean_source_gpt35 using AsyncOpenAI client.
src/search_try.py:31
↓ 2 callersFunctiongenerate_answer_async
Async version of generate_answer using AsyncOpenAI client.
src/generative_le.py:32
↓ 2 callersFunctionget_summary
Extract summary from LLM response, removing code blocks if present.
src/geo_functions.py:33
↓ 2 callersFunctionload_results
Load JSON result file.
src/merge_and_analyze_results.py:9
↓ 2 callersFunctionprocess_single_query_async
Async process a single query with error handling and immediate result saving.
src/run_geo.py:1081
↓ 2 callersMethodrank_strategies
Rank all strategies for given query and context. Args: query: User query context: Content to optimize str
src/surrogate_model_evolved.py:393
↓ 2 callersFunctionreturnable_score_from_scores
(scores)
src/utils.py:152
↓ 2 callersFunctionsanitize_string
Sanitize string to prevent JSON encoding issues. Args: s: String to sanitize Returns: Sanitized string safe for JSON encoding
src/run_geo.py:367
↓ 2 callersMethodselect
(self, indices)
src/run_geo.py:1429
↓ 2 callersMethodshuffle
(self, seed=None)
src/run_geo.py:1425
↓ 1 callersFunction_extract_rewritten_content
Best-effort extractor to return ONLY rewritten content. Some evolved strategies include an output format like: - "First output your plan, then the
src/run_geo.py:46
↓ 1 callersMethod_init_weights
(self, init_bias: float)
src/surrogate_model_evolved.py:101
↓ 1 callersMethod_load_backbone_checkpoint
Load pretrained backbone weights from checkpoint file. Args: ckpt_path: Path to pytorch_model.bin or similar checkpoint file
src/surrogate_model_evolved.py:272
↓ 1 callersFunctionapply_evolved_strategy
Apply an evolved strategy to rewrite content using LLM. This function implements the Oracle Rewrite logic for evolved strategies. The strategy_pro
src/run_geo.py:98
↓ 1 callersFunctionbuild_critic_prompt
Build Critic input prompt (aligned with training).
src/surrogate_model_evolved.py:51
↓ 1 callersFunctioncalculate_method_statistics
Calculate statistics for each method.
src/merge_and_analyze_results.py:30
↓ 1 callersFunctionclean_source_gpt35
Synchronous wrapper that calls async or sync version based on config.
src/search_try.py:86
↓ 1 callersFunctionclean_source_text
(text: str)
src/search_try.py:154
↓ 1 callersFunctionconvert_to_number
(x, min_val = 1.0)
src/utils.py:198
↓ 1 callersFunctionecn
(sentence)
src/utils.py:37
↓ 1 callersFunctiongenerate_answer
Synchronous wrapper that calls async or sync version based on config.
src/generative_le.py:81
↓ 1 callersFunctionget_api_key
Get OpenAI API key from config.
src/config_loader.py:108
↓ 1 callersFunctionimpression_pos_count_simple
(sentences, n = 5, normalize=True)
src/utils.py:76
↓ 1 callersFunctionimpression_word_count_simple
(sentences, n = 5, normalize=True)
src/utils.py:64
↓ 1 callersFunctionimpression_wordpos_count_simple
(sentences, n = 5, normalize=True)
src/utils.py:51
↓ 1 callersFunctioninit_results_file
Initialize results file with model name.
src/run_geo.py:191
↓ 1 callersFunctionmain
()
src/merge_and_analyze_results.py:184
↓ 1 callersFunctionmain
()
src/merge_results.py:135
↓ 1 callersFunctionmain
()
scripts/archive_to_strategies.py:23
↓ 1 callersFunctionmain
()
scripts/prep_evolved_for_hf.py:19
↓ 1 callersFunctionmain
()
base_model/download_base_model.py:20
↓ 1 callersFunctionmain_async
Main async entry point.
src/run_geo.py:1234
↓ 1 callersFunctionmerge_results
Merge two result files.
src/merge_and_analyze_results.py:15
↓ 1 callersFunctionmerge_results
Merge all split result files.
src/merge_results.py:18
↓ 1 callersFunctionpreload_geobench_to_cache
Preload GEO-Bench sources into cache. Args: dataset_file: Path to GEO-Bench jsonl cache_file: Target cache file path max_
src/preload_cache_from_geobench.py:8
↓ 1 callersFunctionpreload_msdata_to_cache
Preload MSdata sources into cache. Args: dataset_file: Path to MSdata JSON file (JSON array format) cache_file: Target cache file
src/preload_cache_from_msdata.py:8
↓ 1 callersFunctionprint_statistics
Print statistics.
src/merge_and_analyze_results.py:116
↓ 1 callersFunctionprocess_with_semaphore
(task)
src/run_geo.py:1214
↓ 1 callersFunctionrun_concurrent_async
Concurrent execution using asyncio.
src/run_geo.py:1204
↓ 1 callersFunctionrun_sequential_async
Sequential execution using async (original method, but async).
src/run_geo.py:1194
↓ 1 callersFunctionsanitize_for_json
Convert object to JSON-serializable form. Args: obj: Object to sanitize Returns: JSON-serializable version of the object
src/run_geo.py:419
↓ 1 callersFunctionsave_merged_results
Save merged results.
src/merge_and_analyze_results.py:165
↓ 1 callersFunctionsave_statistics
Save statistics to JSON.
src/merge_and_analyze_results.py:177
↓ 1 callersMethodscore_strategy
Score a single strategy using SHORT_PROMPT. Args: query: User query context: Content to optimize strategy
src/surrogate_model_evolved.py:332
↓ 1 callersMethodselect_best_strategy
Select the best strategy based on Critic prediction. Critic SHORT_PROMPT strategy FULL_PROMPT Args: query: User query
src/surrogate_model_evolved.py:483
↓ 1 callersFunctionsummarize_text_identity
(source, query)
src/search_try.py:168
↓ 1 callersFunctiontruncate_content
Truncate content, Head+Tail mode supported. IMPORTANT: This must match the truncation used during training to ensure training-inference consi
src/surrogate_model_evolved.py:22
↓ 1 callersFunctionvalidate_json_serializable
Validate that an object can be JSON serialized. Args: obj: Object to validate path: Current path in object tree (for error reporting) Return
src/run_geo.py:325
Method__getitem__
(self, idx)
src/run_geo.py:1397
Method__getitem__
(self, idx)
src/run_geo.py:1418
Method__init__
(self, data_dict)
src/run_geo.py:1390
Method__init__
(self, data_dict)
src/run_geo.py:1411
Method__init__
( self, hidden_size: int = 1536, intermediate_size: int = 1024, dropout: float
src/surrogate_model_evolved.py:84
Method__init__
Initialize the evolved Critic model. Args: base_model_path: Path to Qwen2.5-1.5B-Instruct base model (for structure)
src/surrogate_model_evolved.py:134
Method__init__
Initialize the evolved strategy selector. Args: base_model_path: Path to Qwen2.5-1.5B-Instruct base model (for structure)
src/surrogate_model_evolved.py:429
Method__iter__
(self)
src/run_geo.py:1400
Method__iter__
(self)
src/run_geo.py:1421
Method__len__
(self)
src/run_geo.py:1394
Method__len__
(self)
src/run_geo.py:1415
Functionauthoritative_optimization_mine
(summary)
src/geo_functions.py:234
Functioncheck_summaries_exist
(sources, summaries)
src/utils.py:294
Functionciting_credible_sources_mine
(summary)
src/geo_functions.py:270
Functionfluent_optimization_gpt
(summary)
src/geo_functions.py:220
Methodforward
Args: hidden_states: (batch_size, hidden_size) Returns: scores: (batch_size,)
src/surrogate_model_evolved.py:107
Functionget_api_base
Get OpenAI API base URL from config.
src/config_loader.py:116
Functionget_local_llm_base
Get local LLM base URL from config.
src/config_loader.py:126
Functionget_prompt
(source, query)
src/utils.py:19
Methodget_strategy_by_id
Get strategy by genotype_id.
src/surrogate_model_evolved.py:535
Functionget_strategy_prompts
Get strategy prompts (for compatibility with old interface). Note: This is kept for API compatibility, but evolved strategies are loaded from
src/surrogate_model_evolved.py:547
Functionidentity
(summary, source=None)
src/run_geo.py:139
Functionimpression_diversity_detailed
(sentences, query, n = 5, normalize = True, idx = 0)
src/utils.py:131
Functionimpression_follow_detailed
(sentences, query, n = 5, normalize = True, idx = 0)
src/utils.py:137
Functionimpression_influence_detailed
(sentences, query, n = 5, normalize = True, idx = 0)
src/utils.py:140
Functionimpression_para_based
(sentences, n = 5, normalize = True, alpha = 1.1, beta = 1.5, gamma2 = 1/math.e)
src/utils.py:89
Functionimpression_relevance_detailed
(sentences, query, n = 5, normalize = True, idx = 0)
src/utils.py:143
Functionimpression_subjcount_detailed
(sentences, query, n = 5, normalize = True, idx = 0)
src/utils.py:146
Functionimpression_subjpos_detailed
(sentences, query, n = 5, normalize = True, idx = 0)
src/utils.py:128
Functionimpression_uniqueness_detailed
(sentences, query, n = 5, normalize = True, idx = 0)
src/utils.py:134
Functionimprove
Process a query through GEO optimization pipeline. Note: static_cache now defaults to True to use pre-loaded cache from GEO-Bench. This prevents u
src/run_geo.py:945
Functionimprove_with_model_selection
Process a query using surrogate model for strategy selection. New workflow: 1. Use surrogate model to rank all strategies 2. Select the best stra
src/run_geo.py:628
Functionload_evolved_strategies
Load evolved strategies from JSON file. Args: strategies_path: Path to final_strategies_with_prompts.json Returns: List of s
src/surrogate_model_evolved.py:556
Functionmore_quotes_mine
(summary)
src/geo_functions.py:255
Functionreload_config
Force reload configuration from file and environment variables.
src/config_loader.py:160
Functionsave_query_result
Append a single query result to the results file with robust error handling. Args: file_path: Path to the results JSON file query_result: Dicti
src/run_geo.py:454
next →1–100 of 107, ranked by callers