Skip to content

Commit

Permalink
Merge pull request #177 from SylphAI-Inc/main
Browse files Browse the repository at this point in the history
update the package and links in tutorials to adalflow from lightrag
  • Loading branch information
liyin2015 authored Aug 16, 2024
2 parents 6c60768 + e282b18 commit b466daf
Show file tree
Hide file tree
Showing 26 changed files with 234 additions and 211 deletions.
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lightrag.sylph.ai
adalflow.sylph.ai
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@

<h4 align="center">
<p>
<a href="https://lightrag.sylph.ai/">Documentation</a> |
<a href="https://lightrag.sylph.ai/apis/components/components.model_client.html">Models</a> |
<a href="https://lightrag.sylph.ai/apis/components/components.retriever.html">Retrievers</a> |
<a href="https://lightrag.sylph.ai/apis/components/components.agent.html">Agents</a>
<a href="https://adalflow.sylph.ai/">All Documentation</a> |
<a href="https://adalflow.sylph.ai/apis/components/components.model_client.html">Models</a> |
<a href="https://adalflow.sylph.ai/apis/components/components.retriever.html">Retrievers</a> |
<a href="https://adalflow.sylph.ai/apis/components/components.agent.html">Agents</a> |
<a href="https://adalflow.sylph.ai/use_cases/question_answering.html">Trainer & Optimizers</a>
<p>
</h4>

Expand Down Expand Up @@ -53,11 +54,12 @@



<h1>
<h2>
<p align="center">
AdalFlow: The Library to Build and to Auto-optimize LLM Applications
The Library to Build and to Auto-optimize LLM Applications
</p>
</h1>
</h2>


AdalFlow helps developers build and optimize LLM task pipelines.
Embracing similar design pattern to PyTorch, AdalFlow is light, modular, and robust, with a 100% readable codebase.
Expand All @@ -73,7 +75,7 @@ Because of this, no library can provide out-of-the-box solutions. Users must bui


Further reading: [How We Started](https://www.linkedin.com/posts/li-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop),
[Introduction](https://lightrag.sylph.ai/), [Design Philosophy](https://lightrag.sylph.ai/tutorials/lightrag_design_philosophy.html) and [Class hierarchy](https://lightrag.sylph.ai/tutorials/class_hierarchy.html).
[Introduction](https://adalflow.sylph.ai/), [Design Philosophy](https://adalflow.sylph.ai/tutorials/lightrag_design_philosophy.html) and [Class hierarchy](https://adalflow.sylph.ai/tutorials/class_hierarchy.html).


<!--
Expand Down Expand Up @@ -261,7 +263,7 @@ You can switch to any model simply by using a different `model_client` (provider
Let's use OpenAI's `gpt-3.5-turbo` model.

```python
from lightrag.components.model_client import OpenAIClient
from adalflow.components.model_client import OpenAIClient

self.generator = Generator(
model_client=OpenAIClient(),
Expand All @@ -281,23 +283,23 @@ Install AdalFlow with pip:
pip install adalflow
```

Please refer to the [full installation guide](https://lightrag.sylph.ai/get_started/installation.html) for more details.
Please refer to the [full installation guide](https://adalflow.sylph.ai/get_started/installation.html) for more details.




# Documentation

AdalFlow full documentation available at [lightrag.sylph.ai](https://lightrag.sylph.ai/):
AdalFlow full documentation available at [adalflow.sylph.ai](https://adalflow.sylph.ai/):
- [How We Started](https://www.linkedin.com/posts/li-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop)
- [Introduction](https://lightrag.sylph.ai/)
- [Full installation guide](https://lightrag.sylph.ai/get_started/installation.html)
- [Design philosophy](https://lightrag.sylph.ai/tutorials/lightrag_design_philosophy.html)
- [Class hierarchy](https://lightrag.sylph.ai/tutorials/class_hierarchy.html)
- [Tutorials](https://lightrag.sylph.ai/tutorials/index.html)
- [Supported Models](https://lightrag.sylph.ai/apis/components/components.model_client.html)
- [Supported Retrievers](https://lightrag.sylph.ai/apis/components/components.retriever.html)
- [API reference](https://lightrag.sylph.ai/apis/index.html)
- [Introduction](https://adalflow.sylph.ai/)
- [Full installation guide](https://adalflow.sylph.ai/get_started/installation.html)
- [Design philosophy](https://adalflow.sylph.ai/tutorials/lightrag_design_philosophy.html)
- [Class hierarchy](https://adalflow.sylph.ai/tutorials/class_hierarchy.html)
- [Tutorials](https://adalflow.sylph.ai/tutorials/index.html)
- [Supported Models](https://adalflow.sylph.ai/apis/components/components.model_client.html)
- [Supported Retrievers](https://adalflow.sylph.ai/apis/components/components.retriever.html)
- [API reference](https://adalflow.sylph.ai/apis/index.html)


# AdalFlow: A Tribute to Ada Lovelace
Expand Down
4 changes: 4 additions & 0 deletions adalflow/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.2.0.beta.3] - 2024-08-16
### Fixed
- missing `diskcache` package in the dependencies.

## [0.2.0.beta.2] - 2024-08-15
### Improved
- ``Demo Optimizer`` with "learn-to-reason" one shot to achieve 94% on the object count, close to the 98% by the teacher gpt-4o model.
Expand Down
50 changes: 25 additions & 25 deletions adalflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@

<h4 align="center">
<p>
<a href="https://lightrag.sylph.ai/">Documentation</a> |
<a href="https://lightrag.sylph.ai/apis/components/components.model_client.html">Models</a> |
<a href="https://lightrag.sylph.ai/apis/components/components.retriever.html">Retrievers</a> |
<a href="https://lightrag.sylph.ai/apis/components/components.agent.html">Agents</a>
<a href="https://adalflow.sylph.ai/">All Documentation</a> |
<a href="https://adalflow.sylph.ai/apis/components/components.model_client.html">Models</a> |
<a href="https://adalflow.sylph.ai/apis/components/components.retriever.html">Retrievers</a> |
<a href="https://adalflow.sylph.ai/apis/components/components.agent.html">Agents</a> |
<a href="https://adalflow.sylph.ai/use_cases/question_answering.html">Trainer & Optimizers</a>
<p>
</h4>

<p align="center">
<a href="https://pypi.org/project/lightRAG">
<img alt="PyPI Version" src="https://img.shields.io/pypi/v/lightRAG?style=flat-square">
<a href="https://pypi.org/project/adalflow/">
<img alt="PyPI Version" src="https://img.shields.io/pypi/v/adalflow?style=flat-square">
</a>
<a href="https://star-history.com/#SylphAI-Inc/LightRAG">
<img alt="GitHub stars" src="https://img.shields.io/github/stars/SylphAI-Inc/LightRAG?style=flat-square">
Expand Down Expand Up @@ -53,20 +54,17 @@



<h1>
<h2>
<p align="center">
AdalFlow: The Library for LLM Applications
⚡ The Library to Build and to Auto-optimize LLM Applications
</p>
</h1>
</h2>


AdalFlow helps developers build and optimize LLM task pipelines.
Embracing similar design pattern to PyTorch, AdalFlow is light, modular, and robust, with a 100% readable codebase.


# AdalFlow: A Tribute to Ada Lovelace

AdalFlow is named in honor of [Ada Lovelace](https://en.wikipedia.org/wiki/Ada_Lovelace), the pioneering female mathematician who first recognized that machines could do more than just calculations. As a female-led team, we aim to inspire more women to enter the AI field.

# Why AdalFlow?

LLMs are like water; they can be shaped into anything, from GenAI applications such as chatbots, translation, summarization, code generation, and autonomous agents to classical NLP tasks like text classification and named entity recognition. They interact with the world beyond the model’s internal knowledge via retrievers, memory, and tools (function calls). Each use case is unique in its data, business logic, and user experience.
Expand All @@ -77,7 +75,7 @@ Because of this, no library can provide out-of-the-box solutions. Users must bui


Further reading: [How We Started](https://www.linkedin.com/posts/li-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop),
[Introduction](https://lightrag.sylph.ai/), [Design Philosophy](https://lightrag.sylph.ai/tutorials/lightrag_design_philosophy.html) and [Class hierarchy](https://lightrag.sylph.ai/tutorials/class_hierarchy.html).
[Introduction](https://adalflow.sylph.ai/), [Design Philosophy](https://adalflow.sylph.ai/tutorials/lightrag_design_philosophy.html) and [Class hierarchy](https://adalflow.sylph.ai/tutorials/class_hierarchy.html).


<!--
Expand Down Expand Up @@ -265,7 +263,7 @@ You can switch to any model simply by using a different `model_client` (provider
Let's use OpenAI's `gpt-3.5-turbo` model.

```python
from lightrag.components.model_client import OpenAIClient
from adalflow.components.model_client import OpenAIClient

self.generator = Generator(
model_client=OpenAIClient(),
Expand All @@ -285,26 +283,28 @@ Install AdalFlow with pip:
pip install adalflow
```

Please refer to the [full installation guide](https://lightrag.sylph.ai/get_started/installation.html) for more details.
Please refer to the [full installation guide](https://adalflow.sylph.ai/get_started/installation.html) for more details.




# Documentation

AdalFlow full documentation available at [lightrag.sylph.ai](https://lightrag.sylph.ai/):
AdalFlow full documentation available at [adalflow.sylph.ai](https://adalflow.sylph.ai/):
- [How We Started](https://www.linkedin.com/posts/li-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop)
- [Introduction](https://lightrag.sylph.ai/)
- [Full installation guide](https://lightrag.sylph.ai/get_started/installation.html)
- [Design philosophy](https://lightrag.sylph.ai/tutorials/lightrag_design_philosophy.html)
- [Class hierarchy](https://lightrag.sylph.ai/tutorials/class_hierarchy.html)
- [Tutorials](https://lightrag.sylph.ai/tutorials/index.html)
- [Supported Models](https://lightrag.sylph.ai/apis/components/components.model_client.html)
- [Supported Retrievers](https://lightrag.sylph.ai/apis/components/components.retriever.html)
- [API reference](https://lightrag.sylph.ai/apis/index.html)
- [Introduction](https://adalflow.sylph.ai/)
- [Full installation guide](https://adalflow.sylph.ai/get_started/installation.html)
- [Design philosophy](https://adalflow.sylph.ai/tutorials/lightrag_design_philosophy.html)
- [Class hierarchy](https://adalflow.sylph.ai/tutorials/class_hierarchy.html)
- [Tutorials](https://adalflow.sylph.ai/tutorials/index.html)
- [Supported Models](https://adalflow.sylph.ai/apis/components/components.model_client.html)
- [Supported Retrievers](https://adalflow.sylph.ai/apis/components/components.retriever.html)
- [API reference](https://adalflow.sylph.ai/apis/index.html)


# AdalFlow: A Tribute to Ada Lovelace

AdalFlow is named in honor of [Ada Lovelace](https://en.wikipedia.org/wiki/Ada_Lovelace), the pioneering female mathematician who first recognized that machines could do more than just calculations. As a female-led team, we aim to inspire more women to enter the AI field.

# Contributors

Expand Down
5 changes: 3 additions & 2 deletions adalflow/adalflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
__version__ = "0.2.0-beta.2"
__version__ = "0.2.0-beta.3"

from adalflow.core.component import Component, fun_to_component
from adalflow.core.container import Sequential

# from adalflow.core.container import Sequential
from adalflow.optim.grad_component import GradComponent
from adalflow.core.generator import Generator
from adalflow.core.types import GeneratorOutput, EmbedderOutput, RetrieverOutput
Expand Down Expand Up @@ -41,6 +41,7 @@
__all__ = [
"Component",
"fun_to_component",
"Sequential",
"GradComponent",
"ModelClient",
"Generator",
Expand Down
7 changes: 6 additions & 1 deletion adalflow/adalflow/core/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,12 @@ async def acall(
output = GeneratorOutput(raw_response=str(completion), error=str(e))

log.info(f"output: {output}")
self._run_callbacks(output, input=api_kwargs)
self._run_callbacks(
output,
input=api_kwargs,
prompt_kwargs=prompt_kwargs,
model_kwargs=model_kwargs,
)
return output

def __call__(self, *args, **kwargs) -> Union[GeneratorOutputType, Any]:
Expand Down
7 changes: 1 addition & 6 deletions adalflow/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions adalflow/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tool.poetry]
name = "adalflow"

version = "0.2.0.beta.2"
description = "The Library for LLM Applications."
version = "0.2.0.beta.3"
description = "The Library to Build and Auto-optimize Any LLM Task Pipeline"
authors = ["Li Yin <[email protected]>"]
readme = "README.md"
repository = "https://github.com/SylphAI-Inc/LightRAG"
Expand Down Expand Up @@ -57,6 +57,7 @@ anthropic = { version = "^0.31.1", optional = true }
google-generativeai = { version = "^0.7.2", optional = true }
cohere = { version = "^5.5.8", optional = true }
ollama = { version = "^0.2.1", optional = true }
diskcache = "^5.6.3"


[tool.poetry.group.test.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/get_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ You can use the following import:

.. code-block:: python
from lightrag.utils import setup_env
from adalflow.utils import setup_env
setup_env()
Expand Down
16 changes: 9 additions & 7 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
.. raw:: html

<h3 style="text-align: center; font-size: 1.5em; margin-top: 10px;">⚡ The Library to Build and to Auto-optimize Large Language Model Applications ⚡</h3>
<h3 style="text-align: center; font-size: 1.5em; margin-top: 10px;">
⚡ The Library to Build and to Auto-optimize Any LLM Task Pipeline ⚡
</h3>

.. <div style="text-align: center;">
.. <p>
Expand Down Expand Up @@ -98,11 +100,11 @@ We provide developers with fundamental building blocks of *100% clarity and simp

.. code-block:: python
from lightrag.core import Component, Generator
from lightrag.components.model_client import GroqAPIClient
import adalflow as adal
from adalflow.components.model_client import GroqAPIClient
class SimpleQA(Component):
class SimpleQA(adal.Component):
def __init__(self):
super().__init__()
template = r"""<SYS>
Expand All @@ -111,7 +113,7 @@ We provide developers with fundamental building blocks of *100% clarity and simp
User: {{input_str}}
You:
"""
self.generator = Generator(
self.generator = adal.Generator(
model_client=GroqAPIClient(),
model_kwargs={"model": "llama3-8b-8192"},
template=template,
Expand Down Expand Up @@ -163,9 +165,9 @@ To switch to `gpt-3.5-turbo` by OpenAI, simply update the `model_client`` and `m

.. code-block:: python
from lightrag.components.model_client import OpenAIClient
from adalflow.components.model_client import OpenAIClient
self.generator = Generator(
self.generator = adal.Generator(
model_client=OpenAIClient(),
model_kwargs={"model": "gpt-3.5-turbo"},
template=template,
Expand Down
Loading

0 comments on commit b466daf

Please sign in to comment.