provider(openai): add ability to customize the row title

This commit is contained in:
0xMRTT 2023-05-05 10:03:23 +02:00
parent 1aef1494f6
commit b5d762b6e6
Signed by: 0xMRTT
GPG Key ID: 19C1449A774028BD
2 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,7 @@ class BaseOpenAIProvider(BavarderProvider):
slug = None
model = None
version = "0.1.0"
api_key_title = "API Key"
def __init__(self, win, app, *args, **kwargs):
super().__init__(win, app, *args, **kwargs)
@ -58,7 +59,7 @@ class BaseOpenAIProvider(BavarderProvider):
self.api_row = Adw.PasswordEntryRow()
self.api_row.connect("apply", self.on_apply)
self.api_row.props.title = "API Key"
self.api_row.props.title = self.api_key_title
self.api_row.set_show_apply_button(True)
self.expander.add_row(self.api_row)

View File

@ -5,3 +5,4 @@ class OpenAIGPT4Provider(BaseOpenAIProvider):
name = "OpenAI GPT 4"
slug = "openaigpt4"
model = "gpt-4"
api_key_title = "API Key (Require a plan with access to the GPT-4 model)"