yaicli 0.5.7__py3-none-any.whl → 0.5.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyproject.toml +1 -1
- yaicli/chat.py +4 -2
- yaicli/cli.py +1 -1
- yaicli/client.py +1 -1
- yaicli/config.py +1 -1
- yaicli/const.py +8 -16
- yaicli/printer.py +1 -1
- {yaicli-0.5.7.dist-info → yaicli-0.5.8.dist-info}/METADATA +1 -1
- {yaicli-0.5.7.dist-info → yaicli-0.5.8.dist-info}/RECORD +12 -12
- {yaicli-0.5.7.dist-info → yaicli-0.5.8.dist-info}/WHEEL +0 -0
- {yaicli-0.5.7.dist-info → yaicli-0.5.8.dist-info}/entry_points.txt +0 -0
- {yaicli-0.5.7.dist-info → yaicli-0.5.8.dist-info}/licenses/LICENSE +0 -0
pyproject.toml
CHANGED
yaicli/chat.py
CHANGED
@@ -10,8 +10,8 @@ from rich.table import Table
|
|
10
10
|
|
11
11
|
from .config import cfg
|
12
12
|
from .console import YaiConsole, get_console
|
13
|
-
from .schemas import ChatMessage
|
14
13
|
from .exceptions import ChatDeleteError, ChatLoadError, ChatSaveError
|
14
|
+
from .schemas import ChatMessage
|
15
15
|
from .utils import option_callback
|
16
16
|
|
17
17
|
console: YaiConsole = get_console()
|
@@ -68,7 +68,9 @@ class Chat:
|
|
68
68
|
data = json.load(f)
|
69
69
|
self.title = data.get("title", self.title)
|
70
70
|
self.date = data.get("date", self.date)
|
71
|
-
self.history = [
|
71
|
+
self.history = [
|
72
|
+
ChatMessage(role=msg["role"], content=msg["content"]) for msg in data.get("history", [])
|
73
|
+
]
|
72
74
|
return True
|
73
75
|
except (json.JSONDecodeError, OSError) as e:
|
74
76
|
raise ChatLoadError(f"Error loading chat: {e}") from e
|
yaicli/cli.py
CHANGED
@@ -17,7 +17,7 @@ from rich.panel import Panel
|
|
17
17
|
from rich.prompt import Prompt
|
18
18
|
|
19
19
|
from .chat import Chat, FileChatManager, chat_mgr
|
20
|
-
from .client import
|
20
|
+
from .client import ChatMessage, LitellmClient
|
21
21
|
from .config import cfg
|
22
22
|
from .console import get_console
|
23
23
|
from .const import (
|
yaicli/client.py
CHANGED
@@ -11,7 +11,7 @@ from rich.panel import Panel
|
|
11
11
|
|
12
12
|
from .config import cfg
|
13
13
|
from .console import get_console
|
14
|
-
from .schemas import
|
14
|
+
from .schemas import ChatMessage, LLMResponse, ToolCall
|
15
15
|
from .tools import (
|
16
16
|
Function,
|
17
17
|
FunctionName,
|
yaicli/config.py
CHANGED
yaicli/const.py
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
try:
|
2
|
+
from enum import StrEnum
|
3
|
+
except ImportError:
|
4
|
+
from enum import Enum
|
5
|
+
|
6
|
+
class StrEnum(str, Enum):
|
7
|
+
"""Compatible with python below 3.11"""
|
8
|
+
|
2
9
|
from pathlib import Path
|
3
10
|
from tempfile import gettempdir
|
4
11
|
from typing import Any, Literal, Optional
|
@@ -63,21 +70,6 @@ DEFAULT_SHOW_FUNCTION_OUTPUT: BOOL_STR = "true"
|
|
63
70
|
DEFAULT_REASONING_EFFORT: Optional[Literal["low", "high", "medium"]] = None
|
64
71
|
|
65
72
|
|
66
|
-
class EventTypeEnum(StrEnum):
|
67
|
-
"""Enumeration of possible event types from the SSE stream."""
|
68
|
-
|
69
|
-
ERROR = "error"
|
70
|
-
REASONING = "reasoning"
|
71
|
-
REASONING_END = "reasoning_end"
|
72
|
-
CONTENT = "content"
|
73
|
-
FINISH = "finish"
|
74
|
-
TOOL_CALL_START = "tool_call_start"
|
75
|
-
TOOL_CALL_DELTA = "tool_call_delta"
|
76
|
-
TOOL_CALL_END = "tool_call_end"
|
77
|
-
TOOL_RESULT = "tool_result"
|
78
|
-
TOOL_CALLS_FINISH = "tool_calls_finish"
|
79
|
-
|
80
|
-
|
81
73
|
SHELL_PROMPT = """You are YAICLI, a shell command generator.
|
82
74
|
The context conversation may contain other types of messages,
|
83
75
|
but you should only respond with a single valid {_shell} shell command for {_os}.
|
yaicli/printer.py
CHANGED
@@ -8,8 +8,8 @@ from rich.live import Live
|
|
8
8
|
from .client import RefreshLive
|
9
9
|
from .config import Config, get_config
|
10
10
|
from .console import YaiConsole, get_console
|
11
|
-
from .schemas import ChatMessage
|
12
11
|
from .render import Markdown, plain_formatter
|
12
|
+
from .schemas import ChatMessage
|
13
13
|
|
14
14
|
if TYPE_CHECKING:
|
15
15
|
from .schemas import LLMResponse
|
@@ -1,15 +1,15 @@
|
|
1
|
-
pyproject.toml,sha256=
|
1
|
+
pyproject.toml,sha256=uIesu0u5n1nVFJ4MJ4ZO4G9hr4EGlwcysyKybIG3PyM,1963
|
2
2
|
yaicli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
yaicli/chat.py,sha256=
|
4
|
-
yaicli/cli.py,sha256=
|
5
|
-
yaicli/client.py,sha256=
|
6
|
-
yaicli/config.py,sha256=
|
3
|
+
yaicli/chat.py,sha256=_emvZEdgMBth2nQGaNWPf0P45oW2k3bpuIwqsxFcM5A,13676
|
4
|
+
yaicli/cli.py,sha256=u4rq04CdLiL-IBzQ0IimPyFAh9XZg9YUTuvM4CxE3pE,22985
|
5
|
+
yaicli/client.py,sha256=kdEI4HP1zZQHUf-7kNbE9ItpyRN8zcAGyKeBSb1R4Ro,16565
|
6
|
+
yaicli/config.py,sha256=HrWYcelLXE61XX719eVcuuo3292xxf1BNQznWdvjQFQ,6535
|
7
7
|
yaicli/console.py,sha256=vARPJd-3lafutsQWrGntQVjLrYqaJD3qisN82pmuhjU,1973
|
8
|
-
yaicli/const.py,sha256=
|
8
|
+
yaicli/const.py,sha256=mt_6m2jo5-tHEmk3DxKCEc5ek9DcyQGHFAn_HEeMP3k,8155
|
9
9
|
yaicli/entry.py,sha256=gKzN8Yar3tpBd2Z2a80gD3k0W4Sf3lL7jdyws-2y-H0,8687
|
10
10
|
yaicli/exceptions.py,sha256=WBYg8OTJJzaj7lt6HE7ZyBoe5T6A3yZRNCRfWd4iN0c,372
|
11
11
|
yaicli/history.py,sha256=s-57X9FMsaQHF7XySq1gGH_jpd_cHHTYafYu2ECuG6M,2472
|
12
|
-
yaicli/printer.py,sha256=
|
12
|
+
yaicli/printer.py,sha256=J-QPrb0q4Zrx18vwBGIBDQk7RzT4wXJPwdJ9oXLoEVg,8369
|
13
13
|
yaicli/render.py,sha256=k8o2P8fI44PJlyQbs7gmMiu2x2prwajdWn5JIt15BIA,505
|
14
14
|
yaicli/role.py,sha256=PfwiVJIlzg7EzlvMM-kIy6vBK0d5d_J4M1I_fIZGnWk,7399
|
15
15
|
yaicli/schemas.py,sha256=PiuSY7ORZaA4OL_tYm0inwqirHp5M-F3zcCipLwsH9E,571
|
@@ -17,8 +17,8 @@ yaicli/tools.py,sha256=d-5LXbEB-1Uq5VKSgwlAiNDVOGrHkku2DpmZoorq1zw,3098
|
|
17
17
|
yaicli/utils.py,sha256=bpo3Xhozpxsaci3FtEIKZ32l4ZdyWMsrHjYGX0tB4J4,4541
|
18
18
|
yaicli/functions/__init__.py,sha256=_FJooQ9GkijG8xLwuU0cr5GBrGnC9Nc6bnCeUjrsT0k,1271
|
19
19
|
yaicli/functions/buildin/execute_shell_command.py,sha256=unl1-F8p6QZajeHdA0u5UpURMJM0WhdWMUWCCCHVRcI,1320
|
20
|
-
yaicli-0.5.
|
21
|
-
yaicli-0.5.
|
22
|
-
yaicli-0.5.
|
23
|
-
yaicli-0.5.
|
24
|
-
yaicli-0.5.
|
20
|
+
yaicli-0.5.8.dist-info/METADATA,sha256=BRZEKpxpZ6kPABv88FGl4ipt8glgJdAn-9ZxiDLAAeo,50349
|
21
|
+
yaicli-0.5.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
22
|
+
yaicli-0.5.8.dist-info/entry_points.txt,sha256=iYVyQP0PJIm9tQnlQheqT435kK_xdGoi5j9aswGV9hA,66
|
23
|
+
yaicli-0.5.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
24
|
+
yaicli-0.5.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|