Skip to content

Commit 920ec41

Browse files
committed
Implement models as an enumeration.
This allows users to select from a known list of models. Relate #14.
1 parent 04ca46a commit 920ec41

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/settings.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@ def register_model_settings(self) -> bool:
4444
'title': 'OpenAI Model',
4545
'type': 'string',
4646
'description': 'The OpenAI model used to generate the response.',
47+
# https://beta.openai.com/docs/models
48+
'enum': [
49+
'text-davinci-003',
50+
'text-curie-001',
51+
'text-babbage-001',
52+
'text-babbage-002',
53+
'code-davinci-002',
54+
'code-cushman-001'
55+
],
56+
'enumDescriptions': [
57+
'Most capable GPT-3 model. Can do any task the other models can do, often with higher quality, longer output and better instruction-following. Also supports inserting completions within text.',
58+
'Very capable, but faster and lower cost than Davinci.',
59+
'Capable of straightforward tasks, very fast, and lower cost.',
60+
'Capable of very simple tasks, usually the fastest model in the GPT-3 series, and lowest cost.',
61+
'Most capable Codex model. Particularly good at translating natural language to code. In addition to completing code, also supports inserting completions within code.',
62+
'Almost as capable as Davinci Codex, but slightly faster. This speed advantage may make it preferable for real-time applications.'
63+
],
4764
'default': 'text-davinci-003'
4865
}
4966
return self.register_setting('openai.model', json.dumps(properties))

0 commit comments

Comments
 (0)