Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rag match and reformat code #276

Merged
merged 4 commits into from
Jul 20, 2024
Merged

Add rag match and reformat code #276

merged 4 commits into from
Jul 20, 2024

Conversation

Aisuko
Copy link
Member

@Aisuko Aisuko commented Jul 19, 2024

Description

This PR fixes #

Notes for Reviewers

  • ruff format to reformat all code
  • add rag match mechanism
  • rewrite the request part, we only use one http client that can be more efficient. However, we doesn't close it if the service restart, it may lack memory in large scale.
  • Streaming response only output one character. I hit this when I debug, I think it because the value of parameter. So, I have added the code check the value of parameters.

We will teardown the https.client every time when the process restart.

2024-07-20 01:33:16.787 | INFO     | src.repository.events:dispose_httpx_client:121 - Httpx Client --- Disposing . . .
2024-07-20 01:33:16.804 | INFO     | src.repository.events:dispose_httpx_client:125 - Httpx Async Client --- Successfully Disposed!
2024-07-20 01:33:16.804 | INFO     | src.repository.events:dispose_httpx_client:129 - Httpx Sync Client --- Successfully Disposed!

The test cases

root@7c897f5613a8:/workspaces/kirin# make test
==================================================================================================== test session starts ====================================================================================================
platform linux -- Python 3.11.8, pytest-8.2.2, pluggy-1.5.0
rootdir: /workspaces/kirin/backend
configfile: pyproject.toml
plugins: anyio-4.4.0
collected 6 items                                                                                                                                                                                                           

backend/tests/unit_tests/test_api_authentication.py s                                                                                                                                                                 [ 16%]
backend/tests/unit_tests/test_api_version.py .                                                                                                                                                                        [ 33%]
backend/tests/unit_tests/test_httpx_kit.py ..                                                                                                                                                                         [ 66%]
backend/tests/unit_tests/test_jwt.py ss                                                                                                                                                                               [100%]

Signed commits

  • Yes, I signed my commits.

@Aisuko Aisuko requested a review from Micost July 19, 2024 12:40
@Aisuko Aisuko self-assigned this Jul 19, 2024
@Aisuko Aisuko marked this pull request as draft July 20, 2024 00:45
@Aisuko Aisuko marked this pull request as ready for review July 20, 2024 01:39
@Aisuko Aisuko merged commit 72e510d into main Jul 20, 2024
7 checks passed
@Aisuko Aisuko deleted the feat/pre-rag branch July 20, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant