diff --git a/nbs/00_core.ipynb b/nbs/00_core.ipynb index 5681f1a..b2d167c 100644 --- a/nbs/00_core.ipynb +++ b/nbs/00_core.ipynb @@ -414,33 +414,23 @@ { "data": { "text/html": [ - "
        ********************************************************************************\n",
-       "\n",
-       "!!\n",
-       "  self.initialize_options()\n",
-       "installing to build/bdist.macosx-14.0-arm64/wheel\n",
-       "running install\n",
-       "running install_lib\n",
-       "creating build/bdist.macosx-14.0-arm64/wheel\n",
-       "creating build/bdist.macosx-14.0-arm64/wheel/shell_sage\n",
-       "copying build/lib/shell_sage/config.py -> build/bdist.macosx-14.0-arm64/wheel/./shell_sage\n",
-       "copying build/lib/shell_sage/_modidx.py -> build/bdist.macosx-14.0-arm64/wheel/./shell_sage\n",
-       "copying build/lib/she\n",
+       "
%20and%20trying%20to%20create%20their%20own%20complete%20list%20of%20location%20IDs.%0A%0AThere%27s%20just%20one%20\n",
+       "problem%3A%20by%20holding%2\n",
+       "0the%20two%20lists%20up%20side%20by%20side%20(your%20puzzle%20input)%2C%20it%20quickly%20becomes%20clear%20that%20t\n",
+       "he%20lists%20aren%27t%20ver\n",
+       "y%20similar.%20Maybe%20you%20can%20help%20The%20Historians%20reconcile%20their%20lists%3F%0A%0AFor%20example%3A%0A%\n",
+       "0A%60%60%60%0A3%20%20%204%0\n",
+       "A4%20%20%203%0A2%20%20%205%0A1%20%20%203%0A3%20%20%209%0A3%20%20%203%0A%60%60%60%0A\n",
        "
\n" ], "text/plain": [ - " ********************************************************************************\n", - "\n", - "!!\n", - " \u001b[1;35mself.initialize_options\u001b[0m\u001b[1m(\u001b[0m\u001b[1m)\u001b[0m\n", - "installing to build/bdist.macosx-\u001b[1;36m14.0\u001b[0m-arm64/wheel\n", - "running install\n", - "running install_lib\n", - "creating build/bdist.macosx-\u001b[1;36m14.0\u001b[0m-arm64/wheel\n", - "creating build/bdist.macosx-\u001b[1;36m14.0\u001b[0m-arm64/wheel/shell_sage\n", - "copying build/lib/shell_sage/config.py -> build/bdist.macosx-\u001b[1;36m14.0\u001b[0m-arm64/wheel/.\u001b[35m/\u001b[0m\u001b[95mshell_sage\u001b[0m\n", - "copying build/lib/shell_sage/_modidx.py -> build/bdist.macosx-\u001b[1;36m14.0\u001b[0m-arm64/wheel/.\u001b[35m/\u001b[0m\u001b[95mshell_sage\u001b[0m\n", - "copying build/lib/she\n" + "%20and%20trying%20to%20create%20their%20own%20complete%20list%20of%20location%20IDs.%0A%0AThere%27s%\u001b[1;36m20j\u001b[0must%20one%20\n", + "problem%3A%20by%20holding%\u001b[1;36m2\u001b[0m\n", + "0the%20two%20lists%20up%20side%20by%20side%\u001b[1;35m20\u001b[0m\u001b[1m(\u001b[0myour%20puzzle%20input\u001b[1m)\u001b[0m%2C%20it%20quickly%20becomes%20clear%20that%20t\n", + "he%20lists%20aren%27t%20ver\n", + "y%20similar.%20Maybe%20you%20can%20help%20The%20Historians%20reconcile%20their%20lists%3F%0A%0AFor%20example%3A%0A%\n", + "0A%\u001b[1;36m60\u001b[0m%\u001b[1;36m60\u001b[0m%\u001b[1;36m60\u001b[0m%0A3%\u001b[1;36m20\u001b[0m%\u001b[1;36m20\u001b[0m%\u001b[1;36m204\u001b[0m%\u001b[1;36m0\u001b[0m\n", + "A4%\u001b[1;36m20\u001b[0m%\u001b[1;36m20\u001b[0m%\u001b[1;36m203\u001b[0m%0A2%\u001b[1;36m20\u001b[0m%\u001b[1;36m20\u001b[0m%\u001b[1;36m205\u001b[0m%0A1%\u001b[1;36m20\u001b[0m%\u001b[1;36m20\u001b[0m%\u001b[1;36m203\u001b[0m%0A3%\u001b[1;36m20\u001b[0m%\u001b[1;36m20\u001b[0m%\u001b[1;36m209\u001b[0m%0A3%\u001b[1;36m20\u001b[0m%\u001b[1;36m20\u001b[0m%\u001b[1;36m203\u001b[0m%0A%\u001b[1;36m60\u001b[0m%\u001b[1;36m60\u001b[0m%\u001b[1;36m60\u001b[0m%0A\n" ] }, "metadata": {}, @@ -475,33 +465,47 @@ { "data": { "text/html": [ - "
<pane id=%1 active>        ********************************************************************************\n",
+       "
<pane id=%1 >IPython 8.30.0 -- An enhanced Interactive Python. Type '?' for help\n",
+       ".\n",
+       "<IPython.core.display.Javascript object>\n",
+       "\n",
+       "In [1]: import aimagic\n",
+       "\n",
+       "In [2]:\n",
        "\n",
-       "!!\n",
-       "  self.initialize_options()\n",
-       "installing to build/bdist.macosx-14.0-arm64/wheel\n",
-       "running install\n",
-       "running install_lib\n",
-       "creating build/bdist.macosx-14.0-arm64/wheel\n",
-       "creating build/bdist.macosx-14.0-arm64/wheel/shell_sage\n",
-       "copying build/lib/shell_sage/config.py -> build/bdist.macosx-14.0-arm64/wheel/./shell_sage\n",
-       "copying build/lib/shell_sage/_modidx.py -> build/bdist.macosx-14.0-arm64/wheel/./shell_sage\n",
-       "co\n",
+       "\n",
+       "Do you really want to exit (/n)? y\n",
+       "(uv) Nathans-MacBook-Air:git nathan$ clear\n",
+       "(uv) Nathans-MacBook-Air:git nathan$ ls\n",
+       "ContextKit              msglm\n",
+       "README.md               nate-research\n",
+       "aimagic                 nb2fasthtml\n",
+       "answerdotai             nbdev\n",
+       "apswutils               pips.txt\n",
+       "claudette               plash\n",
+       "clone.sh                playwrightn\n",
        "
\n" ], "text/plain": [ - "\u001b[1m<\u001b[0m\u001b[1;95mpane\u001b[0m\u001b[39m \u001b[0m\u001b[33mid\u001b[0m\u001b[39m=%\u001b[0m\u001b[1;36m1\u001b[0m\u001b[39m active> ********************************************************************************\u001b[0m\n", + "\u001b[1m<\u001b[0m\u001b[1;95mpane\u001b[0m\u001b[39m \u001b[0m\u001b[33mid\u001b[0m\u001b[39m=%\u001b[0m\u001b[1;36m1\u001b[0m\u001b[39m >IPython \u001b[0m\u001b[1;36m8.30\u001b[0m\u001b[39m.\u001b[0m\u001b[1;36m0\u001b[0m\u001b[39m -- An enhanced Interactive Python. Type \u001b[0m\u001b[32m'?'\u001b[0m\u001b[39m for help\u001b[0m\n", + "\u001b[39m.\u001b[0m\n", + "\u001b[39m\u001b[0m\n", + "\n", + "In \u001b[1m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1m]\u001b[0m: import aimagic\n", + "\n", + "In \u001b[1m[\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1m]\u001b[0m:\n", + "\n", "\n", - "\u001b[39m!!\u001b[0m\n", - "\u001b[39m \u001b[0m\u001b[1;35mself.initialize_options\u001b[0m\u001b[1;39m(\u001b[0m\u001b[1;39m)\u001b[0m\n", - "\u001b[39minstalling to build/bdist.macosx-\u001b[0m\u001b[1;36m14.0\u001b[0m\u001b[39m-arm64/wheel\u001b[0m\n", - "\u001b[39mrunning install\u001b[0m\n", - "\u001b[39mrunning install_lib\u001b[0m\n", - "\u001b[39mcreating build/bdist.macosx-\u001b[0m\u001b[1;36m14.0\u001b[0m\u001b[39m-arm64/wheel\u001b[0m\n", - "\u001b[39mcreating build/bdist.macosx-\u001b[0m\u001b[1;36m14.0\u001b[0m\u001b[39m-arm64/wheel/shell_sage\u001b[0m\n", - "\u001b[39mcopying build/lib/shell_sage/config.py -> build/bdist.macosx-\u001b[0m\u001b[1;36m14.0\u001b[0m\u001b[39m-arm64/wheel/.\u001b[0m\u001b[35m/\u001b[0m\u001b[95mshell_sage\u001b[0m\n", - "\u001b[39mcopying build/lib/shell_sage/_modidx.py -\u001b[0m\u001b[1m>\u001b[0m build/bdist.macosx-\u001b[1;36m14.0\u001b[0m-arm64/wheel/.\u001b[35m/\u001b[0m\u001b[95mshell_sage\u001b[0m\n", - "co\n" + "Do you really want to exit \u001b[1m(\u001b[0m\u001b[35m/\u001b[0m\u001b[95mn\u001b[0m\u001b[1m)\u001b[0m? y\n", + "\u001b[1m(\u001b[0muv\u001b[1m)\u001b[0m Nathans-MacBook-Air:git nathan$ clear\n", + "\u001b[1m(\u001b[0muv\u001b[1m)\u001b[0m Nathans-MacBook-Air:git nathan$ ls\n", + "ContextKit msglm\n", + "README.md nate-research\n", + "aimagic nb2fasthtml\n", + "answerdotai nbdev\n", + "apswutils pips.txt\n", + "claudette plash\n", + "clone.sh playwrightn\n" ] }, "metadata": {}, @@ -681,27 +685,27 @@ { "data": { "text/markdown": [ - "**Hello! I'm ShellSage, your friendly command-line teaching assistant.**\n", + "**Hello!**\n", "\n", - "I'll help you master shell commands and system administration skills. Whether you're a beginner or just need a refresher, I'm here to provide clear explanations, examples, and guidance.\n", + "I'm ShellSage, your friendly command-line teaching assistant. I'll help you learn and master shell commands, system administration, and more. **I exist solely to assist and educate**, so feel free to ask me anything, from basic queries to complex problem-solving.\n", "\n", - "What can I assist you with today? Do you have a specific question or problem you'd like help with?\n", + "What's on your mind? Do you have a specific question or topic you'd like to explore?\n", "\n", "
\n", "\n", - "- id: chatcmpl-368\n", - "- choices: [Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content=\"**Hello! I'm ShellSage, your friendly command-line teaching assistant.**\\n\\nI'll help you master shell commands and system administration skills. Whether you're a beginner or just need a refresher, I'm here to provide clear explanations, examples, and guidance.\\n\\nWhat can I assist you with today? Do you have a specific question or problem you'd like help with?\", refusal=None, role='assistant', audio=None, function_call=None, tool_calls=None))]\n", - "- created: 1734630256\n", + "- id: chatcmpl-727\n", + "- choices: [Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content=\"**Hello!**\\n\\nI'm ShellSage, your friendly command-line teaching assistant. I'll help you learn and master shell commands, system administration, and more. **I exist solely to assist and educate**, so feel free to ask me anything, from basic queries to complex problem-solving.\\n\\nWhat's on your mind? Do you have a specific question or topic you'd like to explore?\", refusal=None, role='assistant', audio=None, function_call=None, tool_calls=None))]\n", + "- created: 1735058853\n", "- model: llama3.2\n", "- object: chat.completion\n", "- service_tier: None\n", "- system_fingerprint: fp_ollama\n", - "- usage: CompletionUsage(completion_tokens=77, prompt_tokens=344, total_tokens=421, completion_tokens_details=None, prompt_tokens_details=None)\n", + "- usage: CompletionUsage(completion_tokens=79, prompt_tokens=344, total_tokens=423, completion_tokens_details=None, prompt_tokens_details=None)\n", "\n", "
" ], "text/plain": [ - "ChatCompletion(id='chatcmpl-368', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content=\"**Hello! I'm ShellSage, your friendly command-line teaching assistant.**\\n\\nI'll help you master shell commands and system administration skills. Whether you're a beginner or just need a refresher, I'm here to provide clear explanations, examples, and guidance.\\n\\nWhat can I assist you with today? Do you have a specific question or problem you'd like help with?\", refusal=None, role='assistant', audio=None, function_call=None, tool_calls=None))], created=1734630256, model='llama3.2', object='chat.completion', service_tier=None, system_fingerprint='fp_ollama', usage=In: 344; Out: 77; Total: 421)" + "ChatCompletion(id='chatcmpl-727', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content=\"**Hello!**\\n\\nI'm ShellSage, your friendly command-line teaching assistant. I'll help you learn and master shell commands, system administration, and more. **I exist solely to assist and educate**, so feel free to ask me anything, from basic queries to complex problem-solving.\\n\\nWhat's on your mind? Do you have a specific question or topic you'd like to explore?\", refusal=None, role='assistant', audio=None, function_call=None, tool_calls=None))], created=1735058853, model='llama3.2', object='chat.completion', service_tier=None, system_fingerprint='fp_ollama', usage=In: 344; Out: 79; Total: 423)" ] }, "execution_count": null, diff --git a/nbs/01_config.ipynb b/nbs/01_config.ipynb index 4de7d33..3bc3fff 100644 --- a/nbs/01_config.ipynb +++ b/nbs/01_config.ipynb @@ -145,8 +145,8 @@ "class ShellSageConfig:\n", " provider: str = \"anthropic\"\n", " model: str = providers['anthropic'][1]\n", - " base_url: str = None\n", - " api_key: str = None\n", + " base_url: str = ''\n", + " api_key: str = ''\n", " history_lines: int = -1\n", " code_theme: str = \"monokai\"\n", " code_lexer: str = \"python\"" @@ -161,7 +161,7 @@ { "data": { "text/plain": [ - "ShellSageConfig(provider='anthropic', model='claude-3-5-sonnet-20241022', base_url=None, api_key=None, history_lines=-1, code_theme='monokai', code_lexer='python')" + "ShellSageConfig(provider='anthropic', model='claude-3-5-sonnet-20241022', base_url='', api_key='', history_lines=-1, code_theme='monokai', code_lexer='python')" ] }, "execution_count": null, diff --git a/shell_sage/config.py b/shell_sage/config.py index d0fb831..0b70274 100644 --- a/shell_sage/config.py +++ b/shell_sage/config.py @@ -29,8 +29,8 @@ def _cfg_path(): return xdg_config_home() / _shell_sage_home_dir / _shell_sage_c class ShellSageConfig: provider: str = "anthropic" model: str = providers['anthropic'][1] - base_url: str = None - api_key: str = None + base_url: str = '' + api_key: str = '' history_lines: int = -1 code_theme: str = "monokai" code_lexer: str = "python"