@@ -50,14 +50,6 @@ def __init__(self):
5050 # self.id = "openai_pipeline"
5151 self .name = "Bedrock: "
5252
53- self .valves = self .Valves (
54- ** {
55- "AWS_ACCESS_KEY" : os .getenv ("AWS_ACCESS_KEY" , "your-aws-access-key-here" ),
56- "AWS_SECRET_KEY" : os .getenv ("AWS_SECRET_KEY" , "your-aws-secret-key-here" ),
57- "AWS_REGION_NAME" : os .getenv ("AWS_REGION_NAME" , "your-aws-region-name-here" ),
58- }
59- )
60-
6153 self .valves = self .Valves (
6254 ** {
6355 "AWS_ACCESS_KEY" : os .getenv ("AWS_ACCESS_KEY" , "" ),
@@ -72,6 +64,13 @@ def __init__(self):
7264
7365 self .update_pipelines ()
7466
67+ def get_thinking_supported_models (self ):
68+ """Returns list of model identifiers that support extended thinking"""
69+ return [
70+ "claude-3-7" ,
71+ "claude-sonnet-4" ,
72+ "claude-opus-4"
73+ ]
7574
7675 async def on_startup (self ):
7776 # This function is called when the server is started.
@@ -183,13 +182,14 @@ def pipe(
183182 }
184183
185184 if body .get ("stream" , False ):
186- supports_thinking = "claude-3-7" in model_id
185+ supports_thinking = any ( model in model_id for model in self . get_thinking_supported_models ())
187186 reasoning_effort = body .get ("reasoning_effort" , "none" )
188187 budget_tokens = REASONING_EFFORT_BUDGET_TOKEN_MAP .get (reasoning_effort )
189188
190189 # Allow users to input an integer value representing budget tokens
191190 if (
192191 not budget_tokens
192+ and reasoning_effort is not None
193193 and reasoning_effort not in REASONING_EFFORT_BUDGET_TOKEN_MAP .keys ()
194194 ):
195195 try :
0 commit comments