Merge pull request #571 from codycjy/notebook_args
feat(jupyter): use args to disable Markdown parse
This commit is contained in:
commit
0b89673ee9
@ -35,6 +35,8 @@ def get_crazy_functions():
|
|||||||
"Color": "stop",
|
"Color": "stop",
|
||||||
"AsButton":False,
|
"AsButton":False,
|
||||||
"Function": HotReload(解析ipynb文件),
|
"Function": HotReload(解析ipynb文件),
|
||||||
|
"AdvancedArgs": True, # 调用时,唤起高级参数输入区(默认False)
|
||||||
|
"ArgsReminder": "若输入0,则不解析notebook中的Markdown块", # 高级参数输入区的显示提示
|
||||||
},
|
},
|
||||||
"批量总结Word文档": {
|
"批量总结Word文档": {
|
||||||
"Color": "stop",
|
"Color": "stop",
|
||||||
|
@ -67,11 +67,16 @@ def parseNotebook(filename, enable_markdown=1):
|
|||||||
def ipynb解释(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt):
|
def ipynb解释(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt):
|
||||||
from .crazy_utils import request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency
|
from .crazy_utils import request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency
|
||||||
|
|
||||||
|
enable_markdown = plugin_kwargs.get("advanced_arg", "1")
|
||||||
|
try:
|
||||||
|
enable_markdown = int(enable_markdown)
|
||||||
|
except ValueError:
|
||||||
|
enable_markdown = 1
|
||||||
|
|
||||||
pfg = PaperFileGroup()
|
pfg = PaperFileGroup()
|
||||||
|
|
||||||
print(file_manifest)
|
|
||||||
for fp in file_manifest:
|
for fp in file_manifest:
|
||||||
file_content = parseNotebook(fp, enable_markdown=1)
|
file_content = parseNotebook(fp, enable_markdown=enable_markdown)
|
||||||
pfg.file_paths.append(fp)
|
pfg.file_paths.append(fp)
|
||||||
pfg.file_contents.append(file_content)
|
pfg.file_contents.append(file_content)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user