Skip to content

Commit f25073f

Browse files
authored
Merge pull request #800 from aakashreddy-p/aakash/fix/generate-mock-data-updateinstructions
fix: instruction updating for request body
2 parents 65b61df + 5914689 commit f25073f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/modules/workspace/services/ai-assistant.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,34 +2511,39 @@ export class AiAssistantService {
25112511
return `${base}
25122512
- Body type is raw JSON.
25132513
- Return ONLY valid JSON object or array content (no surrounding text).
2514+
- If existing Body type raw JSON are provided in the API details text, update their values with new realistic mock values.
25142515
- Generate realistic user/entity data with properties like: id, name, email, timestamps, etc.
25152516
- Example: {"id": 12345, "name": "John Doe", "email": "[email protected]", "createdAt": "2025-09-02T10:15:00Z"}`;
25162517
}
25172518
if (properties.lang === requestBodyLangType.JAVASCRIPT) {
25182519
return `${base}
25192520
- Body type is raw JavaScript.
25202521
- Return ONLY valid JavaScript code as plain text (no formatting or explanations).
2522+
- If existing Body type raw JavaScript are provided in the API details text, update their values with new realistic mock values.
25212523
- Generate realistic variable declarations, object definitions, or simple functions.
25222524
- Example: const user = {id: 123, name: "John Doe", active: true};`;
25232525
}
25242526
if (properties.lang === requestBodyLangType.XML) {
25252527
return `${base}
25262528
- Body type is raw XML.
25272529
- Return ONLY valid XML markup as plain text (no formatting or explanations).
2530+
- If existing Body type raw XML are provided in the API details text, update their values with new realistic mock values.
25282531
- Generate realistic XML structure with appropriate tags and attributes.
25292532
- Example: <user><id>123</id><name>John Doe</name><email>[email protected]</email></user>`;
25302533
}
25312534
if (properties.lang === requestBodyLangType.HTML) {
25322535
return `${base}
25332536
- Body type is raw HTML.
25342537
- Return ONLY valid HTML markup as plain text (no formatting or explanations).
2538+
- If existing Body type raw HTML are provided in the API details text, update their values with new realistic mock values.
25352539
- Generate realistic HTML content with proper structure and semantics.
25362540
- Example: <div class="user-card"><h2>John Doe</h2><p>Email: [email protected]</p></div>`;
25372541
}
25382542
if (properties.lang === requestBodyLangType.TEXT) {
25392543
return `${base}
25402544
- Body type is raw text.
25412545
- Return ONLY plain text content (no formatting or explanations).
2546+
- If existing Body type raw text are provided in the API details text, update their values with new realistic mock values.
25422547
- Generate realistic text data such as names, messages, descriptions, etc.
25432548
- Example: Welcome to our API! This is a sample text message for testing purposes.`;
25442549
}

0 commit comments

Comments
 (0)