|
| 1 | +import { Reasoning } from 'openai/resources/shared'; |
1 | 2 | /**
|
2 | 3 | * Specifies how tools should be chosen by the model.
|
3 | 4 | * - 'auto': Model decides when to use tools
|
|
6 | 7 | */
|
7 | 8 | type ToolChoice = 'auto' | 'required' | 'none';
|
8 | 9 |
|
9 |
| -/** |
10 |
| - * Specifies the level of reasoning effort for o-series models. |
11 |
| - * - 'low': Minimal reasoning effort |
12 |
| - * - 'medium': Balanced reasoning effort |
13 |
| - * - 'high': Maximum reasoning effort |
14 |
| - */ |
15 |
| -type ReasoningEffort = 'low' | 'medium' | 'high'; |
16 |
| - |
17 |
| -/** |
18 |
| - * Specifies the type of reasoning summary for computer_use_preview. |
19 |
| - * - 'concise': Brief summary |
20 |
| - * - 'detailed': Comprehensive summary |
21 |
| - */ |
22 |
| -type ReasoningSummary = 'concise' | 'detailed'; |
23 |
| - |
24 |
| -/** |
25 |
| - * Configuration for model reasoning capabilities. |
26 |
| - */ |
27 |
| -interface Reasoning { |
28 |
| - /** |
29 |
| - * Constrains effort on reasoning for o-series models. |
30 |
| - * Reducing reasoning effort can result in faster responses and fewer tokens used. |
31 |
| - */ |
32 |
| - effort?: ReasoningEffort; |
33 |
| - |
34 |
| - /** |
35 |
| - * For computer_use_preview only. Generates a summary of the model's reasoning process. |
36 |
| - * Useful for debugging and understanding the model's decision making. |
37 |
| - */ |
38 |
| - generate_summary?: ReasoningSummary; |
39 |
| -} |
40 |
| - |
41 | 10 | /**
|
42 | 11 | * Settings to use when calling an LLM.
|
43 | 12 | *
|
@@ -102,24 +71,16 @@ export class ModelSettings {
|
102 | 71 | const changes: Partial<ModelSettings> = {};
|
103 | 72 |
|
104 | 73 | // Only copy non-undefined values from override
|
105 |
| - if (override.temperature !== undefined) |
106 |
| - changes.temperature = override.temperature; |
| 74 | + if (override.temperature !== undefined) changes.temperature = override.temperature; |
107 | 75 | if (override.top_p !== undefined) changes.top_p = override.top_p;
|
108 |
| - if (override.frequency_penalty !== undefined) |
109 |
| - changes.frequency_penalty = override.frequency_penalty; |
110 |
| - if (override.presence_penalty !== undefined) |
111 |
| - changes.presence_penalty = override.presence_penalty; |
112 |
| - if (override.tool_choice !== undefined) |
113 |
| - changes.tool_choice = override.tool_choice; |
114 |
| - if (override.parallel_tool_calls !== undefined) |
115 |
| - changes.parallel_tool_calls = override.parallel_tool_calls; |
116 |
| - if (override.max_tokens !== undefined) |
117 |
| - changes.max_tokens = override.max_tokens; |
| 76 | + if (override.frequency_penalty !== undefined) changes.frequency_penalty = override.frequency_penalty; |
| 77 | + if (override.presence_penalty !== undefined) changes.presence_penalty = override.presence_penalty; |
| 78 | + if (override.tool_choice !== undefined) changes.tool_choice = override.tool_choice; |
| 79 | + if (override.parallel_tool_calls !== undefined) changes.parallel_tool_calls = override.parallel_tool_calls; |
| 80 | + if (override.max_tokens !== undefined) changes.max_tokens = override.max_tokens; |
118 | 81 | if (override.store !== undefined) changes.store = override.store;
|
119 |
| - if (override.truncation !== undefined) |
120 |
| - changes.truncation = override.truncation; |
121 |
| - if (override.reasoning !== undefined) |
122 |
| - changes.reasoning = override.reasoning; |
| 82 | + if (override.truncation !== undefined) changes.truncation = override.truncation; |
| 83 | + if (override.reasoning !== undefined) changes.reasoning = override.reasoning; |
123 | 84 | if (override.metadata !== undefined) changes.metadata = override.metadata;
|
124 | 85 |
|
125 | 86 | return new ModelSettings({ ...this, ...changes });
|
|
0 commit comments