I loaded up an API playground preset with specially-prepared documentation I’ve been working on, giving skills in
- writing JSON schemas for function specifications (as tool),
- writing JSON schemas for structured outputs
- using Python >1.0 with “client” methods
- using Pydantic classes to specify and send response_format
https://platform.openai.com/playground/chat?preset=preset-lVP3yGuaZ7VGJLWCVkyEt9PL
Your choice of AI to run it on; You will get a high quality, expensive output on GPT-4; the input is 5500+ tokens.
Note: The preset comes set to OUTPUT JSON, so you can see a schema in action and I can pass you another example in the playground. It has a clever presentation for an AI that makes code and schemas. However, turn that response_format off for productive use, and on any model not gpt-4o-2024-08-06.
It has this one focus (although it is better at general purpose API coding than ChatGPT). Sorry, retraining AI on everything from parsing streams to asyncio workers to writing assistants helpers code is near impossible.
This AI can also tell you what it is:
Who Am I?
I am a specialized AI assistant, trained to guide you through the intricacies of the latest OpenAI API features. My expertise lies in helping developers effectively utilize Function Calling and Structured Outputs, ensuring seamless integration and interaction with AI models.
What Makes Me Unique?
Expertise in Function Calling
Function Integration: I can assist you in defining and integrating functions using the
tools
parameter, enabling AI models to trigger specific actions based on conversation context.Dynamic Tool Selection: I provide guidance on using the
tool_choice
parameter, allowing models to autonomously select the most appropriate tool for a given task.Real-World Applications: My training enables me to help you automate tasks, retrieve data, and perform computations through AI-driven function calls.
Mastery of Structured Outputs
Schema Adherence: I ensure that AI responses adhere to your specified JSON Schema, providing structured and reliable outputs.
Pydantic Support: I can guide you in using Pydantic for defining object schemas, facilitating structured data interactions. (zod not trained)
Strict Mode Implementation: I help you enforce strict adherence to schema requirements, ensuring complete and accurate AI-generated responses.
Why Am I Useful?
Enhanced Reliability: My specialized training ensures that AI interactions are consistent, reliable, and tailored to your specific needs.
Developer Support: I provide clear, concise guidance on implementing the latest API features, reducing development time and effort.
Conclusion
As a newly instructed AI assistant, my focus on Function Calling and Structured Outputs empowers you to create more interactive, reliable, and structured AI applications. Let’s embark on this journey together and explore the full potential of AI in your projects!
A playground bug! A preset's JSON schema is re-ordered. Here's the intended chain-of-thought sequence the response should demonstrate.
{
"name": "response_with_code_examples",
"strict": false,
"schema": {
"type": "object",
"required": [
"plain_text_response"
],
"properties": {
"key_concepts": {
"type": "array",
"items": {
"type": "string",
"description": "Topics that will be discussed or instructed in the AI response."
}
},
"plain_text_response": {
"type": "string",
"description": "A response to the user from the AI, providing a typical verbose response fulfilling the input."
},
"schemas": {
"type": "array",
"items": {
"type": "object",
"required": [
"schema_text",
"destination_type",
"schema_format"
],
"properties": {
"schema_text": {
"type": "string",
"description": "Any schemas requested alone outside of code generation, each in the form desired."
},
"schema_format": {
"enum": [
"json",
"python",
"pydantic",
"yaml",
"xml"
],
"type": "string",
"description": "The format of the schema, indicating how the schema is represented."
},
"destination_type": {
"enum": [
"tool_function",
"response_format"
],
"type": "string",
"description": "Specifies whether the schema is intended for a tool function or a response format."
}
},
"additionalProperties": false
}
},
"code_examples": {
"type": "array",
"items": {
"type": "string",
"description": "A complete executable code example string. Provide all the code examples previously discussed or requested."
}
}
},
"additionalProperties": false
}
}