Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 9b2ef62
Author: Zhichang Yu <[email protected]>
Date:   Fri Dec 13 17:31:15 2024 +0800

    Fix xinfo_groups returns unexpected result (infiniflow#4026)

    ### What problem does this PR solve?

    Fix xinfo_groups returns unexpected result. Close infiniflow#3545

    ### Type of change

    - [x] Bug Fix (non-breaking change which fixes an issue)

commit 86507af
Author: Zhichang Yu <[email protected]>
Date:   Fri Dec 13 17:15:08 2024 +0800

    Set task progress on exception (infiniflow#4025)

    ### What problem does this PR solve?

    Set task progress on exception

    ### Type of change

    - [x] Bug Fix (non-breaking change which fixes an issue)

commit 9363567
Author: balibabu <[email protected]>
Date:   Fri Dec 13 16:55:13 2024 +0800

    Feat: Reparse a file shall reuse existing chunks if possible infiniflow#3793 (infiniflow#4021)

    ### What problem does this PR solve?

    Feat: Reparse a file shall reuse existing chunks if possible infiniflow#3793

    ### Type of change

    - [x] New Feature (non-breaking change which adds functionality)

commit 1defe0b
Author: balibabu <[email protected]>
Date:   Fri Dec 13 14:43:24 2024 +0800

    Feat: Supports to debug single component in Agent. infiniflow#3993 (infiniflow#4007)

    ### What problem does this PR solve?

    Feat: Supports to debug single component in Agent. infiniflow#3993
    Fix: The github button on the login page is displayed incorrectly  infiniflow#4002

    ### Type of change

    - [x] New Feature (non-breaking change which adds functionality)

commit 0bca46a
Author: Zhichang Yu <[email protected]>
Date:   Fri Dec 13 13:43:56 2024 +0800

    Migrate infinity at startup (infiniflow#3858)

    ### What problem does this PR solve?

    Migrate infinity at startup

    infiniflow#3809
    infiniflow/infinity#2321

    ### Type of change

    - [x] New Feature (non-breaking change which adds functionality)

commit 1ecb687
Author: liuhua <[email protected]>
Date:   Fri Dec 13 10:25:52 2024 +0800

    Fix bugs in agent api and update api document (infiniflow#3996)

    ### What problem does this PR solve?

    Fix bugs in agent api and update api document

    ### Type of change

    - [x] Bug Fix (non-breaking change which fixes an issue)
    - [x] New Feature (non-breaking change which adds functionality)

    ---------

    Co-authored-by: liuhua <[email protected]>

commit 68d46b2
Author: Luo Pan <[email protected]>
Date:   Fri Dec 13 08:50:58 2024 +0800

    Fix bug in hierarchical_merge function (infiniflow#4006)

    ### What problem does this PR solve?

    Fix hierarchical_merge function. From idx vs. actual value to actual
    value vs. actual value.
    Related issue infiniflow#4003

    ### Type of change

    - [x] Bug Fix (non-breaking change which fixes an issue)

    Co-authored-by: luopan <[email protected]>

commit 7559bbd
Author: Kevin Hu <[email protected]>
Date:   Fri Dec 13 08:50:32 2024 +0800

    Component debugging funcionality. (infiniflow#4012)

    ### What problem does this PR solve?

    infiniflow#3993
    ### Type of change

    - [x] New Feature (non-breaking change which adds functionality)

commit 275b5d1
Author: Jin Hai <[email protected]>
Date:   Thu Dec 12 20:34:46 2024 +0800

    Fix json file parse (infiniflow#4004)

    ### What problem does this PR solve?

    Fix json file parsing

    ### Type of change

    - [x] Bug Fix (non-breaking change which fixes an issue)

    ---------

    Signed-off-by: jinhai <[email protected]>

commit 9ae81b4
Author: writinwaters <[email protected]>
Date:   Thu Dec 12 19:46:53 2024 +0800

    Updated UI (infiniflow#4011)

    ### What problem does this PR solve?

    ### Type of change

    - [x] Documentation Update

commit d6c74ff
Author: so95 <[email protected]>
Date:   Thu Dec 12 18:26:44 2024 +0700

    Add mssql support (infiniflow#3985)

    some thing
    -  execsql  add connection mssql
    - fix bug duckduckgo-search rate limit
    - update typo vi res

    ---------

    Co-authored-by: Kevin Hu <[email protected]>

commit e8d7410
Author: Roccat <[email protected]>
Date:   Thu Dec 12 19:00:34 2024 +0800

    Fix: Completion AttributeError: 'list' object has no attribute 'get' (infiniflow#3999)

    ### What problem does this PR solve?

    ### Type of change

    - [x] Bug Fix (non-breaking change which fixes an issue)

    Co-authored-by: [email protected] <[email protected]>

commit c8b1a56
Author: Zhichang Yu <[email protected]>
Date:   Thu Dec 12 17:47:39 2024 +0800

    Replaced md5 with xxhash64 for chunk id (infiniflow#4009)

    ### What problem does this PR solve?

    Replaced md5 with xxhash64 for chunk id

    ### Type of change

    - [x] Refactoring

commit 301f958
Author: Zhichang Yu <[email protected]>
Date:   Thu Dec 12 16:38:03 2024 +0800

    Try to reuse existing chunks (infiniflow#3983)

    ### What problem does this PR solve?

    Try to reuse existing chunks. Close infiniflow#3793
    ### Type of change

    - [x] New Feature (non-breaking change which adds functionality)

commit 835fd7a
Author: writinwaters <[email protected]>
Date:   Thu Dec 12 11:45:59 2024 +0800

    Updated RAGFlow edition descriptions (infiniflow#4001)

    ### What problem does this PR solve?

    ### Type of change

    - [x] Documentation Update

commit bb8f97c
Author: writinwaters <[email protected]>
Date:   Thu Dec 12 09:57:52 2024 +0800

    UI updates + RAGFlow image description (infiniflow#3995)

    ### What problem does this PR solve?

    ### Type of change

    - [x] Documentation Update

commit 6d19294
Author: Kevin Hu <[email protected]>
Date:   Wed Dec 11 19:23:59 2024 +0800

    Support debug components. (infiniflow#3994)

    ### What problem does this PR solve?

    infiniflow#3993

    ### Type of change

    - [x] Bug Fix (non-breaking change which fixes an issue)

commit f61c276
Author: Jin Hai <[email protected]>
Date:   Wed Dec 11 18:39:09 2024 +0800

    Update comment (infiniflow#3981)

    ### What problem does this PR solve?

    _Briefly describe what this PR aims to solve. Include background context
    that will help reviewers understand the purpose of the PR._

    ### Type of change

    - [x] Documentation Update

    ---------

    Signed-off-by: Jin Hai <[email protected]>
    Co-authored-by: writinwaters <[email protected]>

commit 409acf0
Author: balibabu <[email protected]>
Date:   Wed Dec 11 16:29:17 2024 +0800

    Fix:  Fixed the issue where two consecutive indexes were displayed incorrectly infiniflow#3839 (infiniflow#3988)

    ### What problem does this PR solve?

    Fix: Fixed the issue where two consecutive indexes were displayed
    incorrectly infiniflow#3839

    ### Type of change

    - [x] Bug Fix (non-breaking change which fixes an issue)

commit 74c6b21
Author: liuhua <[email protected]>
Date:   Wed Dec 11 12:38:57 2024 +0800

    Update api documents (infiniflow#3979)

    ### What problem does this PR solve?

    Update api documents

    ### Type of change

    - [x] Documentation Update

    Co-authored-by: liuhua <[email protected]>

commit beeacd3
Author: Kevin Hu <[email protected]>
Date:   Wed Dec 11 11:44:59 2024 +0800

    Fix exec sql exception issue. (infiniflow#3982)

    ### What problem does this PR solve?
    infiniflow#3978

    ### Type of change

    - [x] Bug Fix (non-breaking change which fixes an issue)

commit 95259af
Author: so95 <[email protected]>
Date:   Wed Dec 11 10:12:57 2024 +0700

    update typo vietnamese (infiniflow#3973)

    update typo vietnamese

    ### Type of change
    - [x] Refactoring

    ---------

    Co-authored-by: Yingfeng <[email protected]>
    Co-authored-by: Jin Hai <[email protected]>
    Co-authored-by: bill <[email protected]>

commit 8554550
Author: Scott Davidson <[email protected]>
Date:   Wed Dec 11 03:10:33 2024 +0000

    Disable SQL DB binlog in Helm chart (infiniflow#3976)

    ### What problem does this PR solve?

    The initial Helm chart implementation added in infiniflow#3815 suffers from an
    issue where the 5GB data volume for the SQL DB is filled up with
    [binlog](https://dev.mysql.com/doc/refman/8.4/en/binary-log.html) files
    after just a few days. Since the app uses a non-replicated SQL DB config
    I think it makes sense to disable the binlog in the SQL DB container.
    This is achieved by simply adding the required argument to the container
    startup command.

    ### Type of change

    - [X] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
isthaison committed Dec 13, 2024
1 parent 80fb74c commit 0f0eb35
Show file tree
Hide file tree
Showing 78 changed files with 2,218 additions and 2,013 deletions.
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,16 @@ RUN --mount=type=cache,id=ragflow_apt,target=/var/cache/apt,sharing=locked \
apt purge -y nodejs npm && \
apt autoremove && \
apt update && \
apt install -y nodejs cargo
apt install -y nodejs cargo

# Add msssql17
RUN --mount=type=cache,id=ragflow_apt,target=/var/cache/apt,sharing=locked \
curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc && \
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list && \
apt update && \
ACCEPT_EULA=Y apt install -y unixodbc-dev msodbcsql17



# Add dependencies of selenium
RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/chrome-linux64-121-0-6167-85,target=/chrome-linux64.zip \
Expand Down Expand Up @@ -170,5 +179,4 @@ RUN chmod +x ./entrypoint.sh
COPY --from=builder /ragflow/web/dist /ragflow/web/dist

COPY --from=builder /ragflow/VERSION /ragflow/VERSION

ENTRYPOINT ["./entrypoint.sh"]
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,23 +167,21 @@ releases! 🌟
3. Start up the server using the pre-built Docker images:
> The command below downloads the v0.14.1 version Docker image for RAGFlow slim (`v0.14.1-slim`). Note that RAGFlow slim
Docker images do not include embedding models or Python libraries and hence are approximately 2 GB in size.
> The command below downloads the `v0.14.1-slim` edition of the RAGFlow Docker image. Refer to the following table for descriptions of different RAGFlow editions. To download an RAGFlow edition different from `v0.14.1-slim`, update the `RAGFLOW_IMAGE` variable accordingly in **docker/.env** before using `docker compose` to start the server. For example: set `RAGFLOW_IMAGE=infiniflow/ragflow:v0.14.1` for the full edition `v0.14.1`.
```bash
$ cd ragflow
$ docker compose -f docker/docker-compose.yml up -d
```
| RAGFLOW_IMAGE tag in docker/.env | size | Including embedding models and related Python packages? | comments |
| -------------------------------- | ----- | ------------------------------------------------------- | ---------------------- |
| v0.14.1 | ~9 GB | YES | stable release |
| v0.14.1-slim | ~2 GB | NO | stable release |
| v0.15.0-dev1 | ~9 GB | YES | unstable beta release |
| v0.15.0-dev1-slim | ~2 GB | NO | unstable beta release |
| nightly | ~9 GB | YES | unstable nightly build |
| nightly-slim | ~2 GB | NO | unstable nightly build |
| RAGFlow image tag | Image size (GB) | Has embedding models? | Stable? |
| ----------------- | --------------- | --------------------- | ------------------------ |
| v0.14.1 | &approx;9 | :heavy_check_mark: | Stable release |
| v0.14.1-slim | &approx;2 || Stable release |
| v0.15.0-dev1 | &approx;9 | :heavy_check_mark: | *Unstable* beta release |
| v0.15.0-dev1-slim | &approx;2 || *Unstable* beta release |
| nightly | &approx;9 | :heavy_check_mark: | *Unstable* nightly build |
| nightly-slim | &approx;2 || *Unstable* nightly build |
4. Check the server status after having the server up and running:
Expand Down
21 changes: 9 additions & 12 deletions README_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,24 +160,21 @@ Coba demo kami di [https://demo.ragflow.io](https://demo.ragflow.io).
3. Bangun image Docker pre-built dan jalankan server:

> Perintah di bawah ini akan mengunduh versi v0.14.1 dari Docker image RAGFlow slim (`v0.14.1-slim`). Image RAGFlow slim
tidak termasuk model embedding atau library Python dan berukuran sekitar 1GB.
> Perintah di bawah ini mengunduh edisi v0.14.1-slim dari gambar Docker RAGFlow. Silakan merujuk ke tabel berikut untuk deskripsi berbagai edisi RAGFlow. Untuk mengunduh edisi RAGFlow yang berbeda dari v0.14.1-slim, perbarui variabel RAGFLOW_IMAGE di docker/.env sebelum menggunakan docker compose untuk memulai server. Misalnya, atur RAGFLOW_IMAGE=infiniflow/ragflow:v0.14.1 untuk edisi lengkap v0.14.1.
```bash
$ cd ragflow
$ docker compose -f docker/docker-compose.yml up -d
```

| RAGFLOW_IMAGE tag in docker/.env | size | Including embedding models and related Python packages? | comments |
| -------------------------------- | ----- | ------------------------------------------------------- | ---------------------- |
| v0.14.1 | ~9 GB | YES | stable release |
| v0.14.1-slim | ~2 GB | NO | stable release |
| v0.15.0-dev1 | ~9 GB | YES | unstable beta release |
| v0.15.0-dev1-slim | ~2 GB | NO | unstable beta release |
| nightly | ~9 GB | YES | unstable nightly build |
| nightly-slim | ~2 GB | NO | unstable nightly build |


| RAGFlow image tag | Image size (GB) | Has embedding models? | Stable? |
| ----------------- | --------------- | --------------------- | ------------------------ |
| v0.14.1 | &approx;9 | :heavy_check_mark: | Stable release |
| v0.14.1-slim | &approx;2 || Stable release |
| v0.15.0-dev1 | &approx;9 | :heavy_check_mark: | *Unstable* beta release |
| v0.15.0-dev1-slim | &approx;2 || *Unstable* beta release |
| nightly | &approx;9 | :heavy_check_mark: | *Unstable* nightly build |
| nightly-slim | &approx;2 || *Unstable* nightly build |

4. Periksa status server setelah server aktif dan berjalan:

Expand Down
19 changes: 9 additions & 10 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,21 @@
3. ビルド済みの Docker イメージをビルドし、サーバーを起動する:

> 以下のコマンドは、RAGFlow slim(`v0.14.1-slim`)の開発版Dockerイメージをダウンロードします。RAGFlow slimのDockerイメージには、埋め込みモデルやPythonライブラリが含まれていないため、サイズは約1GBです
> 以下のコマンドは、RAGFlow Dockerイメージの v0.14.1-slim エディションをダウンロードします。異なる RAGFlow エディションの説明については、以下の表を参照してください。v0.14.1-slim とは異なるエディションをダウンロードするには、docker/.env ファイルの RAGFLOW_IMAGE 変数を適宜更新し、docker compose を使用してサーバーを起動してください。例えば、完全版 v0.14.1 をダウンロードするには、RAGFLOW_IMAGE=infiniflow/ragflow:v0.14.1 と設定します
```bash
$ cd ragflow
$ docker compose -f docker/docker-compose.yml up -d
```

| RAGFLOW_IMAGE tag in docker/.env | size | Including embedding models and related Python packages? | comments |
| -------------------------------- | ----- | ------------------------------------------------------- | ---------------------- |
| v0.14.1 | ~9 GB | YES | stable release |
| v0.14.1-slim | ~2 GB | NO | stable release |
| v0.15.0-dev1 | ~9 GB | YES | unstable beta release |
| v0.15.0-dev1-slim | ~2 GB | NO | unstable beta release |
| nightly | ~9 GB | YES | unstable nightly build |
| nightly-slim | ~2 GB | NO | unstable nightly build |

| RAGFlow image tag | Image size (GB) | Has embedding models? | Stable? |
| ----------------- | --------------- | --------------------- | ------------------------ |
| v0.14.1 | &approx;9 | :heavy_check_mark: | Stable release |
| v0.14.1-slim | &approx;2 || Stable release |
| v0.15.0-dev1 | &approx;9 | :heavy_check_mark: | *Unstable* beta release |
| v0.15.0-dev1-slim | &approx;2 || *Unstable* beta release |
| nightly | &approx;9 | :heavy_check_mark: | *Unstable* nightly build |
| nightly-slim | &approx;2 || *Unstable* nightly build |

4. サーバーを立ち上げた後、サーバーの状態を確認する:

Expand Down
22 changes: 9 additions & 13 deletions README_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,21 @@
3. 미리 빌드된 Docker 이미지를 생성하고 서버를 시작하세요:

> 아래의 명령은 RAGFlow slim(v0.14.1-slim)의 개발 버전 Docker 이미지를 다운로드합니다. RAGFlow slim Docker 이미지에는 임베딩 모델이나 Python 라이브러리가 포함되어 있지 않으므로 크기는 약 1GB입니다.
> 아래 명령어는 RAGFlow Docker 이미지의 v0.14.1-slim 버전을 다운로드합니다. 다양한 RAGFlow 버전에 대한 설명은 다음 표를 참조하십시오. v0.14.1-slim과 다른 RAGFlow 버전을 다운로드하려면, docker/.env 파일에서 RAGFLOW_IMAGE 변수를 적절히 업데이트한 후 docker compose를 사용하여 서버를 시작하십시오. 예를 들어, 전체 버전인 v0.14.1을 다운로드하려면 RAGFLOW_IMAGE=infiniflow/ragflow:v0.14.1로 설정합니다.
```bash
$ cd ragflow
$ docker compose -f docker/docker-compose.yml up -d
```


| RAGFLOW_IMAGE tag in docker/.env | size | Including embedding models and related Python packages? | comments |
| -------------------------------- | ----- | ------------------------------------------------------- | ---------------------- |
| v0.14.1 | ~9 GB | YES | stable release |
| v0.14.1-slim | ~2 GB | NO | stable release |
| v0.15.0-dev1 | ~9 GB | YES | unstable beta release |
| v0.15.0-dev1-slim | ~2 GB | NO | unstable beta release |
| nightly | ~9 GB | YES | unstable nightly build |
| nightly-slim | ~2 GB | NO | unstable nightly build |



| RAGFlow image tag | Image size (GB) | Has embedding models? | Stable? |
| ----------------- | --------------- | --------------------- | ------------------------ |
| v0.14.1 | &approx;9 | :heavy_check_mark: | Stable release |
| v0.14.1-slim | &approx;2 || Stable release |
| v0.15.0-dev1 | &approx;9 | :heavy_check_mark: | *Unstable* beta release |
| v0.15.0-dev1-slim | &approx;2 || *Unstable* beta release |
| nightly | &approx;9 | :heavy_check_mark: | *Unstable* nightly build |
| nightly-slim | &approx;2 || *Unstable* nightly build |

4. 서버가 시작된 후 서버 상태를 확인하세요:

Expand Down
19 changes: 9 additions & 10 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,21 @@
3. 进入 **docker** 文件夹,利用提前编译好的 Docker 镜像启动服务器:

> 运行以下命令会自动下载 v0.14.1 版的 RAGFlow slim Docker 镜像`v0.14.1-slim`),该镜像并不包含 embedding 模型以及一些 Python 库,因此镜像大小约 1GB
> 运行以下命令会自动下载 RAGFlow slim Docker 镜像 `v0.14.1-slim`。请参考下表查看不同 Docker 发行版的描述。如需下载不同于 `v0.14.0-slim`Docker 镜像,请在运行 `docker compose` 启动服务之前先更新 **docker/.env** 文件内的 `RAGFLOW_IMAGE` 变量。比如,你可以通过设置 `RAGFLOW_IMAGE=infiniflow/ragflow:v0.14.1` 来下载 RAGFlow 镜像的 `v0.14.1` 完整发行版
```bash
$ cd ragflow
$ docker compose -f docker/docker-compose.yml up -d
```

| RAGFLOW_IMAGE tag in docker/.env | 尺寸 | 内置 embedding 模型和相关 Python 库? | 描述 |
| -------------------------------- | ----- | ------------------------------------------------------- | ---------------------- |
| v0.14.1 | ~9 GB | YES | stable release |
| v0.14.1-slim | ~2 GB | NO | stable release |
| v0.15.0-dev1 | ~9 GB | YES | unstable beta release |
| v0.15.0-dev1-slim | ~2 GB | NO | unstable beta release |
| nightly | ~9 GB | YES | unstable nightly build |
| nightly-slim | ~2 GB | NO | unstable nightly build |

| RAGFlow image tag | Image size (GB) | Has embedding models? | Stable? |
| ----------------- | --------------- | --------------------- | ------------------------ |
| v0.14.1 | &approx;9 | :heavy_check_mark: | Stable release |
| v0.14.1-slim | &approx;2 || Stable release |
| v0.15.0-dev1 | &approx;9 | :heavy_check_mark: | *Unstable* beta release |
| v0.15.0-dev1-slim | &approx;2 || *Unstable* beta release |
| nightly | &approx;9 | :heavy_check_mark: | *Unstable* nightly build |
| nightly-slim | &approx;2 || *Unstable* nightly build |

4. 服务器启动成功后再次确认服务器状态:

Expand Down
27 changes: 13 additions & 14 deletions agent/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def run(self, **kwargs):
self.path.append(["begin"])

self.path.append([])

ran = -1
waiting = []
without_dependent_checking = []
Expand All @@ -206,7 +207,13 @@ def prepare2run(cpns):
waiting.append(c)
continue
yield "*'{}'* is running...🕞".format(self.get_compnent_name(c))
ans = cpn.run(self.history, **kwargs)
try:
ans = cpn.run(self.history, **kwargs)
except Exception as e:
logging.exception(f"Canvas.run got exception: {e}")
self.path[-1].append(c)
ran += 1
raise e
self.path[-1].append(c)
ran += 1

Expand All @@ -228,20 +235,12 @@ def prepare2run(cpns):
switch_out = cpn["obj"].output()[1].iloc[0, 0]
assert switch_out in self.components, \
"{}'s output: {} not valid.".format(cpn_id, switch_out)
try:
for m in prepare2run([switch_out]):
yield {"content": m, "running_status": True}
except Exception as e:
logging.exception("Canvas.run got exception")
raise e
for m in prepare2run([switch_out]):
yield {"content": m, "running_status": True}
continue

try:
for m in prepare2run(cpn["downstream"]):
yield {"content": m, "running_status": True}
except Exception as e:
logging.exception("Canvas.run got exception")
raise e
for m in prepare2run(cpn["downstream"]):
yield {"content": m, "running_status": True}

if ran >= len(self.path[-1]) and waiting:
without_dependent_checking = waiting
Expand Down Expand Up @@ -333,4 +332,4 @@ def get_preset_param(self):
return self.components["begin"]["obj"]._param.query

def get_component_input_elements(self, cpnnm):
return self.components["begin"]["obj"].get_input_elements()
return self.components[cpnnm]["obj"].get_input_elements()
19 changes: 14 additions & 5 deletions agent/component/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self):
self.message_history_window_size = 22
self.query = []
self.inputs = []
self.debug_inputs = []

def set_name(self, name: str):
self._name = name
Expand Down Expand Up @@ -410,6 +411,7 @@ def get_dependent_components(self):
def run(self, history, **kwargs):
logging.debug("{}, history: {}, kwargs: {}".format(self, json.dumps(history, ensure_ascii=False),
json.dumps(kwargs, ensure_ascii=False)))
self._param.debug_inputs = []
try:
res = self._run(history, **kwargs)
self.set_output(res)
Expand Down Expand Up @@ -446,10 +448,13 @@ def reset(self):
setattr(self._param, self._param.output_var_name, None)
self._param.inputs = []

def set_output(self, v: partial | pd.DataFrame):
def set_output(self, v):
setattr(self._param, self._param.output_var_name, v)

def get_input(self):
if self._param.debug_inputs:
return pd.DataFrame([{"content": v["value"]} for v in self._param.debug_inputs])

reversed_cpnts = []
if len(self._canvas.path) > 1:
reversed_cpnts.extend(self._canvas.path[-2])
Expand Down Expand Up @@ -531,14 +536,15 @@ def get_input_elements(self):
eles = []
for q in self._param.query:
if q.get("component_id"):
if q["component_id"].split("@")[0].lower().find("begin") >= 0:
cpn_id, key = q["component_id"].split("@")
cpn_id = q["component_id"]
if cpn_id.split("@")[0].lower().find("begin") >= 0:
cpn_id, key = cpn_id.split("@")
eles.extend(self._canvas.get_component(cpn_id)["obj"]._param.query)
continue

eles.append({"key": q["key"], "component_id": q["component_id"]})
eles.append({"name": self._canvas.get_compnent_name(cpn_id), "key": cpn_id})
else:
eles.append({"key": q["key"]})
eles.append({"key": q["value"], "name": q["value"], "value": q["value"]})
return eles

def get_stream_input(self):
Expand All @@ -558,3 +564,6 @@ def be_output(v):

def get_component_name(self, cpn_id):
return self._canvas.get_component(cpn_id)["obj"].component_name.lower()

def debug(self, **kwargs):
return self._run([], **kwargs)
2 changes: 1 addition & 1 deletion agent/component/begin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _run(self, history, **kwargs):
def stream_output(self):
res = {"content": self._param.prologue}
yield res
self.set_output(res)
self.set_output(self.be_output(res))



Loading

0 comments on commit 0f0eb35

Please sign in to comment.