-
Notifications
You must be signed in to change notification settings - Fork 123
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
feat(knext): add kag_agent #319
base: master
Are you sure you want to change the base?
Conversation
await asyncio.create_task(self.is_question_deps_ready(question)) | ||
rewrited_question = self.rewrite_question.forward(question) | ||
info_dict = { | ||
'status': f'重写问题', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add index tags
to support Chinese and English selections.
rewrited_question = self.rewrite_question.forward(question) | ||
info_dict = { | ||
'status': f'重写问题', | ||
'log_info': f'原问题: {question.question}. 重写后的问题: {rewrited_question}\n{str(question)}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments as above
async def solve_problem_impl(self, question: Question, **kwargs): | ||
info_dict = { | ||
'status': 'start solve_problem_impl', | ||
'log_info': f'current question depth: {question.get_current_depth()}\n{str(question)}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add index tags
to support Chinese and English selections.
parts = _output_string.split("llm_output:") # 分割一次 | ||
result = parts[-1] if len(parts) > 1 else _output_string | ||
# parse \n | ||
parts_2 = result.split('依赖关系是:') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add index tags
to support Chinese and English selections.
def _process_dep(_input_list): | ||
dep_dict = {} | ||
for dep in _input_list: | ||
res = dep.split("依赖") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add index tags
to support Chinese and English selections.
name='po_pairs') | ||
s_grouped_df.rename(columns={"s": "entity"}, inplace=True) | ||
|
||
# 使用'o'列进行分组,并将其他列转换为元组,然后聚合到list中 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comments in English.
name = name.strip() | ||
rep_name = re.sub(r'[^a-zA-Z0-9]', '_', name) | ||
md5_hash = hashlib.md5() | ||
# 更新 hash 对象,传入字符串的二进制形式 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comments in English.
md5_hash = hashlib.md5() | ||
# 更新 hash 对象,传入字符串的二进制形式 | ||
md5_hash.update(name.encode('utf-8')) | ||
# 获取十六进制的 MD5 值 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comments in English.
WORKSPACE = os.path.join(CWD, 'workspace') | ||
if not os.path.exists(WORKSPACE): | ||
os.makedirs(WORKSPACE) | ||
DATA_DIR = '/Users/lisiyuan/Codes/FromLLMtoAgent/data/musique-main/data' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your personal data dir?
return agent | ||
|
||
|
||
def create_divide_and_conquer_agent_v2(musique_data, get_llm_fn, get_embed_fn, prompt_template_dir, intermediate_dir, debug_mode): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between create_divide_and_conquer_agent_v1
and create_divide_and_conquer_agent_v2
?
add kag_agent