@@ -19,97 +19,97 @@ trait Input
19
19
sealed trait Inputs
20
20
21
21
object Inputs {
22
- case class Text (text : String ) extends Inputs
22
+ case class Text (text : String ) extends Inputs
23
23
24
- case class Items (items : Input * ) extends Inputs
24
+ case class Items (items : Input * ) extends Inputs
25
25
}
26
26
27
27
// shortcuts for creating Inputs
28
28
object Input {
29
29
30
- def ofInputTextMessage (
31
- content : String ,
32
- role : ChatRole
33
- ) = Message .InputText (content, role)
34
-
35
- def ofInputSystemTextMessage (
36
- content : String
37
- ) = Message .System (content)
38
-
39
- def ofInputDeveloperTextMessage (
40
- content : String
41
- ) = Message .Developer (content)
42
-
43
- def ofInputUserTextMessage (
44
- content : String
45
- ) = Message .User (content)
46
-
47
- def ofInputAssistantTextMessage (
48
- content : String
49
- ) = Message .Assistant (content)
50
-
51
- def ofInputMessage (
52
- content : Seq [InputMessageContent ],
53
- role : ChatRole ,
54
- status : Option [ModelStatus ] = None
55
- ) = Message .InputContent (content, role, status)
56
-
57
- def ofOutputMessage (
58
- content : Seq [OutputMessageContent ],
59
- id : String ,
60
- status : ModelStatus
61
- ) = Message .OutputContent (content, id, status)
62
-
63
- def ofFileSearchToolCall (
64
- id : String ,
65
- queries : Seq [String ] = Nil ,
66
- status : ModelStatus ,
67
- results : Seq [tools.FileSearchResult ] = Nil
68
- ) = tools.FileSearchToolCall (id, queries, status, results)
69
-
70
- def ofComputerToolCall (
71
- action : tools.ComputerToolAction ,
72
- callId : String ,
73
- id : String ,
74
- pendingSafetyChecks : Seq [tools.PendingSafetyCheck ] = Nil ,
75
- status : ModelStatus
76
- ) = tools.ComputerToolCall (action, callId, id, pendingSafetyChecks, status)
77
-
78
- def ofComputerToolCallOutput (
79
- callId : String ,
80
- output : tools.ComputerScreenshot ,
81
- acknowledgedSafetyChecks : Seq [tools.AcknowledgedSafetyCheck ] = Nil ,
82
- id : Option [String ] = None ,
83
- status : Option [ModelStatus ] = None
84
- ) = tools.ComputerToolCallOutput (callId, output, acknowledgedSafetyChecks, id, status)
85
-
86
- def ofWebSearchToolCall (
87
- id : String ,
88
- status : ModelStatus
89
- ) = tools.WebSearchToolCall (id, status)
90
-
91
- def ofFunctionToolCall (
92
- arguments : String ,
93
- callId : String ,
94
- name : String ,
95
- id : Option [String ] = None ,
96
- status : Option [ModelStatus ] = None
97
- ) = tools.FunctionToolCall (arguments, callId, name, id, status)
98
-
99
- def ofFunctionToolCallOutput (
100
- callId : String ,
101
- output : String ,
102
- id : Option [String ] = None ,
103
- status : Option [ModelStatus ] = None
104
- ) = tools.FunctionToolCallOutput (callId, output, id, status)
105
-
106
- def ofReasoning (
107
- id : String ,
108
- summary : Seq [ReasoningText ],
109
- status : Option [ModelStatus ] = None
110
- ) = Reasoning (id, summary, status)
111
-
112
- def ofItemReference (
113
- id : String
114
- ) = ItemReference (id)
30
+ def ofInputTextMessage (
31
+ content : String ,
32
+ role : ChatRole
33
+ ) = Message .InputText (content, role)
34
+
35
+ def ofInputSystemTextMessage (
36
+ content : String
37
+ ) = Message .System (content)
38
+
39
+ def ofInputDeveloperTextMessage (
40
+ content : String
41
+ ) = Message .Developer (content)
42
+
43
+ def ofInputUserTextMessage (
44
+ content : String
45
+ ) = Message .User (content)
46
+
47
+ def ofInputAssistantTextMessage (
48
+ content : String
49
+ ) = Message .Assistant (content)
50
+
51
+ def ofInputMessage (
52
+ content : Seq [InputMessageContent ],
53
+ role : ChatRole ,
54
+ status : Option [ModelStatus ] = None
55
+ ) = Message .InputContent (content, role, status)
56
+
57
+ def ofOutputMessage (
58
+ content : Seq [OutputMessageContent ],
59
+ id : String ,
60
+ status : ModelStatus
61
+ ) = Message .OutputContent (content, id, status)
62
+
63
+ def ofFileSearchToolCall (
64
+ id : String ,
65
+ queries : Seq [String ] = Nil ,
66
+ status : ModelStatus ,
67
+ results : Seq [tools.FileSearchResult ] = Nil
68
+ ) = tools.FileSearchToolCall (id, queries, status, results)
69
+
70
+ def ofComputerToolCall (
71
+ action : tools.ComputerToolAction ,
72
+ callId : String ,
73
+ id : String ,
74
+ pendingSafetyChecks : Seq [tools.PendingSafetyCheck ] = Nil ,
75
+ status : ModelStatus
76
+ ) = tools.ComputerToolCall (action, callId, id, pendingSafetyChecks, status)
77
+
78
+ def ofComputerToolCallOutput (
79
+ callId : String ,
80
+ output : tools.ComputerScreenshot ,
81
+ acknowledgedSafetyChecks : Seq [tools.AcknowledgedSafetyCheck ] = Nil ,
82
+ id : Option [String ] = None ,
83
+ status : Option [ModelStatus ] = None
84
+ ) = tools.ComputerToolCallOutput (callId, output, acknowledgedSafetyChecks, id, status)
85
+
86
+ def ofWebSearchToolCall (
87
+ id : String ,
88
+ status : ModelStatus
89
+ ) = tools.WebSearchToolCall (id, status)
90
+
91
+ def ofFunctionToolCall (
92
+ arguments : String ,
93
+ callId : String ,
94
+ name : String ,
95
+ id : Option [String ] = None ,
96
+ status : Option [ModelStatus ] = None
97
+ ) = tools.FunctionToolCall (arguments, callId, name, id, status)
98
+
99
+ def ofFunctionToolCallOutput (
100
+ callId : String ,
101
+ output : String ,
102
+ id : Option [String ] = None ,
103
+ status : Option [ModelStatus ] = None
104
+ ) = tools.FunctionToolCallOutput (callId, output, id, status)
105
+
106
+ def ofReasoning (
107
+ id : String ,
108
+ summary : Seq [ReasoningText ],
109
+ status : Option [ModelStatus ] = None
110
+ ) = Reasoning (id, summary, status)
111
+
112
+ def ofItemReference (
113
+ id : String
114
+ ) = ItemReference (id)
115
115
}
0 commit comments