@@ -112,7 +112,7 @@ export class SseHttpQuery extends SseHttpTmpQuery {
112
112
const processedParams = this . processParameters ( params , props ) ;
113
113
114
114
// Build request from processed parameters
115
- const { url, headers, method, body } = this . buildRequestFromParams ( processedParams ) ;
115
+ const { url, headers, method, body } = this . buildRequestFromParams ( processedParams , props . args ) ;
116
116
117
117
// Execute streaming logic
118
118
if ( method === "GET" ) {
@@ -151,41 +151,23 @@ export class SseHttpQuery extends SseHttpTmpQuery {
151
151
] ;
152
152
}
153
153
154
- private buildRequestFromParams ( processedParams : Array < { key : string , value : any } > ) {
155
- debugger ;
156
- const paramMap = new Map ( processedParams . map ( p => [ p . key , p . value ] ) ) ;
157
-
158
- // Extract URL
159
- const baseUrl = paramMap . get ( 'path' ) || '' ;
160
- const url = new URL ( baseUrl ) ;
161
-
162
- // Add query parameters
163
- Object . entries ( paramMap ) . forEach ( ( [ key , value ] ) => {
164
- if ( key . startsWith ( 'params.' ) && key . endsWith ( '.value' ) ) {
165
- const paramName = key . replace ( 'params.' , '' ) . replace ( '.value' , '' ) ;
166
- if ( value ) url . searchParams . append ( paramName , String ( value ) ) ;
167
- }
168
- } ) ;
169
-
170
- // Build headers
171
- const headers : Record < string , string > = { } ;
172
- Object . entries ( paramMap ) . forEach ( ( [ key , value ] ) => {
173
- if ( key . startsWith ( 'headers.' ) && key . endsWith ( '.value' ) ) {
174
- const headerName = key . replace ( 'headers.' , '' ) . replace ( '.value' , '' ) ;
175
- if ( value ) headers [ headerName ] = String ( value ) ;
176
- }
154
+ private buildRequestFromParams ( processedParams : Array < { key : string , value : any } > , args : Record < string , unknown > = { } ) {
155
+ // Hardcoded values from the screenshot for testing
156
+ const url = "http://localhost:11434/api/generate" ;
157
+ const headers = {
158
+ "Content-Type" : "application/json" ,
159
+ "Accept" : "text/event-stream"
160
+ } ;
161
+ const method = "POST" ;
162
+ const body = JSON . stringify ( {
163
+ "model" : "gemma3" ,
164
+ "prompt" : "Tell me a short story about a robot" ,
165
+ "stream" : true
177
166
} ) ;
178
167
179
- // Get method and body
180
- const method = paramMap . get ( 'httpMethod' ) || 'GET' ;
181
- const bodyType = paramMap . get ( 'bodyType' ) ;
182
- let body : string | FormData | undefined ;
168
+ console . log ( "Hardcoded request:" , { url, headers, method, body } ) ;
183
169
184
- if ( bodyType === 'application/json' || bodyType === 'text/plain' ) {
185
- body = paramMap . get ( 'body' ) as string ;
186
- }
187
-
188
- return { url : url . toString ( ) , headers, method, body } ;
170
+ return { url, headers, method, body } ;
189
171
}
190
172
191
173
private async handleEventSource (
@@ -239,7 +221,6 @@ export class SseHttpQuery extends SseHttpTmpQuery {
239
221
headers : {
240
222
...headers ,
241
223
'Accept' : 'text/event-stream' ,
242
- 'Cache-Control' : 'no-cache' ,
243
224
} ,
244
225
body,
245
226
signal : this . controller . signal ,
0 commit comments