MCPcopy Create free account

hub / github.com/EternityJune25/ComoRAG / functions

Functions257 in github.com/EternityJune25/ComoRAG

Method_save_clustering_results
Save clustering results
src/comorag/utils/cluster_utils.py:151
Methodadd_content
Add new content and update hash values
src/comorag/utils/memory_utils.py:45
Methodadd_node
Add node to memory pool
src/comorag/utils/memory_utils.py:85
Methodainfer
Perform asynchronous inference using the LLM. Args: chat (List[TextChatMessage]): Input chat history for the LLM
src/comorag/llm/base.py:155
Functionall_values_of_same_length
Return True if all values in 'data' have the same length or data is an empty dict, otherwise return False.
src/comorag/utils/misc_utils.py:166
Methodbatch_encode
(self, texts: List[str], **kwargs)
src/comorag/embedding_model/OpenAI.py:87
Methodbatch_infer
(self, messages_list: List[List[TextChatMessage]], max_tokens=2048, json_template=None)
src/comorag/llm/vllm_offline.py:77
Methodbatch_openie
Conduct batch OpenIE synchronously using vLLM offline batch mode, including NER and triple extraction Args: chunks (Dict
src/comorag/information_extraction/openie_vllm_offline.py:20
Methodbatch_upsert_llm_config
Upsert self.llm_config with attribute-value pairs specified by a dict. Args: updates (Dict[str, Any]): a dict t
src/comorag/llm/base.py:140
Functioncache_response
(func)
src/comorag/llm/openai_gpt.py:26
Methodcalculate_expected_summaries
Calculate expected total number of summaries, only calculate one level Args: total_chunks: Number of text chunks
src/comorag/utils/timeline_utils.py:420
Methodcleanup_temp_folders
()
src/comorag/ComoRAG.py:1113
Methodclear
Clear the entire cache.
src/comorag/embedding_model/base.py:257
Methodcompute_f1
(gold: str, predicted: str)
script/eval_qa.py:90
Methodcontains
Check if the embedding exists in cache.
src/comorag/embedding_model/base.py:251
Functionconvert_text_chat_messages_to_strings
(messages: List[TextChatMessage], tokenizer: PreTrainedTokenizer, add_assistant_header=True)
src/comorag/llm/vllm_offline.py:11
Methodcreate_cluster_summary
Create summary for the specified cluster Args: cluster_id: Cluster ID summary_model: Model used for
src/comorag/utils/cluster_utils.py:545
Functiondynamic_retry_decorator
(func)
src/comorag/llm/openai_gpt.py:104
Methodencode_passages
Encode passages with the appropriate instruction prefix. Args: passages: Passage or list of passages to encode
src/comorag/embedding_model/BGEEmbedding.py:201
Methodencode_queries
Encode queries with the appropriate instruction prefix. Args: queries: Query or list of queries to encode
src/comorag/embedding_model/BGEEmbedding.py:187
Methodfind_chunks_by_similarity
Find chunks based on text similarity and return their cluster information Args: query_text: Query text
src/comorag/utils/cluster_utils.py:505
Methodfrom_json
Create an LLMConfig instance from a JSON string.
src/comorag/llm/base.py:100
Methodfrom_json
Create an LLMConfig instance from a JSON string.
src/comorag/embedding_model/base.py:96
Methodget_all_nodes
Get all nodes
src/comorag/utils/memory_utils.py:124
Methodget_full_content
Get complete node content for generating embeddings
src/comorag/utils/memory_utils.py:61
Methodget_hash_ids_in_same_clusters
Get all chunks in the same clusters as the specified chunk and their association strength Args: hash_id: Target
src/comorag/utils/cluster_utils.py:491
Methodget_members_above_threshold
Get members with membership scores above threshold
src/comorag/utils/cluster_utils.py:33
Methodget_nodes_by_hash
Get nodes by hash value
src/comorag/utils/memory_utils.py:113
Methodget_query_doc_scores
(self, query_vec: np.ndarray, doc_vecs: np.ndarray)
src/comorag/embedding_model/base.py:212
Methodget_temp_nodes
Get all nodes from temporary memory pool
src/comorag/utils/memory_utils.py:109
Methodinfer
(self, messages: List[TextChatMessage], max_tokens=2048)
src/comorag/llm/vllm_offline.py:62
Methodinfer
( self, messages: List[TextChatMessage], **kwargs )
src/comorag/llm/openai_gpt.py:171
Methodis_template_name_valid
(self, name: str)
src/comorag/prompts/prompt_template_manager.py:197
Methodlist_template_names
List all available template names. Returns: List[str]: A list of template names.
src/comorag/prompts/prompt_template_manager.py:142
Methodmeta_control_loop
process single query
src/comorag/ComoRAG.py:265
Functionnum_tokens_by_tiktoken
(text: str)
src/comorag/utils/llm_utils.py:325
Methodopenie
(self, chunk_key: str, passage: str)
src/comorag/information_extraction/openie_openai.py:192
Methodprint_template
Print the prompt template string or chat history structure for the given template name. Args: name (str): The name of th
src/comorag/prompts/prompt_template_manager.py:173
Methodprocess
(self, *args, **kwargs)
src/comorag/utils/agents.py:50
Methodprocess_content
(content_type, content)
src/comorag/utils/agents.py:90
Functionreason_step
Given few-shot samples, query, previous retrieved passages, and previous thoughts, generate the next thought with OpenAI models. The generated th
src/comorag/utils/qa_utils.py:34
Functionreplace_placeholder
(match)
src/comorag/utils/llm_utils.py:52
Functionreplace_unicode_escape
(match: re.Match)
src/comorag/utils/llm_utils.py:86
Functionsafe_unicode_decode
Safely decodes a string or byte sequence containing Unicode escape sequences into a properly decoded Unicode string. Args: content (
src/comorag/utils/llm_utils.py:69
Functionsave_results
保存结果到指定目录下的 results.json 文件
src/comorag/utils/misc_utils.py:197
Methodset
Store an embedding in the cache.
src/comorag/embedding_model/base.py:244
Functionstring_to_bool
(v)
src/comorag/utils/misc_utils.py:185
Methodsummarize
Generate text summary using GPT-4o-mini model :param context: Text that needs to be summarized :param max_tokens: Maximum nu
src/comorag/utils/summarization_utils.py:32
Methodsync_render
(self, name: str, **kwargs)
src/comorag/prompts/prompt_template_manager.py:139
Methodto_dict
(self)
src/comorag/utils/misc_utils.py:55
Methodto_dict
(self)
src/comorag/utils/misc_utils.py:81
Methodto_dict
Export the configuration as a JSON-serializable dictionary.
src/comorag/llm/base.py:84
Methodto_dict
Export the configuration as a JSON-serializable dictionary.
src/comorag/embedding_model/base.py:80
Methodto_json
Export the configuration as a JSON string.
src/comorag/llm/base.py:88
Methodto_json
Export the configuration as a JSON string.
src/comorag/embedding_model/base.py:84
Functionwrapper
(self, *args, **kwargs)
src/comorag/llm/openai_gpt.py:28
Functionwrapper
(**kwargs)
src/comorag/embedding_model/base.py:113
← previous201–257 of 257, ranked by callers