@@ -121,33 +121,33 @@ public PromptResult chatCompletion(String sessionId, String text, String provide
121121 * {@code ensureSession} 保证 session 存在(不存在则创建)。
122122 * 建议用 {@link io.github.hiwepy.opencode.api.OpenCodeSessionKeys} 生成 sessionKey。</p>
123123 *
124- * @param sessionKey 会话复用 key
125124 * @param request prompt 请求
125+ * @param sessionKey 会话复用 key
126126 * @return AI 响应
127127 */
128- public PromptResult chatCompletionWithSession (String sessionKey , PromptRequest request ) {
129- return httpClient .chatCompletionWithSession (sessionKey , request );
128+ public PromptResult chatCompletionWithSession (PromptRequest request , String sessionKey ) {
129+ return httpClient .chatCompletionWithSession (request , sessionKey );
130130 }
131131
132132 /**
133133 * 按 sessionKey 发送纯文本消息并同步等待 AI 响应。
134134 */
135- public PromptResult chatCompletionWithSession (String sessionKey , String text ) {
136- return httpClient .chatCompletionWithSession (sessionKey , PromptRequest .ofText (text ));
135+ public PromptResult chatCompletionWithSession (String text , String sessionKey ) {
136+ return httpClient .chatCompletionWithSession (PromptRequest .ofText (text ), sessionKey );
137137 }
138138
139139 /**
140140 * 按 sessionKey 发送纯文本消息并指定模型。
141141 */
142- public PromptResult chatCompletionWithSession (String sessionKey , String text , String providerID , String modelID ) {
143- return httpClient .chatCompletionWithSession (sessionKey , PromptRequest .ofText (text , providerID , modelID ));
142+ public PromptResult chatCompletionWithSession (String text , String providerID , String modelID , String sessionKey ) {
143+ return httpClient .chatCompletionWithSession (PromptRequest .ofText (text , providerID , modelID ), sessionKey );
144144 }
145145
146146 /**
147147 * 按 sessionKey 异步发送消息,不等待响应。
148148 */
149- public boolean chatCompletionWithSessionAsync (String sessionKey , PromptRequest request ) {
150- return httpClient .chatCompletionWithSessionAsync (sessionKey , request );
149+ public boolean chatCompletionWithSessionAsync (PromptRequest request , String sessionKey ) {
150+ return httpClient .chatCompletionWithSessionAsync (request , sessionKey );
151151 }
152152
153153 /**
0 commit comments