diff --git a/lightrag/lightrag/components/reasoning/chain_of_thought.py b/lightrag/lightrag/components/reasoning/chain_of_thought.py index 699975e2..432613ca 100644 --- a/lightrag/lightrag/components/reasoning/chain_of_thought.py +++ b/lightrag/lightrag/components/reasoning/chain_of_thought.py @@ -1,4 +1,6 @@ """ +Chain of the thought(CoT) is to mimic a step-by-step thought process for arriving at the answer. + https://arxiv.org/abs/2201.11903, published in Jan, 2023 Chain of the thought(CoT) is to mimic a step-by-step thought process for arriving at the answer. You can achieve it in two ways: diff --git a/lightrag/lightrag/core/component.py b/lightrag/lightrag/core/component.py index fd6c64fa..b51b1ae8 100644 --- a/lightrag/lightrag/core/component.py +++ b/lightrag/lightrag/core/component.py @@ -1,3 +1,5 @@ +"""Component is to LLM task pipelines what nn.Module is to PyTorch models.""" + from collections import OrderedDict, namedtuple from typing import ( Callable, diff --git a/lightrag/lightrag/core/default_prompt_template.py b/lightrag/lightrag/core/default_prompt_template.py index 65813ee9..3355a8cf 100644 --- a/lightrag/lightrag/core/default_prompt_template.py +++ b/lightrag/lightrag/core/default_prompt_template.py @@ -1,3 +1,8 @@ +"""This is the default system prompt template used in the LightRAG. + +Use :ref:`Prompt ` class to manage it. +""" + # TODO: potentially make a data class for this LIGHTRAG_DEFAULT_PROMPT_ARGS = [ "task_desc_str", # task description @@ -75,5 +80,5 @@ """ """This is the default system prompt template used in the LightRAG. -Use :ref:`Prompt` class to manage it. +Use :ref:`Prompt ` class to manage it. """ diff --git a/lightrag/lightrag/core/generator.py b/lightrag/lightrag/core/generator.py index a111b10f..2b23b74c 100644 --- a/lightrag/lightrag/core/generator.py +++ b/lightrag/lightrag/core/generator.py @@ -1,3 +1,6 @@ +"""Generator is a user-facing orchestration component with a simple and unified interface for LLM prediction. + +It is a pipeline that consists of three subcomponents.""" from typing import Any, Dict, List, Optional, Union from copy import deepcopy import logging diff --git a/lightrag/lightrag/core/parameter.py b/lightrag/lightrag/core/parameter.py index e113e254..43e07b49 100644 --- a/lightrag/lightrag/core/parameter.py +++ b/lightrag/lightrag/core/parameter.py @@ -1,3 +1,4 @@ +"""WIP""" from typing import Generic, TypeVar, Any T = TypeVar("T") # covariant set to False to allow for in-place updates diff --git a/lightrag/lightrag/core/tokenizer.py b/lightrag/lightrag/core/tokenizer.py index 1a86c6c4..c42af386 100644 --- a/lightrag/lightrag/core/tokenizer.py +++ b/lightrag/lightrag/core/tokenizer.py @@ -1,3 +1,6 @@ +""" +Tokenizer from tiktoken. +""" import tiktoken from typing import List diff --git a/lightrag/lightrag/core/tool_manager.py b/lightrag/lightrag/core/tool_manager.py index d835c658..62b61e53 100644 --- a/lightrag/lightrag/core/tool_manager.py +++ b/lightrag/lightrag/core/tool_manager.py @@ -1,3 +1,6 @@ +""" +The ToolManager manages a list of tools, context, and all ways to execute functions. +""" from typing import List, Dict, Optional, Any, Callable, Awaitable, Union import logging from copy import deepcopy diff --git a/lightrag/lightrag/optim/llm_optimizer.py b/lightrag/lightrag/optim/llm_optimizer.py index 5a615043..0b8141e0 100644 --- a/lightrag/lightrag/optim/llm_optimizer.py +++ b/lightrag/lightrag/optim/llm_optimizer.py @@ -1,5 +1,7 @@ r""" -Based and optimized from ORPO llm optimizer: https://arxiv.org/abs/2309.03409 +Based and optimized from ORPO llm optimizer. + +https://arxiv.org/abs/2309.03409 Source code: https://github.com/google-deepmind/opro """