From 0f09bd7fb3069ae23e9ca7170b5bedcff8e41a7a Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 17 Aug 2024 06:59:48 -0700 Subject: [PATCH] refactor: Refactor "anthropic-beta" header value to a constant --- aider/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aider/models.py b/aider/models.py index 589930109..92f7889bb 100644 --- a/aider/models.py +++ b/aider/models.py @@ -17,6 +17,7 @@ from aider.dump import dump # noqa: F401 from aider.llm import AIDER_APP_NAME, AIDER_SITE_URL, litellm DEFAULT_MODEL_NAME = "gpt-4o" +ANTHROPIC_BETA_HEADER = "max-tokens-3-5-sonnet-2024-07-15, prompt-caching-2024-07-31" OPENAI_MODELS = """ gpt-4 @@ -271,7 +272,7 @@ MODEL_SETTINGS = [ accepts_images=True, max_tokens=8192, extra_headers={ - "anthropic-beta": "max-tokens-3-5-sonnet-2024-07-15, prompt-caching-2024-07-31", + "anthropic-beta": ANTHROPIC_BETA_HEADER, }, ), ModelSettings( @@ -282,7 +283,7 @@ MODEL_SETTINGS = [ examples_as_sys_msg=True, max_tokens=8192, extra_headers={ - "anthropic-beta": "max-tokens-3-5-sonnet-2024-07-15, prompt-caching-2024-07-31", + "anthropic-beta": ANTHROPIC_BETA_HEADER, }, ), ModelSettings(