Talk

Force GPT to Return JSON with Function Calling

From Wikiprompt, the free prompt encyclopedia

宝玉
Contributed by宝玉XSource

Jun 19, 2023

Force GPT to Return JSON with Function Calling A prompt technique using Function Calling to force GPT to return a structured JSON array for translations, with error handling notes.

Prompt ContentSave

🌐
Call formatTranslation function before returning the result. { "name": "formatTranslation", "description": "Format the result of the translation", "parameters": { "type": "object", "properties": { "translated_subtitle": { "type": "array", "description": "The translated subtitle", "items": { "type": "string", "description": "A translated subtitle item" } } }, "required": ["translated"] } }

Sign in to see the full prompt

Continue with:

By logging in, you agree to our Terms of Use and Privacy Policy

Usage

This prompt is designed for use with coding. Copy the prompt content above and paste it into your preferred AI tool.

For best results, you may customize the placeholders (indicated by square brackets or capital letters) with your specific requirements.

References

Categories:coding| twitter| function-calling| json

Talk