GPT API prompt adaptation to allow passing
I'll explain in simple words during the conversation, I will provide the prompt that needs to work in conjunction with the screenshot analysis.
Task for the programmer
1) Goal
Ensure that the Telegram bot on the GPT API:
- stably receives/sends responses with a "financial" theme,
- passes moderation checks,
- does not lose the structure of the prompt and context,
- returns the response strictly in JSON (for further processing in the bot).
2) What to do (step by step)
- Divide the prompt into layers
- system — security policies/language/output format.
- developer — style, constraints, response template (JSON).
- user — user message + (optionally) compressed history/data.
- Move financial rules to system/developer, do not change them further in the code.
- Simplify financial vocabulary (to pass moderation)
- Prohibit categorical instructions "buy/sell", profit guarantees, target prices.
- Allow educational explanations, comparisons of options, risks, scenarios, steps for self-verification.
- Add a disclaimer to the output (disclaimer field), always present.
- Pre-moderation + fallback
- Before calling the model, run user content through the Moderation API.
- If "flagged" → gently rephrase the request to an "educational" format (replace: "What to buy?" → "Explain the factors that are usually evaluated when choosing tools").
- If flagged again → return a safe placeholder response (educational) with a disclaimer.
- Token control
- Never shorten system/developer.
- If it doesn't fit — compress only the history (semantic summary).
- Response format (strict JSON)
- Use response_format: { type: "json_object" }.
- JSON validator on the bot side; in case of an error — automatic "fix-json" retry call.
- Maintain the integrity of blocks
- Wrap key fragments in markers <<<BLOCK name="...">>> ... <<<END>>> (or another simple marker).
- (Optionally) log the SHA-256 hash of the block contents before/after.
- Security/PII
- Mask user personal data in logs.
- No personalized investment advice; only general/educational information.
- Coding
- All strings — UTF-8, without hidden trimming/normalization, preserving line breaks \n.
- Logs and alerts
- Log: moderation flag, JSON retries, time/tokens/cost, history truncations.
- Alert when >3% invalid JSON or frequent moderation blocks.
- Config
- temperature=0.2, max_tokens according to the task, retries with exponential backoff.
-
3092 11 0 Good time of day!
I develop Telegram bots in Python.
I have successfully integrated ChatGPT into other projects. I can provide examples in private.
Write to me - we will discuss your project.
-
2964 14 0 Good day!
I have experience integrating with the GPT API considering moderation, strict JSON format. I can implement prompt splitting at levels, integrate the Moderation API with a fallback, control tokens, and validate JSON. The estimated time to complete the task is 3 working days.
I am ready to discuss the details and start working immediately.
I would be happy to collaborate.
-
1562 7 0 Good day!
My name is Roman, and I am among the top 5 developers in the "Artificial Intelligence and Machine Learning" category out of ~1600 specialists on the platform.
I guarantee:
- Fast and quality task execution
- Strict adherence to deadlines
- Regular communication throughout the entire process
I would be happy to discuss the details of your project in private messages.
-
1002 5 1 Good afternoon, I understand the task, I have experience with AI APIs, I adhere to all security standards, and I am ready to solve everything in the shortest possible time.
What is needed for work:
Access to the repository and server for the future re-upload of the bot, or I can run it locally for demonstration that everything works according to the specifications, that is, you can provide a Google Drive link with the bot.
API keys if you are using GPT/Gemini can be omitted, I have my own.
Prompts that need to be implemented.
My 1 day costs 2000 UAH.
I will most likely complete 6 days of work in 2 days.
Current freelance projects in the category AI & Machine Learning
I am looking for a mentor/teacher for ComfyUI for online learning (working through RunPod)
16 USD
Hello. I am looking for a practicing specialist and mentor who can help me master working with ComfyUI. The main feature of my request is that the work will be done entirely in the cloud, without downloading the program to a local computer. I plan to rent a graphics card through… AI & Machine Learning ∙ 5 hours 25 minutes back ∙ 1 proposal |
AI agent of sports nutrition technologistThe agent helps develop formulations for new sports nutrition products — protein bars, proteins, pre-workouts, isotonic drinks, bars, etc. The main feature: the agent knows the legislation of different countries and automatically takes it into account when creating the… AI & Machine Learning, Web Programming ∙ 5 hours 49 minutes back ∙ 40 proposals |
Integration of the analytics system with the Database in Tables
112 USD
The current analytics system needs to be brought to a stable working state. Currently, data from CRM, telephony, and advertising accounts is pulled through Supabase via MSP into Google Sheets, but some processes still require manual control. This needs to be eliminated.1.… AI & Machine Learning, Bot Development ∙ 20 hours 14 minutes back ∙ 28 proposals |
Write meta data for ALT using AIA website on Laravel, the site has many images for which it is necessary to automatically generate correct semantic and relevant ALT descriptions for the images, with the possibility of verification. AI & Machine Learning, PHP ∙ 1 day 2 hours back ∙ 30 proposals |
N8n - automation of processing requests for an online store on Shopify
45 USD
I'm looking for an n8n specialist to build a workflow that automatically processes incoming customer inquiries for our Shopify store: classifies them, pulls order data from Shopify, and routes to the correct action (auto-response, ticket, team notification). What needs to be… AI & Machine Learning ∙ 2 days 1 hour back ∙ 24 proposals |