MCPcopy Create free account

hub / github.com/FoundationAgents/SPO / functions

Functions61 in github.com/FoundationAgents/SPO

↓ 23 callersMethodget
Get the configuration for a specific LLM by name
llm/async_llm.py:64
↓ 4 callersMethodget_instance
Get the global instance
utils/llm_client.py:72
↓ 4 callersMethodget_price
Get the price per 1K tokens for a specific model and token type (input/output)
llm/async_llm.py:107
↓ 4 callersMethodresponser
(self, request_type: RequestType, messages: List[dict])
utils/llm_client.py:52
↓ 3 callersMethod_load_llm_config
(self, kwargs: dict)
utils/llm_client.py:29
↓ 3 callersFunctionextract_content
(xml_string: str, tag: str)
utils/llm_client.py:79
↓ 3 callersMethodget_best_round
(self)
utils/data_utils.py:25
↓ 3 callersMethodinitialize
Initialize the global instance
utils/llm_client.py:67
↓ 3 callersMethodwrite
(self, message)
app.py:179
↓ 2 callersMethodcreate_round_directory
(self, prompt_path: Path, round_number: int)
utils/prompt_utils.py:10
↓ 2 callersMethoddefault
Get or create a default configuration from YAML file
llm/async_llm.py:33
↓ 2 callersMethodevaluate_prompt
( self, optimizer: Any, samples: Optional[dict], new_samples: dict, pa
utils/evaluation_utils.py:36
↓ 2 callersMethodexecute_prompt
(self, optimizer: Any, prompt_path: Path)
utils/evaluation_utils.py:24
↓ 2 callersMethodget_results_file_path
(self, prompt_path: Path)
utils/data_utils.py:34
↓ 2 callersMethodlist_to_markdown
Convert a list of question-answer dictionaries to a formatted Markdown string. Args: questions_list (list): List of dict
utils/data_utils.py:79
↓ 2 callersMethodload_results
(self, path: Path)
utils/data_utils.py:16
↓ 2 callersMethodoptimize
(self)
components/optimizer.py:40
↓ 2 callersMethodwrite_answers
(self, directory: Path, answers: dict, name: str = "answers.txt")
utils/prompt_utils.py:24
↓ 2 callersMethodwrite_prompt
(self, directory: Path, prompt: str)
utils/prompt_utils.py:32
↓ 1 callersMethod_evaluate_new_prompt
(self, prompt_path, data, directory)
components/optimizer.py:121
↓ 1 callersMethod_generate_optimized_prompt
(self)
components/optimizer.py:93
↓ 1 callersMethod_handle_first_round
(self, prompt_path: Path, data: List[dict])
components/optimizer.py:79
↓ 1 callersMethod_load_scores
(self)
utils/data_utils.py:45
↓ 1 callersMethod_log_optimization_result
(self, success)
components/optimizer.py:134
↓ 1 callersMethod_optimize_prompt
(self)
components/optimizer.py:58
↓ 1 callersMethodadd_usage
Add token usage for a specific API call
llm/async_llm.py:131
↓ 1 callersFunctioncount_tokens
(sample: dict)
utils/evaluation_utils.py:12
↓ 1 callersMethodcreate_result_data
(self, round: int, answers: list[dict], prompt: str, succeed: bool, tokens: int)
utils/data_utils.py:37
↓ 1 callersFunctiondisplay_optimization_results
(result_data)
app.py:37
↓ 1 callersFunctionget_response
()
app.py:262
↓ 1 callersMethodget_summary
Get a summary of token usage and costs
llm/async_llm.py:158
↓ 1 callersMethodload_prompt
(self, round_number: int, prompts_path: Path)
utils/prompt_utils.py:15
↓ 1 callersFunctionload_yaml_template
(template_path: Path)
app.py:13
↓ 1 callersFunctionmain
()
app.py:74
↓ 1 callersFunctionmain
()
optimize.py:28
↓ 1 callersFunctionparse_args
()
optimize.py:7
↓ 1 callersMethodprompt_evaluate
Evaluate two samples and return the evaluation result Returns: True: New sample is better False: Old sample i
components/evaluator.py:50
↓ 1 callersMethodprompt_execute
(self)
components/evaluator.py:24
↓ 1 callersMethodsave_results
(self, json_file_path: Path, data: Union[List, Dict])
utils/data_utils.py:41
↓ 1 callersFunctionsave_yaml_template
(template_path: Path, data: Dict)
app.py:20
↓ 1 callersMethodshow_final_result
(self)
components/optimizer.py:49
Method__call__
(self, messages)
llm/async_llm.py:194
Method__init__
( self, optimized_path: str = None, initial_round: int = 1, max_rounds: int =
components/optimizer.py:20
Method__init__
(self, prompt: str)
components/evaluator.py:20
Method__init__
(self)
components/evaluator.py:47
Method__init__
( self, optimize_kwargs: Optional[dict] = None, evaluate_kwargs: Optional[dict] = None
utils/llm_client.py:18
Method__init__
(self, root_path: Path)
utils/prompt_utils.py:7
Method__init__
(self, root_path: Path)
utils/data_utils.py:12
Method__init__
(self, root_path: Path)
utils/evaluation_utils.py:21
Method__init__
(self, config: dict)
llm/async_llm.py:14
Method__init__
Initialize with an optional configuration dictionary
llm/async_llm.py:28
Method__init__
(self)
llm/async_llm.py:125
Method__init__
Initialize the AsyncLLM with a configuration Args: config: Either an LLMConfig instance or a string representing the LLM
llm/async_llm.py:171
Methodadd_config
Add or update a configuration
llm/async_llm.py:83
Functioncreate_llm_instance
Create an AsyncLLM instance using the provided configuration Args: llm_config: Either an LLMConfig instance, a dictionary of configu
llm/async_llm.py:237
Methodfetch_answer
(q: str)
components/evaluator.py:28
Methodget_all_names
Get names of all available LLM configurations
llm/async_llm.py:87
Methodget_usage_summary
Get a summary of token usage and costs
llm/async_llm.py:232
Functionload_meta_data
(k: int = SAMPLE_K)
utils/load.py:14
Functionprompt_optimizer_filter
(record)
app.py:189
Functionset_file_name
(name: str)
utils/load.py:9