Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aiwaves-cn/agents
/ functions
Functions
388 in github.com/aiwaves-cn/agents
⨍
Functions
388
◇
Types & classes
90
↓ 21 callers
Method
error
(self)
src/agents/tools/web_browse.py:45
↓ 15 callers
Method
dump
(self, save_path)
src/agents/task/sop.py:452
↓ 13 callers
Method
get_response
(cls, **kwargs)
src/agents/agents/llm.py:84
↓ 11 callers
Method
update
Updates the evaluation results. Args: **kwargs: Arbitrary keyword arguments for updating the evaluation results.
src/agents/evaluation/case.py:279
↓ 10 callers
Method
_validate_config
(self)
src/agents/utils/config.py:13
↓ 9 callers
Method
extract_data_from_response
Extract specific components from a string based on provided tags. This function searches for specific tags in the provided content a
src/agents/optimization/utils.py:291
↓ 9 callers
Method
load
(self, config_path_or_dict: Union[str, dict])
src/agents/utils/config.py:20
↓ 9 callers
Method
run
(self, mode="test")
src/agents/task/solution.py:77
↓ 8 callers
Method
get_memory
()
src/agents/agents/memory.py:42
↓ 8 callers
Method
to_dict
get the whole SOP configuration in dict format Returns: dict
src/agents/task/sop.py:464
↓ 7 callers
Method
encode_memory
Convert a sequence of messages to strings and encode them into one string.
src/agents/agents/memory.py:46
↓ 7 callers
Method
get_response
return LLM's response
src/agents/agents/llm.py:109
↓ 7 callers
Method
save
r"""Saves a batch of records to the key-value storage system. Args: records (List[Dict[str, Any]]): A list of dictionaries, where
src/agents/utils/storages/key_value_storages/json.py:22
↓ 6 callers
Function
completion_with_backoff
(**kwargs)
src/agents/agents/llm.py:33
↓ 6 callers
Function
get_config_needed_variables
Get the variables needed in the prompt configuration. This function retrieves the variables required by the prompt templates specified in th
src/agents/optimization/prompt_formatter.py:37
↓ 5 callers
Method
clear
r"""Removes all records from the key-value storage system.
src/agents/utils/storages/key_value_storages/json.py:42
↓ 5 callers
Method
execute
(self, action: Action)
src/agents/agents/agent_team.py:123
↓ 5 callers
Function
formulate_prompt
Formulate a prompt using the provided configuration and data dictionary. This function generates a prompt by extracting necessary variables
src/agents/optimization/prompt_formatter.py:105
↓ 5 callers
Method
parallel_case_forward
Executes forward pass for each case in parallel and saves the results. Args: case_list (list[Case]): List of cases to be
src/agents/optimization/utils.py:122
↓ 5 callers
Method
train
Train solution.json Returns: None: This function does not return any value.
src/agents/optimization/trainer.py:229
↓ 4 callers
Method
add
r"""Adds a list of vectors to the specified collection. Args: vectors (List[VectorRecord]): List of vectors to be added.
src/agents/utils/storages/vectordb_storages/qdrant.py:239
↓ 4 callers
Method
dump
Save the solution configuration to a file.
src/agents/task/solution.py:110
↓ 4 callers
Method
load
Load data from a JSON file. Args: file_path (str): The path to the JSON file. Returns: List[Any]: The data
src/agents/datasets/base.py:23
↓ 4 callers
Function
normalize_answer
(s)
src/agents/datasets/hotpotqa.py:9
↓ 4 callers
Method
optimize
Optimizes the SOP for the given list of cases. Args: case_list (list[Case]): List of cases to be optimized.
src/agents/optimization/sop_optimizer.py:62
↓ 3 callers
Method
append_memory
(self, chunk)
src/agents/agents/memory.py:202
↓ 3 callers
Method
dumps
(self)
src/agents/utils/config.py:44
↓ 3 callers
Method
from_config
(cls, config_path_or_dict)
src/agents/agents/toolkit.py:32
↓ 3 callers
Method
get_case_dict
Create a dictionary representing a case at a specific index. Args: idx (int): The index of the case. Returns:
src/agents/datasets/math.py:89
↓ 3 callers
Method
get_dict_for_node_optimizer
Get the dict for the optimizer. only get the info needed for the optimizer.
src/agents/task/node.py:479
↓ 3 callers
Method
get_dict_for_sop_optimizer
get the SOP configuration in dict format for SOP optimizer. 会删除掉一些与SOP优化无关的字段 Returns:
src/agents/task/sop.py:481
↓ 3 callers
Method
get_dict_for_trainer
Gets the information needed for the trainer. Allowed keys: - prompt_template: Components used to generate the last prompt, e
src/agents/evaluation/state.py:52
↓ 3 callers
Method
get_memory_string
(self, agent_name=None)
src/agents/agents/memory.py:131
↓ 3 callers
Method
readlines
(self, *args, **kwargs)
src/agents/utils/execution.py:54
↓ 3 callers
Function
save_logs
(log_path, messages, response)
src/agents/utils/files.py:35
↓ 3 callers
Method
to_dict
(self)
src/agents/utils/config.py:52
↓ 3 callers
Method
to_dict
trans to a dict, it will cover all the information of the node. the dict can be used to initialize a node.
src/agents/task/node.py:437
↓ 3 callers
Method
to_dict
Returns a JSON dict representation of the case. It covers all the information of the case. Returns: dict: A dictionary c
src/agents/evaluation/case.py:225
↓ 3 callers
Method
to_dict
used for serialization in state
src/agents/agents/agent.py:305
↓ 2 callers
Method
__init__
(self)
src/agents/tools/math.py:8
↓ 2 callers
Method
__init__
(self, config: NodeConfig)
src/agents/task/node.py:326
↓ 2 callers
Method
__init__
(self, config: LLMConfig)
src/agents/agents/llm.py:72
↓ 2 callers
Method
_create_collection
r"""Creates a new collection in the database. Args: collection_name (str): Name of the collection to be created. size
src/agents/utils/storages/vectordb_storages/qdrant.py:157
↓ 2 callers
Method
_create_collection
r"""Creates a new collection in the database. Args: collection_name (str): Name of the collection to be created. **kw
src/agents/utils/storages/vectordb_storages/milvus.py:101
↓ 2 callers
Method
_delete_collection
r"""Deletes an existing collection from the database. Args: collection (str): Name of the collection to be deleted. *
src/agents/utils/storages/vectordb_storages/qdrant.py:190
↓ 2 callers
Method
_get_collection_info
r"""Retrieves details of an existing collection. Args: collection_name (str): Name of the collection to be checked. Retu
src/agents/utils/storages/vectordb_storages/qdrant.py:214
↓ 2 callers
Method
_get_collection_info
r"""Retrieves details of an existing collection. Args: collection_name (str): Name of the collection to be checked. Retu
src/agents/utils/storages/vectordb_storages/milvus.py:200
↓ 2 callers
Method
append_memory_from_short_term_memory
(self, short_term_memory: ShortTermMemory)
src/agents/agents/memory.py:205
↓ 2 callers
Method
apply_var_to_prompt
Apply the padding to the prompt template.
src/agents/task/node.py:425
↓ 2 callers
Function
check_variables
Check for variables needed in a prompt template. This function identifies all variables wrapped in `{}` but not `{{}}` within a given prompt
src/agents/optimization/prompt_formatter.py:9
↓ 2 callers
Method
construct
r"""A class method to construct a `VectorDBQueryResult` instance.
src/agents/utils/storages/vectordb_storages/base.py:55
↓ 2 callers
Method
embed
r"""Generates an embedding for the given text. Args: obj (T): The object for which to generate the embedding. **kwarg
src/agents/utils/embeddings.py:73
↓ 2 callers
Method
embed_list
r"""Generates embeddings for the given texts. Args: objs (List[T]): The objects for which to generate the embeddings.
src/agents/utils/embeddings.py:55
↓ 2 callers
Function
extract
extract the content between <type></type> Args: text (str): complete sentence type (str): tag Returns: str: content
src/agents/utils/text.py:25
↓ 2 callers
Function
extract
(text, type)
src/agents/datasets/math.py:25
↓ 2 callers
Function
format_str_without_error
Format a string template with the provided data dictionary, ensuring no errors occur due to missing keys. This function cannot handle cases
src/agents/optimization/prompt_formatter.py:74
↓ 2 callers
Method
generate_config
(cls, query, task_description)
src/agents/task/sop.py:48
↓ 2 callers
Method
get_case_dict
Abstract method to get a case-specific dict by index. Args: idx (int): The index of the case-specific dict. Returns
src/agents/datasets/base.py:74
↓ 2 callers
Function
get_embedding
(sentence: str)
src/agents/utils/embeddings.py:12
↓ 2 callers
Method
get_memory
(self)
src/agents/agents/memory.py:120
↓ 2 callers
Method
get_output_dim
r"""Returns the output dimension of the embeddings. Returns: int: The dimensionality of the embedding for the current model.
src/agents/utils/embeddings.py:91
↓ 2 callers
Method
load
r"""Loads all stored records from the key-value storage system. Returns: List[Dict[str, Any]]: A list of dictionaries, where each
src/agents/utils/storages/key_value_storages/json.py:32
↓ 2 callers
Method
load_node_prompts
Load the node prompts from the padding in the config or the case.
src/agents/task/node.py:367
↓ 2 callers
Method
run_vector_retriever
r"""Executes the automatic vector retriever process using vector storage. Args: query (str): Query string for information retriev
src/agents/utils/retrievers/auto_retriever.py:173
↓ 2 callers
Method
status
(self)
src/agents/utils/storages/vectordb_storages/qdrant.py:296
↓ 2 callers
Method
to_dict
Convert the dataset to a dictionary using task IDs as keys. Returns: Dict[str, Dict[str, Any]]: A dictionary mapping tas
src/agents/datasets/humaneval.py:181
↓ 1 callers
Method
__init__
(self, config: TaskConfig)
src/agents/task/task.py:68
↓ 1 callers
Method
__init__
(self, config: SOPConfig)
src/agents/task/sop.py:141
↓ 1 callers
Method
__init__
(self, config: SolutionConfig)
src/agents/task/solution.py:65
↓ 1 callers
Method
__init__
Initializes the LossConfig object. Args: config_path (str): The path to the configuration file.
src/agents/optimization/loss.py:16
↓ 1 callers
Method
__init__
Initializes the Optimizer object. Args: config (OptimizerConfig): The optimizer configuration.
src/agents/optimization/optimizer.py:61
↓ 1 callers
Method
__init__
Initializes the NodeOptimizer object. Args: config (NodeOptimizerConfig): The node optimizer configuration.
src/agents/optimization/node_optimizer.py:44
↓ 1 callers
Method
__init__
(self, config: SOPOptimizerConfig, logger_name: str)
src/agents/optimization/sop_optimizer.py:48
↓ 1 callers
Method
__init__
(self, config: ToolkitOptimizerConfig, logger_name: str = None)
src/agents/optimization/toolkit_optimizer.py:20
↓ 1 callers
Method
__init__
(self, config: PromptOptimizerConfig, logger_name=None)
src/agents/optimization/prompt_optimizer.py:62
↓ 1 callers
Method
__init__
Init the trainer Args: config (TrainerConfig): The TrainerConfig used to initialize the Trainer dataset (Bas
src/agents/optimization/trainer.py:79
↓ 1 callers
Method
__init__
(self, config: KnowledgeBaseConfig)
src/agents/knowledge_bases/knowledge_base.py:79
↓ 1 callers
Method
__init__
(self, config: EnvironmentConfig)
src/agents/agents/environment.py:48
↓ 1 callers
Method
__init__
(self, config: AgentConfig)
src/agents/agents/agent.py:68
↓ 1 callers
Method
__init__
(self, config: AgentTeamConfig)
src/agents/agents/agent_team.py:103
↓ 1 callers
Method
__init__
(self, config: ActionConfig)
src/agents/agents/action.py:70
↓ 1 callers
Method
_check_and_create_collection
(self)
src/agents/utils/storages/vectordb_storages/qdrant.py:140
↓ 1 callers
Method
_check_and_create_collection
r"""Checks if the specified collection exists in Milvus and creates it if it doesn't, ensuring it matches the specified vector dimensionality.
src/agents/utils/storages/vectordb_storages/milvus.py:83
↓ 1 callers
Method
_collection_exists
r"""Returns wether the collection exists in the database
src/agents/utils/storages/vectordb_storages/qdrant.py:203
↓ 1 callers
Method
_collection_exists
r"""Checks whether a collection with the specified name exists in the database. Args: collection_name (str): The name of
src/agents/utils/storages/vectordb_storages/milvus.py:175
↓ 1 callers
Method
_collection_name_generator
r"""Generates a valid collection name from a given file path or URL. Args: content_input_path: str. The input URL or file path from w
src/agents/utils/retrievers/auto_retriever.py:84
↓ 1 callers
Method
_create_client
( self, url_and_api_key: Optional[Tuple[str, str]], path: Optional[str], **kwa
src/agents/utils/storages/vectordb_storages/qdrant.py:112
↓ 1 callers
Method
_create_client
r"""Initializes the Milvus client with the provided connection details. Args: url_and_api_key (Tuple[str, str]): The URL and API
src/agents/utils/storages/vectordb_storages/milvus.py:63
↓ 1 callers
Method
_delete_collection
r"""Deletes an existing collection from the database. Args: collection (str): Name of the collection to be deleted.
src/agents/utils/storages/vectordb_storages/milvus.py:164
↓ 1 callers
Method
_ensure_unstructured_version
r"""Validates that the installed 'Unstructured' library version satisfies the specified minimum version requirement. This function is
src/agents/utils/unstructured_io.py:24
↓ 1 callers
Method
_generate_collection_name
r"""Generates a collection name if user doesn't provide
src/agents/utils/storages/vectordb_storages/qdrant.py:210
↓ 1 callers
Method
_generate_collection_name
r"""Generates a unique name for a new collection based on the current timestamp. Milvus collection names can only contain alphanumeric
src/agents/utils/storages/vectordb_storages/milvus.py:187
↓ 1 callers
Method
_get_file_modified_date_from_file
r"""Retrieves the last modified date and time of a given file. This function takes a file path as input and returns the last modified date
src/agents/utils/retrievers/auto_retriever.py:119
↓ 1 callers
Method
_get_file_modified_date_from_storage
r"""Retrieves the last modified date and time of a given file. This function takes vector storage instance as input and returns the last
src/agents/utils/retrievers/auto_retriever.py:137
↓ 1 callers
Method
_initialize_vector_storage
r"""Sets up and returns a vector storage instance with specified parameters. Args: collection_name (Optional[str]): Name of the c
src/agents/utils/retrievers/auto_retriever.py:50
↓ 1 callers
Method
_load_data
Loads data from all files in the given directory that match the expected format. Args: root_dir (str): The root director
src/agents/datasets/math.py:52
↓ 1 callers
Method
_login
(self, cfg_file: str)
src/agents/tools/mail.py:85
↓ 1 callers
Method
_parse
(self, data)
src/agents/tools/weather.py:34
↓ 1 callers
Method
_query
https://www.weatherbit.io/api/historical-weather-daily
src/agents/tools/weather.py:52
↓ 1 callers
Method
_validate_and_convert_vectors
r"""Validates and converts VectorRecord instances to the format expected by Milvus. Args: records (List[VectorRecord]): L
src/agents/utils/storages/vectordb_storages/milvus.py:229
next →
1–100 of 388, ranked by callers