App Structure
A TetiAI app consists of two primary JSON files that define its capabilities, behavior, and appearance. This page explains the structure of these files and how they work together.
Core Components
Every TetiAI app requires these core files:
These two files contain everything TetiAI needs to understand, connect to, and utilize your app's functionality.
File Organization
When developing a TetiAI app, your project structure will typically look like this:
my-teti-app/
| config.json # App configuration file
| functions.json # Function definitions
The logo of the app should be hosted externally and referenced in the config.json file.
The config.json File
The config.json file contains all the metadata and configuration information about your app. Here's a basic structure:
{
"name": "APP_NAME",
"display_name": "App Display Name",
"description": "A detailed description of what your app does",
"logo": "https://path-to-your-logo.svg",
"docs_url": "https://your-documentation-url.com", // documentation URL
"support_url": "https://your-support-url.com", // support URL
"terms_url": "https://your-terms-url.com", // terms of service URL
"author": {
"name": "Your Company",
"url": "https://your-company-website.com",
"logo": "https://path-to-your-company-logo.svg"
},
"version": "1.0.0",
"has_costs": false,
"security_schemes": {
"oauth2": {
// OAuth configuration (if applicable)
},
"api_key": {
// API key configuration (if applicable)
}
},
"categories": ["Productivity", "Communication"],
"prompts": [
"Example of how to use this app",
"Another example prompt"
],
"changelog": [
"Initial release"
]
}
For a comprehensive explanation of each field, see the Config File Reference.
The functions.json File
The functions.json file defines the specific functions your app provides. It's an array of function objects, each specifying parameters, behavior, and protocols:
[
{
"name": "FUNCTION_NAME",
"description": "What this function does",
"tags": ["tag1", "tag2"],
"visibility": "public",
"active": true,
"protocol": "rest",
"protocol_data": {
"method": "GET",
"path": "/path/to/resource",
"server_url": "https://api.example.com"
},
"parameters": {
"type": "object",
"properties": {
"param1": {
"type": "string",
"description": "Description of parameter"
}
},
"required": ["param1"],
"visible": ["param1"],
"additionalProperties": false
}
},
// Additional functions...
]
For a detailed explanation of function definitions, see the Functions File Reference.
App Naming Conventions
When naming your app and functions, follow these best practices:
App Names
- App name (
namefield) should be in UPPERCASE and withou extra characters (e.g.,GMAIL,GOOGLECALENDAR) - Display name (
display_namefield) should use proper capitalization (e.g., "Gmail", "Google Calendar")
Function Names
- Function names should follow the format:
APPNAME__FUNCTION_NAME(with double underscore) - Function names should be descriptive and indicate the action being performed
- Use uppercase with underscores for consistency
Examples:
GMAIL__SEND_EMAILGOOGLECALENDAR__CREATE_EVENTWEATHER__GET_FORECAST
App Versioning
TetiAI apps use semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: Incompatible API changes
- MINOR: New functionality in a backward-compatible manner
- PATCH: Backward-compatible bug fixes
Always increment your version number when submitting updates.
App Assets
All assets should be hosted externally and referenced in the config.json. Logos, documentation links, and support URLs are mandatory.
Next Steps
Now that you understand the basic structure of a TetiAI app, learn about:
- Creating the Config File - Detailed guide to app configuration
- Defining Functions - How to specify app functionality
- Authentication Methods - Setting up secure access to your app