mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2026-02-02 15:45:11 +01:00
chore: quick return for empty runtime key
This commit is contained in:
parent
d1b42d1c59
commit
e15ff2d2b4
2 changed files with 8 additions and 3 deletions
|
|
@ -185,7 +185,7 @@ If it's useful to you, **please share this project and spread the word**. Also c
|
|||
|
||||
> Configuration is done via environment variables:
|
||||
>
|
||||
> - `_PR_AI_API_KEY`: You own API key
|
||||
> - `_PR_AI_API_KEY`: You own API key. Set it to an empty value disables AI integration
|
||||
> - `_PR_AI_URL`: URL used. Defaults to `https://api.groq.com/openai/v1/chat/completions`
|
||||
> - `_PR_AI_MODEL`: Model used. Defaults to `llama3-8b-8192`
|
||||
>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,12 @@ pub fn ai_suggestion(last_command: &str, error_msg: &str) -> Option<AISuggest> {
|
|||
};
|
||||
|
||||
let api_key = match api_key {
|
||||
Some(key) => key,
|
||||
Some(key) => {
|
||||
if key.is_empty() {
|
||||
return None;
|
||||
}
|
||||
key
|
||||
}
|
||||
None => {
|
||||
return None;
|
||||
}
|
||||
|
|
@ -81,7 +86,7 @@ You run the command `{last_command}` and get the following error message: `{erro
|
|||
```
|
||||
{{"command":"your suggestion","note":"why you think this command will fix the error"}}
|
||||
```
|
||||
{set_locale}If you don't know the answer or can't provide a good suggestion, please reply the command field with `None` and a explanation in note
|
||||
{set_locale}If you can't provide a good suggestion, please reply the command field with `None` and a explanation in note
|
||||
"#
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue