From 587261ef127dfe9530f234e0b49c629d996858ca Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 Jun 2023 13:14:55 -0700 Subject: [PATCH] added adier/models.py --- aider/models.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 aider/models.py diff --git a/aider/models.py b/aider/models.py new file mode 100644 index 000000000..82839f946 --- /dev/null +++ b/aider/models.py @@ -0,0 +1,36 @@ +class Model_GPT4_32k: + name = "gpt-4-32k" + max_context_tokens = 32 * 1024 + + +GPT4_32k = Model_GPT4_32k() + + +class Model_GPT4: + name = "gpt-4" + max_context_tokens = 8 * 1024 + + +GPT4 = Model_GPT4() + + +class Model_GPT35: + name = "gpt-3.5-turbo" + max_context_tokens = 4 * 1024 + + +GPT35 = Model_GPT35() + + +def get_model(name): + models = [ + GPT4_32k, + GPT4, + GPT35, + ] + + for model in models: + if model.name == name: + return model + + raise ValueError(f"Unsupported model: {name}")