diff --git a/README.md b/README.md index 2763be1..08ec1ff 100644 --- a/README.md +++ b/README.md @@ -152,8 +152,8 @@ to let `fish-ai` suggest a fix! ## 🤸 Additional options -You can tweak the behaviour of `fish-ai` by putting additional options in the -active section of your `fish-ai.ini` file. +You can tweak the behaviour of `fish-ai` by putting additional options in your +`fish-ai.ini` configuration file. ### Explain in a different language @@ -162,9 +162,6 @@ to the name of the language. For example: ```ini [fish-ai] -configuration = foo - -[foo] language = Swedish ``` @@ -181,9 +178,6 @@ Here is an example of how to increase the temperature to `0.5`. ```ini [fish-ai] -configuration = foo - -[foo] temperature = 0.5 ``` @@ -198,9 +192,6 @@ Here is an example of how you can increase the number of completions to `10`: ```ini [fish-ai] -configuration = foo - -[foo] completions = 10 ``` @@ -215,9 +206,6 @@ is `0` (do not send any commandline history). ```ini [fish-ai] -configuration = foo - -[foo] history_size = 5 ``` diff --git a/src/fish_ai/engine.py b/src/fish_ai/engine.py index 22c02c0..920a4e7 100644 --- a/src/fish_ai/engine.py +++ b/src/fish_ai/engine.py @@ -109,17 +109,16 @@ def get_system_prompt(): def get_config(key): - if config.has_section('fish-ai'): - active_section = config.get(section='fish-ai', option='configuration') - else: + if not config.has_section('fish-ai'): # There is no configuration file or the user made a mistake. # Just return 'None' here to simplify testing. return None - if key not in config[active_section]: - return None + active_section = config.get( + section='fish-ai', option='configuration') or 'fish-ai' - return config.get(section=active_section, option=key) + return config.get(section=active_section, option=key) or config.get( + section='fish-ai', option=key) def get_openai_client():