From 4f684f7073149c48ea9dd962b64a8bf7a169a1cf Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Tue, 9 May 2023 15:57:05 -0500 Subject: Rewrote the argparsing functionality to enable autocompletion via the "kislyuk/argcomplete" package. This essentially means: - `argparsing.py` does a minimal amount of work to initialize the arg parser. Then it attempts dynamic completion. - `argvalidation.py` processes the raw arguments parsed in `argparsing.py`, validates them, issues warnings (if required), and splits them into logical groupings - Commands in `gcli.py` have been moved to `cmd.py` - `main.py` provides an initial control path to call these functions in succession --- src/gpt_chat_cli/openai_wrappers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/gpt_chat_cli/openai_wrappers.py') diff --git a/src/gpt_chat_cli/openai_wrappers.py b/src/gpt_chat_cli/openai_wrappers.py index 3e1ec06..d478531 100644 --- a/src/gpt_chat_cli/openai_wrappers.py +++ b/src/gpt_chat_cli/openai_wrappers.py @@ -5,6 +5,8 @@ from typing import Any, List, Optional, Generator from dataclasses import dataclass from enum import Enum, auto +from .argvalidation import CompletionArguments + @dataclass class Delta: content: Optional[str] = None @@ -21,7 +23,6 @@ class FinishReason(Enum): if finish_reason_str is None: return FinishReason.NONE return FinishReason[finish_reason_str.upper()] - @dataclass class Choice: delta: Delta @@ -79,8 +80,6 @@ class OpenAIChatResponse: OpenAIChatResponseStream = Generator[OpenAIChatResponse, None, None] -from .argparsing import CompletionArguments - def create_chat_completion(hist : ChatHistory, args: CompletionArguments) \ -> OpenAIChatResponseStream: -- cgit v1.2.3