kash-shell 0.3.24__py3-none-any.whl → 0.3.25__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.
- kash/embeddings/embeddings.py +3 -5
- kash/embeddings/text_similarity.py +2 -5
- kash/help/help_embeddings.py +3 -0
- kash/llm_utils/llm_features.py +1 -1
- kash/llm_utils/llms.py +5 -7
- kash/model/params_model.py +1 -1
- kash/utils/text_handling/doc_normalization.py +2 -0
- kash/web_gen/templates/base_styles.css.jinja +8 -1
- {kash_shell-0.3.24.dist-info → kash_shell-0.3.25.dist-info}/METADATA +2 -2
- {kash_shell-0.3.24.dist-info → kash_shell-0.3.25.dist-info}/RECORD +13 -13
- {kash_shell-0.3.24.dist-info → kash_shell-0.3.25.dist-info}/WHEEL +0 -0
- {kash_shell-0.3.24.dist-info → kash_shell-0.3.25.dist-info}/entry_points.txt +0 -0
- {kash_shell-0.3.24.dist-info → kash_shell-0.3.25.dist-info}/licenses/LICENSE +0 -0
kash/embeddings/embeddings.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import ast
|
|
4
4
|
from collections.abc import Iterable
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import TYPE_CHECKING, TypeAlias
|
|
6
|
+
from typing import TYPE_CHECKING, TypeAlias
|
|
7
7
|
|
|
8
8
|
from pydantic.dataclasses import dataclass
|
|
9
9
|
from strif import abbrev_list
|
|
@@ -65,7 +65,6 @@ class Embeddings:
|
|
|
65
65
|
@classmethod
|
|
66
66
|
def embed(cls, keyvals: list[KeyVal], model=DEFAULT_EMBEDDING_MODEL) -> Embeddings:
|
|
67
67
|
from litellm import embedding
|
|
68
|
-
from litellm.types.utils import EmbeddingResponse
|
|
69
68
|
|
|
70
69
|
init_litellm()
|
|
71
70
|
|
|
@@ -82,9 +81,8 @@ class Embeddings:
|
|
|
82
81
|
keys = [kv[0] for kv in batch]
|
|
83
82
|
texts = [kv[1] for kv in batch]
|
|
84
83
|
|
|
85
|
-
response
|
|
86
|
-
|
|
87
|
-
)
|
|
84
|
+
response = embedding(model=model.litellm_name, input=texts)
|
|
85
|
+
|
|
88
86
|
if not response.data:
|
|
89
87
|
raise ValueError("No embedding response data")
|
|
90
88
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
4
|
|
|
5
5
|
from funlog import log_calls
|
|
6
6
|
|
|
@@ -24,12 +24,9 @@ def cosine_relatedness(x: ArrayLike, y: ArrayLike) -> float:
|
|
|
24
24
|
def embed_query(model: EmbeddingModel, query: str) -> EmbeddingResponse:
|
|
25
25
|
import litellm
|
|
26
26
|
from litellm import embedding
|
|
27
|
-
from litellm.types.utils import EmbeddingResponse
|
|
28
27
|
|
|
29
28
|
try:
|
|
30
|
-
response
|
|
31
|
-
EmbeddingResponse, embedding(model=model.litellm_name, input=[query])
|
|
32
|
-
)
|
|
29
|
+
response = embedding(model=model.litellm_name, input=[query])
|
|
33
30
|
except litellm.exceptions.APIError as e:
|
|
34
31
|
log.info("API error embedding query: %s", e)
|
|
35
32
|
raise ApiResultError(str(e))
|
kash/help/help_embeddings.py
CHANGED
|
@@ -3,6 +3,8 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
|
+
from typing_extensions import override
|
|
7
|
+
|
|
6
8
|
from kash.config.logger import get_logger
|
|
7
9
|
from kash.embeddings.embeddings import Embeddings
|
|
8
10
|
from kash.embeddings.text_similarity import rank_by_relatedness
|
|
@@ -19,6 +21,7 @@ class DocKey:
|
|
|
19
21
|
doc_type: HelpDocType
|
|
20
22
|
index: int
|
|
21
23
|
|
|
24
|
+
@override
|
|
22
25
|
def __str__(self) -> str:
|
|
23
26
|
return f"{self.doc_type.value}:{self.index}"
|
|
24
27
|
|
kash/llm_utils/llm_features.py
CHANGED
kash/llm_utils/llms.py
CHANGED
|
@@ -15,6 +15,7 @@ class LLM(LLMName, Enum):
|
|
|
15
15
|
# https://platform.openai.com/docs/models
|
|
16
16
|
o4_mini = LLMName("o4-mini")
|
|
17
17
|
o3 = LLMName("o3")
|
|
18
|
+
o3_pro = LLMName("o3-pro")
|
|
18
19
|
o3_mini = LLMName("o3-mini")
|
|
19
20
|
o1 = LLMName("o1")
|
|
20
21
|
o1_mini = LLMName("o1-mini")
|
|
@@ -35,13 +36,9 @@ class LLM(LLMName, Enum):
|
|
|
35
36
|
claude_3_5_haiku = LLMName("claude-3-5-haiku-latest")
|
|
36
37
|
|
|
37
38
|
# https://ai.google.dev/gemini-api/docs/models
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
gemini_2_5_flash_preview = LLMName("gemini-2.5-flash-preview-05-20")
|
|
42
|
-
gemini_2_0_flash = LLMName("gemini/gemini-2_0-flash")
|
|
43
|
-
gemini_2_0_flash_lite = LLMName("gemini/gemini-2.0-flash-lite")
|
|
44
|
-
gemini_2_0_pro_exp_02_05 = LLMName("gemini/gemini-2.0-pro-exp-02-05")
|
|
39
|
+
gemini_2_5_pro = LLMName("gemini/gemini-2.5-pro")
|
|
40
|
+
gemini_2_5_flash = LLMName("gemini/gemini-2.5-flash")
|
|
41
|
+
gemini_2_5_flash_lite = LLMName("gemini-2.5-flash-lite-preview-06-17")
|
|
45
42
|
|
|
46
43
|
# https://docs.x.ai/docs/models
|
|
47
44
|
xai_grok_3 = LLMName("xai/grok-3")
|
|
@@ -56,6 +53,7 @@ class LLM(LLMName, Enum):
|
|
|
56
53
|
deepseek_reasoner = LLMName("deepseek/deepseek-reasoner")
|
|
57
54
|
|
|
58
55
|
# https://console.groq.com/docs/models
|
|
56
|
+
groq_gemma2_9b_it = LLMName("groq/gemma2-9b-it")
|
|
59
57
|
groq_llama_3_1_8b_instant = LLMName("groq/llama-3.1-8b-instant")
|
|
60
58
|
groq_llama_3_3_70b_versatile = LLMName("groq/llama-3.3-70b-versatile")
|
|
61
59
|
groq_deepseek_r1_distill_llama_70b = LLMName("groq/deepseek-r1-distill-llama-70b")
|
kash/model/params_model.py
CHANGED
|
@@ -209,7 +209,7 @@ A list of parameter declarations, possibly with default values.
|
|
|
209
209
|
DEFAULT_CAREFUL_LLM = LLM.o3
|
|
210
210
|
DEFAULT_STRUCTURED_LLM = LLM.gpt_4o
|
|
211
211
|
DEFAULT_STANDARD_LLM = LLM.claude_4_sonnet
|
|
212
|
-
DEFAULT_FAST_LLM = LLM.
|
|
212
|
+
DEFAULT_FAST_LLM = LLM.gpt_4o
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
# Parameters set globally such as in the workspace.
|
|
@@ -21,6 +21,7 @@ def normalize_formatting(
|
|
|
21
21
|
format: Format | None,
|
|
22
22
|
support_ansi: bool = True,
|
|
23
23
|
cleanups: bool = True,
|
|
24
|
+
smartquotes: bool = True,
|
|
24
25
|
) -> str:
|
|
25
26
|
"""
|
|
26
27
|
Normalize formatting. Currently only normalizes Markdown and leaves plaintext
|
|
@@ -35,6 +36,7 @@ def normalize_formatting(
|
|
|
35
36
|
text,
|
|
36
37
|
line_wrapper=line_wrap_by_sentence(len_fn=len_fn, is_markdown=True),
|
|
37
38
|
cleanups=cleanups,
|
|
39
|
+
smartquotes=smartquotes,
|
|
38
40
|
)
|
|
39
41
|
elif format == Format.plaintext:
|
|
40
42
|
# Consider plaintext a raw format and don't normalize.
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
{% endblock root_variables %}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/* CSS color definitions. */
|
|
25
26
|
{{ color_defs|safe }}
|
|
26
27
|
|
|
27
28
|
{% block selection_styles %}
|
|
@@ -145,7 +146,7 @@ h2 + h3 {
|
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
h3 {
|
|
148
|
-
font-size: 1.
|
|
149
|
+
font-size: 1.15rem;
|
|
149
150
|
margin-top: 1.4rem;
|
|
150
151
|
margin-bottom: 0.7rem;
|
|
151
152
|
}
|
|
@@ -662,6 +663,12 @@ sup {
|
|
|
662
663
|
max-width: none;
|
|
663
664
|
}
|
|
664
665
|
|
|
666
|
+
/* Smaller table text on mobile. */
|
|
667
|
+
table code,
|
|
668
|
+
table pre {
|
|
669
|
+
font-size: var(--font-size-mono-small);
|
|
670
|
+
}
|
|
671
|
+
|
|
665
672
|
ul, ol {
|
|
666
673
|
margin-left: 1rem;
|
|
667
674
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kash-shell
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.25
|
|
4
4
|
Summary: The knowledge agent shell (core)
|
|
5
5
|
Project-URL: Repository, https://github.com/jlevy/kash-shell
|
|
6
6
|
Author-email: Joshua Levy <joshua@cal.berkeley.edu>
|
|
@@ -28,7 +28,7 @@ Requires-Dist: curl-cffi>=0.11.4
|
|
|
28
28
|
Requires-Dist: deepgram-sdk>=3.10.1
|
|
29
29
|
Requires-Dist: dunamai>=1.23.0
|
|
30
30
|
Requires-Dist: fastapi>=0.115.11
|
|
31
|
-
Requires-Dist: flowmark>=0.4.
|
|
31
|
+
Requires-Dist: flowmark>=0.4.8
|
|
32
32
|
Requires-Dist: frontmatter-format>=0.2.1
|
|
33
33
|
Requires-Dist: funlog>=0.2.0
|
|
34
34
|
Requires-Dist: httpx[brotli]>=0.28.1
|
|
@@ -81,8 +81,8 @@ kash/docs_base/recipes/general_system_commands.sh,sha256=rFNPuLj3Md09L5yzWx6ILja
|
|
|
81
81
|
kash/docs_base/recipes/python_dev_commands.sh,sha256=9vJsQiDZKJ7ShokFnzc2Jsto6n87MNRkbgcc2Ee9Kro,179
|
|
82
82
|
kash/docs_base/recipes/tldr_standard_commands.sh,sha256=7nPES55aT45HF3eDhQRrEUiWRpPdvvp40Sg88uADa80,60491
|
|
83
83
|
kash/embeddings/cosine.py,sha256=QTWPWUHivXjxCM6APSqij_-4mywM2BVVm0xb0hu7FHA,1587
|
|
84
|
-
kash/embeddings/embeddings.py,sha256=
|
|
85
|
-
kash/embeddings/text_similarity.py,sha256=
|
|
84
|
+
kash/embeddings/embeddings.py,sha256=q0f_yGAN8Hkx32t_k6smVSVWogbJFbTEEKay9uzUt4o,4311
|
|
85
|
+
kash/embeddings/text_similarity.py,sha256=HgoDffF0vuecjKN-l1MxHwvfJBYJORemmyO0WVQkyBI,1798
|
|
86
86
|
kash/exec/__init__.py,sha256=Najls8No143yoj_KAaOQgo8ufC2LWCB_DwwEQ-8nDM0,1277
|
|
87
87
|
kash/exec/action_decorators.py,sha256=kCEqQFN1MIhRbFeIEGux956LzsiwonhyIIrJ8Pq9zPk,16765
|
|
88
88
|
kash/exec/action_exec.py,sha256=tLL3ESIuxqS_gSOD4eGRYLuTzesRMTyKb_Uy3i_28VU,19022
|
|
@@ -117,7 +117,7 @@ kash/help/assistant.py,sha256=R0XHNi-h51QoQ7rGouD2chrDPGomYaPQUqJdvpjlCs8,11535
|
|
|
117
117
|
kash/help/assistant_instructions.py,sha256=jW5XAsmLx8YZMKSDJgWnqo9Vwe7VuiTURQHjKBqr_L8,2549
|
|
118
118
|
kash/help/assistant_output.py,sha256=9sM-OVLc6eMSOkxyovB88dNlsknFpf8Wz89Zp5PuEA8,1668
|
|
119
119
|
kash/help/function_param_info.py,sha256=yGuFLVZoDF1E1YsXqGwJhuY2uJB3R1B1EC77MEMSc-U,1700
|
|
120
|
-
kash/help/help_embeddings.py,sha256=
|
|
120
|
+
kash/help/help_embeddings.py,sha256=lcUv_Y402gHoJiH30Z85KpaezwARtN-eM3mvA6TtGK4,2841
|
|
121
121
|
kash/help/help_lookups.py,sha256=0dtuLWEXncqhJCijC98IA9stBDNNcJewt1JYqMLkTx4,2029
|
|
122
122
|
kash/help/help_pages.py,sha256=TaKsE26R-pZTrK4Pa593DK5osdJodFHaVm5pZpjqgaI,3894
|
|
123
123
|
kash/help/help_printing.py,sha256=eZbZdyJC158JiXcEk2zvUmqYbYzbYOpHvxEhC1kIN-Q,6086
|
|
@@ -131,10 +131,10 @@ kash/llm_utils/fuzzy_parsing.py,sha256=bbG2Y7i5w6kxAVPAixyluv3MDS2hW_pkhnJpVOLHZ
|
|
|
131
131
|
kash/llm_utils/init_litellm.py,sha256=5Fn9uW4P7lfEO8Rk1EJJUzDEGNjw-PDvxFgHlKDf-Ok,409
|
|
132
132
|
kash/llm_utils/llm_api_keys.py,sha256=nTB9wSFfHTOXvqshSQCQGCPxUwOW1U7oslngya8nHkw,1168
|
|
133
133
|
kash/llm_utils/llm_completion.py,sha256=SzeWGRrsjuN1TXdPwscYG6whLQkHclITtwTvQK19GE0,5436
|
|
134
|
-
kash/llm_utils/llm_features.py,sha256=
|
|
134
|
+
kash/llm_utils/llm_features.py,sha256=ZpQhHiRDtF1BY8HGxTQH0dIeM3rux7a9CvJ0JO2KAlI,1847
|
|
135
135
|
kash/llm_utils/llm_messages.py,sha256=70QwIIvdwo-h4Jfn_6MbEHb3LTUjUmzg_v_dU_Ey__g,1174
|
|
136
136
|
kash/llm_utils/llm_names.py,sha256=VZbdKnoeBx_luB5YQ-Rz37gMt3_FcueJdp40ZaQbpUA,3620
|
|
137
|
-
kash/llm_utils/llms.py,sha256=
|
|
137
|
+
kash/llm_utils/llms.py,sha256=Sm7SdNVE0pVIOpAggIgGp9s_Waw8vq6hNOCu-GTc6GI,3788
|
|
138
138
|
kash/local_server/__init__.py,sha256=AyNpvCOJlQF6A4DnlYKRMbbfRNzdizEA-ytp-F2SLZU,162
|
|
139
139
|
kash/local_server/local_server.py,sha256=EugjL30VM0pWdZDsiQxU-o6EdEa082qlGd_7RHvI5tk,5863
|
|
140
140
|
kash/local_server/local_server_commands.py,sha256=ZMp1DpYgg-MJ0iqH0DHfhWKDpFqNRG_txkRdODIr9mU,1661
|
|
@@ -171,7 +171,7 @@ kash/model/language_list.py,sha256=I3RIbxTseVmPdhExQimimEv18Gmy2ImMbpXe0-_t1Qw,4
|
|
|
171
171
|
kash/model/llm_actions_model.py,sha256=a29uXVNfS2CiqvM7HPdC6H9A23rSQQihAideuBLMH8g,2110
|
|
172
172
|
kash/model/media_model.py,sha256=ZnlZ-FkswbAIGpUAuNqLce1WDZK-WbnwHn2ipg8x7-0,3511
|
|
173
173
|
kash/model/operations_model.py,sha256=WmU-xeWGsqMLVN369dQEyVGU8T7G_KyLLsj6YFc5sVw,6517
|
|
174
|
-
kash/model/params_model.py,sha256=
|
|
174
|
+
kash/model/params_model.py,sha256=vSFMjWfksysEhAOQ2Ge2ZEvRqgUmIL7febxcI3-7Smg,15083
|
|
175
175
|
kash/model/paths_model.py,sha256=KDFm7wan7hjObHbnV2rR8-jsyLTVqbKcwFdKeLFRtdM,15889
|
|
176
176
|
kash/model/preconditions_model.py,sha256=-IfsVR0NkQhq_3hUTXzK2bFYAd--3YjSwUiDKHVQQqk,2887
|
|
177
177
|
kash/shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -242,7 +242,7 @@ kash/utils/rich_custom/multitask_status.py,sha256=ViNx35akEaV-fihef57_b3l8FnLytN
|
|
|
242
242
|
kash/utils/rich_custom/rich_char_transform.py,sha256=3M89tViKM0y31VHsDoHi5eHFWlv5ME7F4p35IdDxnrw,2616
|
|
243
243
|
kash/utils/rich_custom/rich_indent.py,sha256=nz72yNpUuYjOsaPNVmxM81oEQm-GKEfQkNsuWmv16G0,2286
|
|
244
244
|
kash/utils/rich_custom/rich_markdown_fork.py,sha256=M_JRaSAyHrSg-wuLv9C9P7SkehSim3lwkqQPuMIFkVw,26551
|
|
245
|
-
kash/utils/text_handling/doc_normalization.py,sha256=
|
|
245
|
+
kash/utils/text_handling/doc_normalization.py,sha256=UtVfaSHE5k_n7BzTbOkc5FUJtXiTbaw9QUl03AnCvLs,3043
|
|
246
246
|
kash/utils/text_handling/escape_html_tags.py,sha256=8pC3JgoKRtdnbnOu8DiWrlvNR6GAqjwhGbQgl3jiFG4,6441
|
|
247
247
|
kash/utils/text_handling/markdown_render.py,sha256=LHPdJc__2ejBx7iwkp_P9wIePNmiVSgwu4-uhamVjms,3791
|
|
248
248
|
kash/utils/text_handling/markdown_utils.py,sha256=tAPMZulEcJOmWQHnZVKRqstThmsLB0mm7Fey5DHMFvc,31985
|
|
@@ -262,7 +262,7 @@ kash/web_gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
262
262
|
kash/web_gen/simple_webpage.py,sha256=ks_0ljxCeS2-gAAEaUc1JEnzY3JY0nzqGFiyyqyRuZs,1537
|
|
263
263
|
kash/web_gen/tabbed_webpage.py,sha256=e0GGG1bQ4CQegpJgOIT2KpyM6cmwN_BQ9eJSsi4BjgY,4945
|
|
264
264
|
kash/web_gen/template_render.py,sha256=aypo6UanouftV4RpxgNm6JdquelI52fV0IlihdA3yjE,1908
|
|
265
|
-
kash/web_gen/templates/base_styles.css.jinja,sha256=
|
|
265
|
+
kash/web_gen/templates/base_styles.css.jinja,sha256=COMDe2UVJ8Uk2Jnce697EtRq8SC5-TeXyhQjrMksRxE,15088
|
|
266
266
|
kash/web_gen/templates/base_webpage.html.jinja,sha256=gwxXMSC_eY-stu8uT5AVyQJ-Ppy2GyWwq9vEdTEbVi0,12887
|
|
267
267
|
kash/web_gen/templates/content_styles.css.jinja,sha256=qwMKnjDRdjXxNfUgSrZEAkliHSLZ9OMsWGulonp-1Zs,3764
|
|
268
268
|
kash/web_gen/templates/explain_view.html.jinja,sha256=DNw5Iw5SrhIUFRGB4qNvfcKXsBHVbEJVURGdhvyC75Q,949
|
|
@@ -294,8 +294,8 @@ kash/xonsh_custom/xonsh_modern_tools.py,sha256=mj_b34LZXfE8MJe9EpDmp5JZ0tDM1biYN
|
|
|
294
294
|
kash/xonsh_custom/xonsh_ranking_completer.py,sha256=ZRGiAfoEgqgnlq2-ReUVEaX5oOgW1DQ9WxIv2OJLuTo,5620
|
|
295
295
|
kash/xontrib/fnm.py,sha256=V2tsOdmIDgbFbZSfMLpsvDIwwJJqiYnOkOySD1cXNXw,3700
|
|
296
296
|
kash/xontrib/kash_extension.py,sha256=FLIMlgR3C_6A1fwKE-Ul0nmmpJSszVPbAriinUyQ8Zg,1896
|
|
297
|
-
kash_shell-0.3.
|
|
298
|
-
kash_shell-0.3.
|
|
299
|
-
kash_shell-0.3.
|
|
300
|
-
kash_shell-0.3.
|
|
301
|
-
kash_shell-0.3.
|
|
297
|
+
kash_shell-0.3.25.dist-info/METADATA,sha256=vxaqN6N2fP79pTjdzslq61uL-DXCs2nrJMuPt014n4U,32726
|
|
298
|
+
kash_shell-0.3.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
299
|
+
kash_shell-0.3.25.dist-info/entry_points.txt,sha256=SQraWDAo8SqYpthLXThei0mf_hGGyhYBUO-Er_0HcwI,85
|
|
300
|
+
kash_shell-0.3.25.dist-info/licenses/LICENSE,sha256=rCh2PsfYeiU6FK_0wb58kHGm_Fj5c43fdcHEexiVzIo,34562
|
|
301
|
+
kash_shell-0.3.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|