Skip to content

Commit 652ff8d

Browse files
committed
Support openai/gpt-5.2 and github-copilot/gpt-5.2 by default.
1 parent fad7b6f commit 652ff8d

File tree

6 files changed

+172
-162
lines changed

6 files changed

+172
-162
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Support `openai/gpt-5.2` and `github-copilot/gpt-5.2` by default.
6+
57
## 0.85.2
68

79
- Support `providers <provider> httpClient version` config, allowing to use http-1.1 for some providers like lmstudio. #229

integration-test/integration/chat/openai_test.clj

Lines changed: 159 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -10,181 +10,181 @@
1010

1111
(eca/clean-after-test)
1212

13-
;; (deftest simple-text
14-
;; (eca/start-process!)
13+
(deftest simple-text
14+
(eca/start-process!)
1515

16-
;; (eca/request! (fixture/initialize-request))
17-
;; (eca/notify! (fixture/initialized-notification))
18-
;; (let [chat-id* (atom nil)]
19-
;; (testing "We send a simple hello message"
20-
;; (llm.mocks/set-case! :simple-text-0)
21-
;; (let [resp (eca/request! (fixture/chat-prompt-request
22-
;; {:model "openai/gpt-4.1"
23-
;; :message "Tell me a joke!"}))
24-
;; chat-id (reset! chat-id* (:chatId resp))]
16+
(eca/request! (fixture/initialize-request))
17+
(eca/notify! (fixture/initialized-notification))
18+
(let [chat-id* (atom nil)]
19+
(testing "We send a simple hello message"
20+
(llm.mocks/set-case! :simple-text-0)
21+
(let [resp (eca/request! (fixture/chat-prompt-request
22+
{:model "openai/gpt-4.1"
23+
:message "Tell me a joke!"}))
24+
chat-id (reset! chat-id* (:chatId resp))]
2525

26-
;; (is (match?
27-
;; {:chatId (m/pred string?)
28-
;; :model "openai/gpt-4.1"
29-
;; :status "prompting"}
30-
;; resp))
26+
(is (match?
27+
{:chatId (m/pred string?)
28+
:model "openai/gpt-4.1"
29+
:status "prompting"}
30+
resp))
3131

32-
;; (match-content chat-id "user" {:type "text" :text "Tell me a joke!\n"})
33-
;; (match-content chat-id "system" {:type "metadata" :title "Some Cool Title"})
34-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
35-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
36-
;; (match-content chat-id "assistant" {:type "text" :text "Knock"})
37-
;; (match-content chat-id "assistant" {:type "text" :text " knock!"})
38-
;; (match-content chat-id "system" {:type "usage"
39-
;; :sessionTokens 30
40-
;; :lastMessageCost (m/pred string?)
41-
;; :sessionCost (m/pred string?)})
42-
;; (match-content chat-id "system" {:type "progress" :state "finished"})
43-
;; (is (match?
44-
;; {:input [{:role "user" :content [{:type "input_text" :text "Tell me a joke!"}]}]
45-
;; :instructions (m/pred string?)}
46-
;; (llm.mocks/get-req-body :simple-text-0)))))
32+
(match-content chat-id "user" {:type "text" :text "Tell me a joke!\n"})
33+
(match-content chat-id "system" {:type "metadata" :title "Some Cool Title"})
34+
(match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
35+
(match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
36+
(match-content chat-id "assistant" {:type "text" :text "Knock"})
37+
(match-content chat-id "assistant" {:type "text" :text " knock!"})
38+
(match-content chat-id "system" {:type "usage"
39+
:sessionTokens 30
40+
:lastMessageCost (m/pred string?)
41+
:sessionCost (m/pred string?)})
42+
(match-content chat-id "system" {:type "progress" :state "finished"})
43+
(is (match?
44+
{:input [{:role "user" :content [{:type "input_text" :text "Tell me a joke!"}]}]
45+
:instructions (m/pred string?)}
46+
(llm.mocks/get-req-body :simple-text-0)))))
4747

48-
;; (testing "We reply"
49-
;; (llm.mocks/set-case! :simple-text-1)
50-
;; (let [resp (eca/request! (fixture/chat-prompt-request
51-
;; {:chat-id @chat-id*
52-
;; :model "openai/gpt-4.1"
53-
;; :message "Who's there?"}))
54-
;; chat-id @chat-id*]
48+
(testing "We reply"
49+
(llm.mocks/set-case! :simple-text-1)
50+
(let [resp (eca/request! (fixture/chat-prompt-request
51+
{:chat-id @chat-id*
52+
:model "openai/gpt-4.1"
53+
:message "Who's there?"}))
54+
chat-id @chat-id*]
5555

56-
;; (is (match?
57-
;; {:chatId (m/pred string?)
58-
;; :model "openai/gpt-4.1"
59-
;; :status "prompting"}
60-
;; resp))
56+
(is (match?
57+
{:chatId (m/pred string?)
58+
:model "openai/gpt-4.1"
59+
:status "prompting"}
60+
resp))
6161

62-
;; (match-content chat-id "user" {:type "text" :text "Who's there?\n"})
63-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
64-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
65-
;; (match-content chat-id "assistant" {:type "text" :text "Foo"})
66-
;; (match-content chat-id "system" {:type "usage"
67-
;; :sessionTokens 15
68-
;; :lastMessageCost (m/pred string?)
69-
;; :sessionCost (m/pred string?)})
70-
;; (match-content chat-id "system" {:type "progress" :state "finished"})
71-
;; (is (match?
72-
;; {:input [{:role "user" :content [{:type "input_text" :text "Tell me a joke!"}]}
73-
;; {:role "assistant" :content [{:type "output_text" :text "Knock knock!"}]}
74-
;; {:role "user" :content [{:type "input_text" :text "Who's there?"}]}]}
75-
;; (llm.mocks/get-req-body :simple-text-1)))))
62+
(match-content chat-id "user" {:type "text" :text "Who's there?\n"})
63+
(match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
64+
(match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
65+
(match-content chat-id "assistant" {:type "text" :text "Foo"})
66+
(match-content chat-id "system" {:type "usage"
67+
:sessionTokens 15
68+
:lastMessageCost (m/pred string?)
69+
:sessionCost (m/pred string?)})
70+
(match-content chat-id "system" {:type "progress" :state "finished"})
71+
(is (match?
72+
{:input [{:role "user" :content [{:type "input_text" :text "Tell me a joke!"}]}
73+
{:role "assistant" :content [{:type "output_text" :text "Knock knock!"}]}
74+
{:role "user" :content [{:type "input_text" :text "Who's there?"}]}]}
75+
(llm.mocks/get-req-body :simple-text-1)))))
7676

77-
;; (testing "model reply again keeping context"
78-
;; (llm.mocks/set-case! :simple-text-2)
79-
;; (let [resp (eca/request! (fixture/chat-prompt-request
80-
;; {:chat-id @chat-id*
81-
;; :model "openai/gpt-4.1"
82-
;; :message "What foo?"}))
83-
;; chat-id @chat-id*]
77+
(testing "model reply again keeping context"
78+
(llm.mocks/set-case! :simple-text-2)
79+
(let [resp (eca/request! (fixture/chat-prompt-request
80+
{:chat-id @chat-id*
81+
:model "openai/gpt-4.1"
82+
:message "What foo?"}))
83+
chat-id @chat-id*]
8484

85-
;; (is (match?
86-
;; {:chatId (m/pred string?)
87-
;; :model "openai/gpt-4.1"
88-
;; :status "prompting"}
89-
;; resp))
85+
(is (match?
86+
{:chatId (m/pred string?)
87+
:model "openai/gpt-4.1"
88+
:status "prompting"}
89+
resp))
9090

91-
;; (match-content chat-id "user" {:type "text" :text "What foo?\n"})
92-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
93-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
94-
;; (match-content chat-id "assistant" {:type "text" :text "Foo"})
95-
;; (match-content chat-id "assistant" {:type "text" :text " bar!"})
96-
;; (match-content chat-id "assistant" {:type "text" :text "\n\n"})
97-
;; (match-content chat-id "assistant" {:type "text" :text "Ha!"})
98-
;; (match-content chat-id "system" {:type "usage"
99-
;; :sessionTokens 20
100-
;; :lastMessageCost (m/pred string?)
101-
;; :sessionCost (m/pred string?)})
102-
;; (match-content chat-id "system" {:type "progress" :state "finished"})
103-
;; (is (match?
104-
;; {:input [{:role "user" :content [{:type "input_text" :text "Tell me a joke!"}]}
105-
;; {:role "assistant" :content [{:type "output_text" :text "Knock knock!"}]}
106-
;; {:role "user" :content [{:type "input_text" :text "Who's there?"}]}
107-
;; {:role "assistant" :content [{:type "output_text" :text "Foo"}]}
108-
;; {:role "user" :content [{:type "input_text" :text "What foo?"}]}]}
109-
;; (llm.mocks/get-req-body :simple-text-2)))))))
91+
(match-content chat-id "user" {:type "text" :text "What foo?\n"})
92+
(match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
93+
(match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
94+
(match-content chat-id "assistant" {:type "text" :text "Foo"})
95+
(match-content chat-id "assistant" {:type "text" :text " bar!"})
96+
(match-content chat-id "assistant" {:type "text" :text "\n\n"})
97+
(match-content chat-id "assistant" {:type "text" :text "Ha!"})
98+
(match-content chat-id "system" {:type "usage"
99+
:sessionTokens 20
100+
:lastMessageCost (m/pred string?)
101+
:sessionCost (m/pred string?)})
102+
(match-content chat-id "system" {:type "progress" :state "finished"})
103+
(is (match?
104+
{:input [{:role "user" :content [{:type "input_text" :text "Tell me a joke!"}]}
105+
{:role "assistant" :content [{:type "output_text" :text "Knock knock!"}]}
106+
{:role "user" :content [{:type "input_text" :text "Who's there?"}]}
107+
{:role "assistant" :content [{:type "output_text" :text "Foo"}]}
108+
{:role "user" :content [{:type "input_text" :text "What foo?"}]}]}
109+
(llm.mocks/get-req-body :simple-text-2)))))))
110110

111-
;; (deftest reasoning-text
112-
;; (eca/start-process!)
111+
(deftest reasoning-text
112+
(eca/start-process!)
113113

114-
;; (eca/request! (fixture/initialize-request))
115-
;; (eca/notify! (fixture/initialized-notification))
116-
;; (let [chat-id* (atom nil)]
117-
;; (testing "We send a hello message"
118-
;; (llm.mocks/set-case! :reasoning-0)
119-
;; (let [resp (eca/request! (fixture/chat-prompt-request
120-
;; {:model "openai/gpt-5"
121-
;; :message "hello!"}))
122-
;; chat-id (reset! chat-id* (:chatId resp))]
114+
(eca/request! (fixture/initialize-request))
115+
(eca/notify! (fixture/initialized-notification))
116+
(let [chat-id* (atom nil)]
117+
(testing "We send a hello message"
118+
(llm.mocks/set-case! :reasoning-0)
119+
(let [resp (eca/request! (fixture/chat-prompt-request
120+
{:model "openai/gpt-5"
121+
:message "hello!"}))
122+
chat-id (reset! chat-id* (:chatId resp))]
123123

124-
;; (is (match?
125-
;; {:chatId (m/pred string?)
126-
;; :model "openai/gpt-5"
127-
;; :status "prompting"}
128-
;; resp))
124+
(is (match?
125+
{:chatId (m/pred string?)
126+
:model "openai/gpt-5"
127+
:status "prompting"}
128+
resp))
129129

130-
;; (match-content chat-id "user" {:type "text" :text "hello!\n"})
131-
;; (match-content chat-id "system" {:type "metadata" :title "Some Cool Title"})
132-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
133-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
134-
;; (match-content chat-id "assistant" {:type "reasonStarted" :id "123"})
135-
;; (match-content chat-id "assistant" {:type "reasonText" :id "123" :text "I should say"})
136-
;; (match-content chat-id "assistant" {:type "reasonText" :id "123" :text " hello"})
137-
;; (match-content chat-id "assistant" {:type "reasonFinished" :id "123" :totalTimeMs (m/pred number?)})
138-
;; (match-content chat-id "assistant" {:type "text" :text "hello"})
139-
;; (match-content chat-id "assistant" {:type "text" :text " there!"})
140-
;; (match-content chat-id "system" {:type "usage"
141-
;; :sessionTokens 35
142-
;; :lastMessageCost (m/pred string?)
143-
;; :sessionCost (m/pred string?)})
144-
;; (match-content chat-id "system" {:type "progress" :state "finished"})
145-
;; (is (match?
146-
;; {:input [{:role "user" :content [{:type "input_text" :text "hello!"}]}]
147-
;; :instructions (m/pred string?)}
148-
;; (llm.mocks/get-req-body :reasoning-0)))))
130+
(match-content chat-id "user" {:type "text" :text "hello!\n"})
131+
(match-content chat-id "system" {:type "metadata" :title "Some Cool Title"})
132+
(match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
133+
(match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
134+
(match-content chat-id "assistant" {:type "reasonStarted" :id "123"})
135+
(match-content chat-id "assistant" {:type "reasonText" :id "123" :text "I should say"})
136+
(match-content chat-id "assistant" {:type "reasonText" :id "123" :text " hello"})
137+
(match-content chat-id "assistant" {:type "reasonFinished" :id "123" :totalTimeMs (m/pred number?)})
138+
(match-content chat-id "assistant" {:type "text" :text "hello"})
139+
(match-content chat-id "assistant" {:type "text" :text " there!"})
140+
(match-content chat-id "system" {:type "usage"
141+
:sessionTokens 35
142+
:lastMessageCost (m/pred string?)
143+
:sessionCost (m/pred string?)})
144+
(match-content chat-id "system" {:type "progress" :state "finished"})
145+
(is (match?
146+
{:input [{:role "user" :content [{:type "input_text" :text "hello!"}]}]
147+
:instructions (m/pred string?)}
148+
(llm.mocks/get-req-body :reasoning-0)))))
149149

150-
;; (testing "We reply"
151-
;; (llm.mocks/set-case! :reasoning-1)
152-
;; (let [resp (eca/request! (fixture/chat-prompt-request
153-
;; {:chat-id @chat-id*
154-
;; :model "openai/gpt-5"
155-
;; :message "how are you?"}))
156-
;; chat-id @chat-id*]
150+
(testing "We reply"
151+
(llm.mocks/set-case! :reasoning-1)
152+
(let [resp (eca/request! (fixture/chat-prompt-request
153+
{:chat-id @chat-id*
154+
:model "openai/gpt-5"
155+
:message "how are you?"}))
156+
chat-id @chat-id*]
157157

158-
;; (is (match?
159-
;; {:chatId (m/pred string?)
160-
;; :model "openai/gpt-5"
161-
;; :status "prompting"}
162-
;; resp))
158+
(is (match?
159+
{:chatId (m/pred string?)
160+
:model "openai/gpt-5"
161+
:status "prompting"}
162+
resp))
163163

164-
;; (match-content chat-id "user" {:type "text" :text "how are you?\n"})
165-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
166-
;; (match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
167-
;; (match-content chat-id "assistant" {:type "reasonStarted" :id "234"})
168-
;; (match-content chat-id "assistant" {:type "reasonText" :id "234" :text "I should say"})
169-
;; (match-content chat-id "assistant" {:type "reasonText" :id "234" :text " fine"})
170-
;; (match-content chat-id "assistant" {:type "reasonFinished" :id "234" :totalTimeMs (m/pred number?)})
171-
;; (match-content chat-id "assistant" {:type "text" :text "I'm "})
172-
;; (match-content chat-id "assistant" {:type "text" :text " fine"})
173-
;; (match-content chat-id "system" {:type "usage"
174-
;; :sessionTokens 30
175-
;; :lastMessageCost (m/pred string?)
176-
;; :sessionCost (m/pred string?)})
177-
;; (match-content chat-id "system" {:type "progress" :state "finished"})
178-
;; (is (match?
179-
;; {:input [{:role "user" :content [{:type "input_text" :text "hello!"}]}
180-
;; {:type "reasoning"
181-
;; :id "123"
182-
;; :summary [{:type "summary_text" :text "I should say hello"}]
183-
;; :encrypted_content "enc-123"}
184-
;; {:role "assistant" :content [{:type "output_text" :text "hello there!"}]}
185-
;; {:role "user" :content [{:type "input_text" :text "how are you?"}]}]
186-
;; :instructions (m/pred string?)}
187-
;; (llm.mocks/get-req-body :reasoning-1)))))))
164+
(match-content chat-id "user" {:type "text" :text "how are you?\n"})
165+
(match-content chat-id "system" {:type "progress" :state "running" :text "Waiting model"})
166+
(match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
167+
(match-content chat-id "assistant" {:type "reasonStarted" :id "234"})
168+
(match-content chat-id "assistant" {:type "reasonText" :id "234" :text "I should say"})
169+
(match-content chat-id "assistant" {:type "reasonText" :id "234" :text " fine"})
170+
(match-content chat-id "assistant" {:type "reasonFinished" :id "234" :totalTimeMs (m/pred number?)})
171+
(match-content chat-id "assistant" {:type "text" :text "I'm "})
172+
(match-content chat-id "assistant" {:type "text" :text " fine"})
173+
(match-content chat-id "system" {:type "usage"
174+
:sessionTokens 30
175+
:lastMessageCost (m/pred string?)
176+
:sessionCost (m/pred string?)})
177+
(match-content chat-id "system" {:type "progress" :state "finished"})
178+
(is (match?
179+
{:input [{:role "user" :content [{:type "input_text" :text "hello!"}]}
180+
{:type "reasoning"
181+
:id "123"
182+
:summary [{:type "summary_text" :text "I should say hello"}]
183+
:encrypted_content "enc-123"}
184+
{:role "assistant" :content [{:type "output_text" :text "hello there!"}]}
185+
{:role "user" :content [{:type "input_text" :text "how are you?"}]}]
186+
:instructions (m/pred string?)}
187+
(llm.mocks/get-req-body :reasoning-1)))))))
188188

189189
(deftest tool-calling
190190
(eca/start-process!)

0 commit comments

Comments
 (0)