File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ - Support moonshot models via anthropic API.
6+
57## 0.97.4
68
79- Fix openai request when using non codex models but using openai subscription.
Original file line number Diff line number Diff line change 4646 (if (= data-str " [DONE]" )
4747 (recur event-line) ; skip [DONE]
4848 (let [event-type (if event-line
49- (subs event-line 7 )
49+ ; ; Handle both "event: foo" and "event:foo" formats
50+ (string/triml (subs event-line 6 ))
5051 (-> (json/parse-string data-str true )
5152 :type ))]
5253 (cons [event-type (json/parse-string data-str true )]
Original file line number Diff line number Diff line change 5454 (is (match?
5555 [[" foo.bar" {:type " foo.bar" }]
5656 [" foo.baz" {:type " foo.baz" }]]
57+ (llm-util/event-data-seq r)))))
58+ (testing " when no extra space after event: (moonshot/kimi format)"
59+ (with-open [r (io/reader (ByteArrayInputStream. (.getBytes (str " event:content_block_start\n "
60+ " data:{\" type\" :\" content_block_start\" ,\" index\" :0}\n "
61+ " \n "
62+ " event:content_block_delta\n "
63+ " data:{\" type\" :\" content_block_delta\" ,\" index\" :0}\n "
64+ " \n "
65+ " event:message_delta\n "
66+ " data:{\" type\" :\" message_delta\" }" ))))]
67+ (is (match?
68+ [[" content_block_start" {:type " content_block_start" :index 0 }]
69+ [" content_block_delta" {:type " content_block_delta" :index 0 }]
70+ [" message_delta" {:type " message_delta" }]]
5771 (llm-util/event-data-seq r))))))
5872
5973(deftest provider-api-key-with-key-rc-test
You can’t perform that action at this time.
0 commit comments