Skip to content

Commit 14f85cb

Browse files
committed
[MINOR] Rename from lightrag to adalflow
1 parent 7137548 commit 14f85cb

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

adalflow/adalflow/components/output_parsers/outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class OutputParser(Component):
7575
This interface helps users customize output parsers with consistent interfaces for the Generator.
7676
Even though you don't always need to subclass it.
7777
78-
LightRAG uses two core components:
78+
AdalFlow uses two core components:
7979
1. the Prompt to format output instruction
8080
2. A string parser component from core.string_parser for response parsing.
8181
"""

adalflow/adalflow/core/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .component import Component, FunComponent, fun_to_component
44
from .container import Sequential
55
from .db import LocalDB
6-
from .default_prompt_template import DEFAULT_LIGHTRAG_SYSTEM_PROMPT
6+
from .default_prompt_template import DEFAULT_ADALFLOW_SYSTEM_PROMPT
77
from .embedder import Embedder, BatchEmbedder
88
from .generator import Generator, BackwardEngine
99
from .model_client import ModelClient
@@ -58,7 +58,7 @@
5858
"Generator",
5959
"BackwardEngine",
6060
"Prompt",
61-
"DEFAULT_LIGHTRAG_SYSTEM_PROMPT",
61+
"DEFAULT_ADALFLOW_SYSTEM_PROMPT",
6262
# "Parameter",
6363
"required_field",
6464
"ModelClient",

adalflow/adalflow/core/default_prompt_template.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
"""This is the default system prompt template used in the LightRAG.
1+
"""This is the default system prompt template used in the AdalFlow.
22
33
Use :ref:`Prompt <core-prompt_builder>` class to manage it.
44
"""
55

66
__all__ = [
7-
"LIGHTRAG_DEFAULT_PROMPT_ARGS",
8-
"LIGHTRAG_DEFAULT_PROMPT_TRAINABLE_PARAMS",
9-
"SIMPLE_DEFAULT_LIGHTRAG_SYSTEM_PROMPT",
10-
"DEFAULT_LIGHTRAG_SYSTEM_PROMPT",
7+
"ADALFLOW_DEFAULT_PROMPT_ARGS",
8+
"ADALFLOW_DEFAULT_PROMPT_TRAINABLE_PARAMS",
9+
"SIMPLE_DEFAULT_ADALFLOW_SYSTEM_PROMPT",
10+
"DEFAULT_ADALFLOW_SYSTEM_PROMPT",
1111
]
1212
# TODO: potentially make a data class for this
13-
LIGHTRAG_DEFAULT_PROMPT_ARGS = [
13+
ADALFLOW_DEFAULT_PROMPT_ARGS = [
1414
"task_desc_str", # task description
1515
"output_format_str", # output format of the task
1616
"tools_str", # tools used in the task
@@ -21,17 +21,17 @@
2121
"input_str", # user query or input
2222
]
2323

24-
LIGHTRAG_DEFAULT_PROMPT_TRAINABLE_PARAMS = [
24+
ADALFLOW_DEFAULT_PROMPT_TRAINABLE_PARAMS = [
2525
"task_desc_str",
2626
# "output_format_str",
2727
"examples_str",
2828
]
2929

30-
SIMPLE_DEFAULT_LIGHTRAG_SYSTEM_PROMPT = r"""<SYS>{{task_desc_str}}</SYS>
30+
SIMPLE_DEFAULT_ADALFLOW_SYSTEM_PROMPT = r"""<SYS>{{task_desc_str}}</SYS>
3131
User: {{input_str}}
3232
You:"""
3333

34-
DEFAULT_LIGHTRAG_SYSTEM_PROMPT = r"""<START_OF_SYSTEM_PROMPT>
34+
DEFAULT_ADALFLOW_SYSTEM_PROMPT = r"""<START_OF_SYSTEM_PROMPT>
3535
{# task desc #}
3636
{% if task_desc_str %}
3737
{{task_desc_str}}
@@ -87,7 +87,7 @@
8787
<END_OF_ASSISTANT_STEPS>
8888
{% endif %}
8989
"""
90-
"""This is the default system prompt template used in the LightRAG.
90+
"""This is the default system prompt template used in the AdalFlow.
9191
9292
Use :ref:`Prompt <core-prompt_builder>` class to manage it.
9393
"""

adalflow/adalflow/core/generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from adalflow.core.prompt_builder import Prompt
2727
from adalflow.core.functional import compose_model_kwargs
2828
from adalflow.core.model_client import ModelClient
29-
from adalflow.core.default_prompt_template import DEFAULT_LIGHTRAG_SYSTEM_PROMPT
29+
from adalflow.core.default_prompt_template import DEFAULT_ADALFLOW_SYSTEM_PROMPT
3030
from adalflow.optim.function import BackwardContext
3131
from adalflow.utils.cache import CachedEngine
3232
from adalflow.tracing.callback_manager import CallbackManager
@@ -113,7 +113,7 @@ def __init__(
113113
Got {model_client} instead."
114114
)
115115

116-
template = template or DEFAULT_LIGHTRAG_SYSTEM_PROMPT
116+
template = template or DEFAULT_ADALFLOW_SYSTEM_PROMPT
117117

118118
# create the cache path and initialize the cache engine
119119

adalflow/adalflow/core/model_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ class ModelClient(Component):
2525
2626
(1) Initialize the client, including both sync and async.
2727
28-
(2) Convert the standard LightRAG components inputs to the API-specific format.
28+
(2) Convert the standard AdalFlow components inputs to the API-specific format.
2929
3030
(3) Call the API and parse the response.
3131
3232
(4) Handle API specific exceptions and errors to retry the call.
3333
3434
Check the subclasses in `components/model_client/` directory for the functional API clients we have.
3535
36-
This interface is designed to bridge the gap between LightRAG components inputs and model APIs.
36+
This interface is designed to bridge the gap between AdalFlow components inputs and model APIs.
3737
3838
You can see examples of the subclasses in components/model_client/ directory.
3939
"""
@@ -103,7 +103,7 @@ def track_completion_usage(self, *args, **kwargs) -> "CompletionUsage":
103103
)
104104

105105
def parse_embedding_response(self, response: Any) -> "EmbedderOutput":
106-
r"""Parse the embedding response to a structure LightRAG components can understand."""
106+
r"""Parse the embedding response to a structure AdalFlow components can understand."""
107107
raise NotImplementedError(
108108
f"{type(self).__name__} must implement parse_embedding_response method"
109109
)

adalflow/adalflow/core/prompt_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
from adalflow.core.component import Component
11-
from adalflow.core.default_prompt_template import DEFAULT_LIGHTRAG_SYSTEM_PROMPT
11+
from adalflow.core.default_prompt_template import DEFAULT_ADALFLOW_SYSTEM_PROMPT
1212
from adalflow.optim.parameter import Parameter
1313

1414

@@ -56,7 +56,7 @@ def __init__(
5656
):
5757
super().__init__()
5858

59-
self.template = template or DEFAULT_LIGHTRAG_SYSTEM_PROMPT
59+
self.template = template or DEFAULT_ADALFLOW_SYSTEM_PROMPT
6060
self.__create_jinja2_template()
6161
self.prompt_variables: List[str] = []
6262
for var in self._find_template_variables(self.template):

docs/source/tutorials/generator.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ An Orchestrator
5555
It orchestrates three components:
5656

5757
- `Prompt`: by taking in ``template`` (string) and ``prompt_kwargs`` (dict) to format the prompt at initialization.
58-
When the ``template`` is not provided, it defaults to :const:`DEFAULT_LIGHTRAG_SYSTEM_PROMPT<core.default_prompt_template.DEFAULT_LIGHTRAG_SYSTEM_PROMPT>`.
58+
When the ``template`` is not provided, it defaults to :const:`DEFAULT_ADALFLOW_SYSTEM_PROMPT<core.default_prompt_template.DEFAULT_ADALFLOW_SYSTEM_PROMPT>`.
5959

6060
- `ModelClient`: by taking in an already instantiated ``model_client`` and ``model_kwargs`` to call the model.
6161
Switching out the model client allows you to call any LLM model using the same prompt and output parsing.
@@ -485,7 +485,7 @@ It will require users to define ``Parameter`` and pass it to the ``prompt_kwargs
485485

486486
- :class:`core.generator.Generator`
487487
- :class:`core.types.GeneratorOutput`
488-
- :class:`core.default_prompt_template.DEFAULT_LIGHTRAG_SYSTEM_PROMPT`
488+
- :class:`core.default_prompt_template.DEFAULT_ADALFLOW_SYSTEM_PROMPT`
489489
- :class:`core.types.ModelClientType`
490490
- :class:`core.types.ModelType`
491491
- :class:`core.string_parser.JsonParser`

docs/source/tutorials/prompt.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a href="https://colab.research.google.com/drive/1_sGeHaKrwpI9RiL01g3cKyI2_5PJqZtr?usp=sharing" target="_blank" style="margin-right: 10px;">
77
<img alt="Try Quickstart in Colab" src="https://colab.research.google.com/assets/colab-badge.svg" style="vertical-align: middle;">
88
</a>
9-
<a href="https://github.com/SylphAI-Inc/LightRAG/blob/main/tutorials/prompt_note.py" target="_blank" style="display: flex; align-items: center;">
9+
<a href="https://github.com/SylphAI-Inc/AdalFlow/blob/main/tutorials/prompt_note.py" target="_blank" style="display: flex; align-items: center;">
1010
<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style="height: 20px; width: 20px; margin-right: 5px;">
1111
<span style="vertical-align: middle;"> Open Source Code</span>
1212
</a>
@@ -206,13 +206,13 @@ As with all components, you can use ``to_dict`` and ``from_dict`` to serialize a
206206
Default Prompt Template
207207
-------------------------
208208

209-
In default, the ``Prompt`` class uses the :const:`DEFAULT_LIGHTRAG_SYSTEM_PROMPT<core.default_prompt_template.DEFAULT_LIGHTRAG_SYSTEM_PROMPT>` as its string template if no template is provided.
209+
In default, the ``Prompt`` class uses the :const:`DEFAULT_ADALFLOW_SYSTEM_PROMPT<core.default_prompt_template.DEFAULT_ADALFLOW_SYSTEM_PROMPT>` as its string template if no template is provided.
210210
This default template allows you to conditionally passing seven important variables designed from the data flow diagram above.
211211
These varaibles are:
212212

213213
.. code-block:: python
214214
215-
LIGHTRAG_DEFAULT_PROMPT_ARGS = [
215+
ADALFLOW_DEFAULT_PROMPT_ARGS = [
216216
"task_desc_str", # task description
217217
"output_format_str", # output format of the task
218218
"tools_str", # tools used in the task
@@ -266,4 +266,4 @@ The output will be the bare minimum with only the user query and a prefix for as
266266
:class: highlight
267267

268268
- :class:`core.prompt_builder.Prompt`
269-
- :const:`core.default_prompt_template.DEFAULT_LIGHTRAG_SYSTEM_PROMPT`
269+
- :const:`core.default_prompt_template.DEFAULT_ADALFLOW_SYSTEM_PROMPT`

0 commit comments

Comments
 (0)