XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Support none conversation file

90e30c83
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +3 -3
Modified g4f/cli/client.py +3 -3
@@ -44,7 +44,7 @@ class ConversationManager:
44 44
45 45 def _load(self) -> None:
46 46 """Load conversation from file."""
47 if not self.file_path.exists():
47 if not self.file_path.is_file():
48 48 return
49 49
50 50 try:
@@ -67,7 +67,7 @@ class ConversationManager:
67 67
68 68 def save(self) -> None:
69 69 """Save conversation to file."""
70 if not self.file_path:
70 if self.file_path.exists() and not self.file_path.is_file():
71 71 return
72 72
73 73 try:
@@ -285,7 +285,7 @@ def run_client_args(args):
285 285 print(f"Error reading file {args.input[0]} as text. Ensure it is a valid text file.", file=sys.stderr)
286 286 sys.exit(1)
287 287 if len(args.input) > 1:
288 input_text = f"{' '.join(args.input[1:])}\n```{os.path.basename(args.input[0])}\n" + file_content + "\n```"
288 input_text = f"{' '.join(args.input[1:])}\n```{os.path.basename(args.input[0])}\n{file_content}\n```"
289 289 else:
290 290 input_text = file_content
291 291 elif args.input: