Migrate infinity at startup (#3858)

### What problem does this PR solve?

Migrate infinity at startup

#3809
https://github.com/infiniflow/infinity/issues/2321

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Zhichang Yu
2024-12-13 13:43:56 +08:00
committed by GitHub
parent 1ecb687c51
commit 0bca46ac3a
6 changed files with 215 additions and 183 deletions

View File

@ -1,7 +1,6 @@
from .base import Base
from .session import Session,Message
import requests
from typing import List
import json
@ -62,7 +61,7 @@ class Agent(Base):
@staticmethod
def list_sessions(agent_id,rag,page: int = 1, page_size: int = 30, orderby: str = "create_time", desc: bool = True,
id: str = None) -> List[Session]:
id: str = None) -> list[Session]:
url = f"{rag.api_url}/agents/{agent_id}/sessions"
headers = {"Authorization": f"Bearer {rag.user_key}"}
params = {"page": page, "page_size": page_size, "orderby": orderby, "desc": desc, "id": id}