provider(openai): add ability to customize the row title
This commit is contained in:
parent
1aef1494f6
commit
b5d762b6e6
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)"
|
Loading…
Reference in a new issue