Skip to content

Commit 126d6fd

Browse files
committed
update max_chunks for testing
1 parent 2ce034a commit 126d6fd

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

backend/service/task_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ async def _handle_streaming_response(response, full_url: str) -> Dict:
931931
}
932932

933933
# For testing purposes, we limit the time and data we collect
934-
max_chunks = 50 # max chunks to collect for testing
934+
max_chunks = 200 # max chunks to collect for testing
935935
max_duration = 15 # max duration to wait for testing
936936

937937
start_time = asyncio.get_event_loop().time()

frontend/src/components/CreateJobForm.tsx

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,39 @@ const CreateJobFormContent: React.FC<CreateJobFormProps> = ({
338338
const handleTestAPI = async () => {
339339
try {
340340
setTesting(true);
341-
const values = await form.validateFields();
342341

343-
// Validate request payload for custom APIs
342+
// Only validate required fields for testing, not API Field Mapping fields
343+
const requiredFields = [
344+
'target_host',
345+
'api_path',
346+
'model',
347+
'duration',
348+
'concurrent_users',
349+
'stream_mode',
350+
];
351+
352+
// Get current api_path to determine API type
353+
const currentApiPath = form.getFieldValue('api_path');
354+
const isCurrentlyChatCompletions =
355+
!currentApiPath || currentApiPath === '/v1/chat/completions';
356+
357+
// Add chat_type validation for chat completions API
358+
if (isCurrentlyChatCompletions) {
359+
requiredFields.push('chat_type');
360+
}
361+
362+
// Add request_payload validation for custom APIs
363+
if (!isCurrentlyChatCompletions) {
364+
requiredFields.push('request_payload');
365+
}
366+
367+
// Validate only the required fields for testing
368+
await form.validateFields(requiredFields);
369+
370+
// Get all form values after validation
371+
const values = form.getFieldsValue();
372+
373+
// Additional validation for request payload JSON format (custom APIs only)
344374
if (
345375
values.api_path !== '/v1/chat/completions' &&
346376
!values.request_payload

st_engine/engine/locustfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,7 @@ def _handle_stream_request(
10021002
try:
10031003
# Process as streaming response
10041004
for chunk in response.iter_lines():
1005+
task_logger.info(f"Chunk: {chunk}")
10051006
error_msg = StreamProcessor.check_chunk_error(
10061007
chunk, field_mapping, task_logger
10071008
)

0 commit comments

Comments
 (0)