Skip to content

Commit

Permalink
Update configuration handling and model selection
Browse files Browse the repository at this point in the history
 Fixes #18
  • Loading branch information
ncoop57 committed Dec 28, 2024
1 parent 499b88b commit 9c88b09
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions nbs/01_config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@
" path = _cfg_path()\n",
" path.parent.mkdir(parents=True, exist_ok=True)\n",
" _types = get_type_hints(ShellSageConfig)\n",
" return Config(path.parent, path.name, create=asdict(ShellSageConfig()), types=_types)"
" return Config(path.parent, path.name, create=asdict(ShellSageConfig()),\n",
" types=_types, inline_comment_prefixes=('#'))"
]
},
{
Expand All @@ -198,7 +199,7 @@
{
"data": {
"text/plain": [
"{'provider': 'anthropic', 'model': 'claude-3-5-sonnet-20241022', 'base_url': '', 'api_key': '', 'history_lines': '-1', 'code_theme': 'monokai', 'code_lexer': 'python'}"
"{'provider': 'openai', 'model': 'deepseek-chat', 'base_url': 'https://api.deepseek.com', 'api_key': 'sk-7369d525c23c4078b6d7e2af55903e71', 'history_lines': '-1', 'code_theme': 'monokai', 'code_lexer': 'python'}"
]
},
"execution_count": null,
Expand Down
2 changes: 1 addition & 1 deletion nbs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"[DEFAULT]\n",
"# Choose your AI model provider\n",
"provider = anthropic # or 'openai'\n",
"model = claude-3-sonnet # or 'gpt-4o-mini' for OpenAI\n",
"model = claude-3-5-sonnet-20241022 # or 'gpt-4o-mini' for OpenAI\n",
"base_url = # leave empty to use default openai endpoint\n",
"api_key = # leave empty to default to using your OPENAI_API_KEY env var\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ keywords = nbdev jupyter notebook python
language = English
status = 3
user = AnswerDotAI
requirements = claudette cosette fastcore rich
requirements = claudette cosette fastcore>=1.7.28 rich
console_scripts = ssage=shell_sage.core:main
readme_nb = index.ipynb
allowed_metadata_keys =
Expand Down
3 changes: 2 additions & 1 deletion shell_sage/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ def get_cfg():
path = _cfg_path()
path.parent.mkdir(parents=True, exist_ok=True)
_types = get_type_hints(ShellSageConfig)
return Config(path.parent, path.name, create=asdict(ShellSageConfig()), types=_types)
return Config(path.parent, path.name, create=asdict(ShellSageConfig()),
types=_types, inline_comment_prefixes=('#'))

0 comments on commit 9c88b09

Please sign in to comment.