Merge branch 'rebase/geekan/env_refactor' into fixbug/rfc135_merge_geekan_cli_etc_1445

This commit is contained in:
莘权 马 2023-12-09 16:29:48 +08:00
commit d3342c7d59
3 changed files with 6 additions and 1 deletions

View file

@ -94,7 +94,7 @@ class WriteCodeReview(Action):
def __init__(self, name="WriteCodeReview", context=None, llm=None):
super().__init__(name, context, llm)
@retry(stop=stop_after_attempt(2), wait=wait_random_exponential(min=1, max=60))
@retry(wait=wait_random_exponential(min=1, max=60), stop=stop_after_attempt(6))
async def write_code_review_and_rewrite(self, prompt):
code_rsp = await self._aask(prompt)
result = CodeParser.parse_block("Code Review Result", code_rsp)

View file

@ -5,6 +5,7 @@
@Author : alexanderwu
@File : faiss_store.py
"""
import asyncio
import pickle
from pathlib import Path
from typing import Optional
@ -58,6 +59,9 @@ class FaissStore(LocalStore):
else:
return str(sep.join([f"{x.page_content}" for x in rsp]))
async def asearch(self, *args, **kwargs):
return await asyncio.to_thread(self.search, *args, **kwargs)
def write(self):
"""Initialize the index and library based on the Document (JSON / XLSX, etc.) file provided by the user."""
if not self.raw_data_path.exists():

View file

@ -7,6 +7,7 @@
"""
import asyncio
import logging
import re
from unittest.mock import Mock