File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed
gpt_researcher/llm_provider/generic Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,20 @@ def create_agent(self):
31
31
cfg = Config ()
32
32
33
33
# Retrieve LLM using get_llm with settings from config
34
- provider = get_llm (
35
- llm_provider = cfg .smart_llm_provider ,
36
- model = cfg .smart_llm_model ,
37
- temperature = 0.35 ,
38
- max_tokens = cfg .smart_token_limit ,
39
- ** self .config .llm_kwargs
40
- ).llm
34
+ # Avoid passing temperature for models that do not support it
35
+ from gpt_researcher .llm_provider .generic .base import NO_SUPPORT_TEMPERATURE_MODELS
36
+
37
+ llm_init_kwargs = {
38
+ "llm_provider" : cfg .smart_llm_provider ,
39
+ "model" : cfg .smart_llm_model ,
40
+ ** self .config .llm_kwargs ,
41
+ }
42
+
43
+ if cfg .smart_llm_model not in NO_SUPPORT_TEMPERATURE_MODELS :
44
+ llm_init_kwargs ["temperature" ] = 0.35
45
+ llm_init_kwargs ["max_tokens" ] = cfg .smart_token_limit
46
+
47
+ provider = get_llm (** llm_init_kwargs ).llm
41
48
42
49
# If vector_store is not initialized, process documents and add to vector_store
43
50
if not self .vector_store :
Original file line number Diff line number Diff line change 47
47
"o3-2025-04-16" ,
48
48
"o4-mini" ,
49
49
"o4-mini-2025-04-16" ,
50
+ # GPT-5 family: OpenAI enforces default temperature only
51
+ "gpt-5" ,
52
+ "gpt-5-mini" ,
50
53
]
51
54
52
55
SUPPORT_REASONING_EFFORT_MODELS = [
You can’t perform that action at this time.
0 commit comments