File tree Expand file tree Collapse file tree 3 files changed +42
-16
lines changed
Expand file tree Collapse file tree 3 files changed +42
-16
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44
55[tool .poetry ]
66name = " readmeai"
7- version = " 0.3.099 "
7+ version = " 0.3.0999 "
88description = " 🚀 Generate beautiful README.md files from the terminal. Powered by OpenAI's GPT LLMs 💫"
99authors = [" Eli <0x.eli.64s@gmail.com>" ]
1010license = " MIT"
Original file line number Diff line number Diff line change 1212logger = logger .Logger (__name__ )
1313
1414
15- async def run_model (
15+ def run_app (
16+ api_key : str ,
17+ encoding : str ,
18+ endpoint : str ,
19+ offline_mode : bool ,
20+ model : str ,
21+ output : str ,
22+ repository : str ,
23+ temperature : float ,
24+ language : str ,
25+ style : int ,
26+ ) -> None :
27+ """Orchestrates the README file generation process."""
28+ config = conf .load_config ()
29+ config_model = conf .AppConfigModel (app = config )
30+ config_helper = conf .load_config_helper (config_model )
31+ config .api .model = model
32+ config .paths .readme = output
33+ config .api .temperature = temperature
34+ config .api .offline_mode = offline_mode
35+ config .git = conf .GitConfig (repository = repository )
36+ if api_key is None and offline_mode is False :
37+ config .api .offline_mode = offline_mode
38+
39+ asyncio .run (generate_readme (config , config_helper ))
40+
41+
42+ async def generate_readme (
1643 config : conf .AppConfig , config_helper : conf .ConfigHelper
1744) -> None :
1845 """Orchestrates the README file generation process."""
Original file line number Diff line number Diff line change 11"""CLI commands for readme-ai."""
22
3- import asyncio
43from typing import Optional
54
65import click
76
87from readmeai .cli import options
98
10- from .. import app , conf
9+ from readmeai . app import run_app
1110
1211
1312@click .command ()
@@ -34,18 +33,18 @@ def cli(
3433 style : Optional [int ],
3534):
3635 """CLI entrypoint for readme-ai."""
37- config = conf . load_config ()
38- config_model = conf . AppConfigModel ( app = config )
39- config_helper = conf . load_config_helper ( config_model )
40- config . api . model = model
41- config . paths . readme = output
42- config . api . temperature = temperature
43- config . api . offline_mode = offline_mode
44- config . git = conf . GitConfig ( repository = repository )
45- if api_key is None and offline_mode is False :
46- config . api . offline_mode = offline_mode
47-
48- asyncio . run ( app . run_model ( config , config_helper ) )
36+ run_app (
37+ api_key = api_key ,
38+ encoding = encoding ,
39+ endpoint = endpoint ,
40+ offline_mode = offline_mode ,
41+ model = model ,
42+ output = output ,
43+ repository = repository ,
44+ temperature = temperature ,
45+ language = language ,
46+ style = style ,
47+ )
4948
5049
5150if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments