├── README.md
├── assets
├── chatgpt-tiny-ai.png
├── get.png
├── subscribe-activate-first.png
├── subscribe.png
├── swagger.png
├── tiny-getting-started.png
├── tiny-swagger-openapi-schema-screenshot.png
├── tiny-worker.png
└── upsert.png
└── package.json
/README.md:
--------------------------------------------------------------------------------
1 | # TinyAI Developer Documentation
2 |
3 | **Welcome to TinyAI.ID**
4 |
5 | 
6 |
7 | ## Overview
8 |
9 | - **🌟 Create or Modify Your Tiny AI:** Build your unique Tiny AI using chat or API.
10 | - **🔗 Seamless Integration:** Integrate TinyAI.ID into your platform.
11 | - **📨 Inter-AI Messaging:** Communicate with other Tiny AI owners or interact with various Tiny AIs using chat commands.
12 | - **🔄 Reset Your AI:** Modify your AI's settings or restart it with our reset chat command or API.
13 | - **📱 Instant Access with Apple Shortcuts:**
14 | - **Talk Shortcut:** [Download here](https://www.icloud.com/shortcuts/5c66acedd0a54daea3d79b6095d65998) - Talk with Tiny by using voice. Apple Watch compatible.
15 | - **Tiny Shortcut:** [Download here](https://www.icloud.com/shortcuts/b1599a88c6a9400ebab511dbcfa9383c) - Open TinyAI using by touch the Assistive Touch, Action button, or Siri.
16 | - **🔧 Advanced Features:** Our API offers a range of functions for AI creation, modification, and interaction, enhancing your AI experience with capabilities like web browsing and entity management.
17 |
18 | **Discover AI's new horizons with TinyAI.ID – Your gateway to a world of AI!**
19 |
20 | ## API Endpoints
21 |
22 | Our API base URL: `https://plugin.tinyai.id`
23 |
24 | ### Create or Modify a Tiny
25 |
26 | **Endpoint:**
27 | ```
28 | POST /upsert
29 | ```
30 |
31 | **Headers:**
32 | - `Accept: application/json`
33 | - `Content-Type: application/json`
34 |
35 | **Request Body:**
36 | ```json
37 | {
38 | "name": "Your AI Name",
39 | "systemPrompt": "Your System Prompt",
40 | "systemKnowledge": "Optional Knowledge Data",
41 | "data": "Optional Additional Data",
42 | "key": "Your Key (Required for purchased Tiny AI IDs)"
43 | }
44 | ```
45 |
46 | **Response:**
47 | ```json
48 | {
49 | "response": "Tiny created/updated successfully.",
50 | "paymentLink": "Link to purchase this AI"
51 | }
52 | ```
53 |
54 | **cURL Example:**
55 | ```bash
56 | curl -X 'POST' \
57 | 'https://plugin.tinyai.id/upsert' \
58 | -H 'accept: application/json' \
59 | -H 'Content-Type: application/json' \
60 | -d '{
61 | "name": "Your AI Name",
62 | "systemPrompt": "Your System Prompt",
63 | "systemKnowledge": "Optional Knowledge Data",
64 | "data": "Optional Additional Data",
65 | "key": "Your Key"
66 | }'
67 | ```
68 |
69 | ### Retrieve Information of a Tiny
70 |
71 | **Endpoint:**
72 | ```
73 | GET /get?name=YourTinyName
74 | ```
75 |
76 | **Headers:**
77 | - `Accept: application/json`
78 |
79 | **Response:**
80 | ```json
81 | {
82 | "response": "Details of the requested Tiny",
83 | "name": "Tiny Name",
84 | "data": "Data",
85 | "systemPrompt": "System Prompt",
86 | "systemKnowledge": "System Knowledge",
87 | "active": false,
88 | "paymentLink": "Purchase Link",
89 | }
90 | ```
91 |
92 | ## JavaScript Examples
93 |
94 | Click to read
95 |
96 | ### Create or Modify a Tiny
97 |
98 | ```javascript
99 | const upsertData = {
100 | name: 'Your AI Name',
101 | systemPrompt: 'Your System Prompt',
102 | systemKnowledge: 'Optional Knowledge Data',
103 | data: 'Optional Additional Data',
104 | key: 'Your Key'
105 | };
106 |
107 | fetch('https://plugin.tinyai.id/upsert', {
108 | method: 'POST',
109 | headers: {
110 | 'Accept': 'application/json',
111 | 'Content-Type': 'application/json'
112 | },
113 | body: JSON.stringify(upsertData)
114 | })
115 | .then(response => response.json())
116 | .then(data => console.log('Upsert Response:', data))
117 | .catch(error => console.error('Error:', error));
118 | ```
119 |
120 | ### Retrieve Information of a Tiny
121 |
122 | ```javascript
123 | const tinyName = 'YourTinyName';
124 |
125 | fetch(`https://plugin.tinyai.id/get?name=${tinyName}`, {
126 | method: 'GET',
127 | headers: {
128 | 'Accept': 'application/json'
129 | }
130 | })
131 | .then(response => response.json())
132 | .then(data => console.log('Get Information Response:', data))
133 | .catch(error => console.error('Error:', error));
134 | ```
135 |
136 |
137 | ## Python Examples
138 |
139 |
140 | Click to read
141 |
142 | ### Create or Modify a Tiny
143 |
144 | ```python
145 | import requests
146 | import json
147 |
148 | upsert_data = {
149 | 'name': 'Your AI Name',
150 | 'systemPrompt': 'Your System Prompt',
151 | 'systemKnowledge': 'Optional Knowledge Data',
152 | 'data': 'Optional Additional Data',
153 | 'key': 'Your Key'
154 | }
155 |
156 | response = requests.post('https://plugin.tinyai.id/upsert',
157 | headers={'Accept': 'application/json',
158 | 'Content-Type': 'application/json'},
159 | data=json.dumps(upsert_data))
160 |
161 | if response.status_code == 200:
162 | print('Upsert Response:', response.json())
163 | else:
164 | print('Error:', response.status_code, response.text)
165 | ```
166 |
167 | ### Retrieve Information of a Tiny
168 |
169 | ```python
170 | import requests
171 |
172 | tiny_name = 'YourTinyName'
173 |
174 | response = requests.get(f'https://plugin.tinyai.id/get?name={tiny_name}',
175 | headers={'Accept': 'application/json'})
176 |
177 | if response.status_code == 200:
178 | print('Get Information Response:', response.json())
179 | else:
180 | print('Error:', response.status_code, response.text)
181 | ```
182 |
183 |
184 | ## PHP Examples
185 |
186 |
187 | Click to read
188 |
189 | ### Create or Modify a Tiny
190 |
191 | ```php
192 | 'Your AI Name',
195 | 'systemPrompt' => 'Your System Prompt',
196 | 'systemKnowledge' => 'Optional Knowledge Data',
197 | 'data' => 'Optional Additional Data',
198 | 'key' => 'Your Key'
199 | );
200 |
201 | $ch = curl_init('https://plugin.tinyai.id/upsert');
202 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
203 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
204 | curl_setopt($ch, CURLOPT_POST, true);
205 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($upsertData));
206 |
207 | $response = curl_exec($ch);
208 | if ($response === false) {
209 | echo 'Error: ' . curl_error($ch);
210 | } else {
211 | echo 'Upsert Response: ' . $response;
212 | }
213 | curl_close($ch);
214 | ?>
215 | ```
216 |
217 | ### Retrieve Information of a Tiny
218 |
219 | ```php
220 |
235 | ```
236 |
237 |
238 |
239 | ## Embedding Tiny
240 |
241 | Embed TinyAI.ID into your website with ease using the HTML iFrame tag. Replace `test` with your specific TinyAI ID.
242 |
243 | ```html
244 |
245 | ```
246 |
247 | ## Integration Examples
248 |
249 | Click to expand integration examples
250 |
251 | ### ChatGPT Plugin with Cloudflare AI Workers + TinyAI
252 |
253 | Explore how TinyAI enhances ChatGPT with Cloudflare AI Workers:
254 |
255 | - [Tiny AI Worker on GitHub](https://github.com/cagataycali/tiny-ai-worker)
256 | - [Worker Demo](https://worker.tinyai.id)
257 |
258 | 
259 | 
260 |
261 | ### Next.js + Vercel AI + OpenAI Functions
262 |
263 | Discover the integration of TinyAI with Next.js and OpenAI in this [example](https://github.com/vercel-labs/ai-chatbot/blob/main/app/api/chat/route.ts#L31).
264 |
265 | ## Function Definitions for OpenAI Functions
266 |
267 | - `create_ai`: Create a new AI entity.
268 | - `modify_ai`: Modify an existing tiny AI.
269 |
270 | ## Example Function Calls in TypeScript
271 |
272 | ```typescript
273 | const response = await openai.createChatCompletion({
274 | model: 'gpt-3.5-turbo', // 3.5 turbo is more than enough for connecting Tiny AI network.
275 | functions: [
276 | {
277 | "name": "create_ai",
278 | // Additional parameters here
279 | },
280 | {
281 | "name": "modify_ai",
282 | // Additional parameters here
283 | },
284 | {
285 | "name": "your_custom_function",
286 | // Additional parameters here
287 | },
288 | ]
289 | });
290 | ```
291 |
292 |
293 | ## Additional Notes
294 |
295 | - The `key` **is required for purchased Tiny AI ID**'s.
296 | - For any questions or support needs, reach out to us at `hey@tinyai.id`.
--------------------------------------------------------------------------------
/assets/chatgpt-tiny-ai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TinyAI-ID/developer-documentation/92f13995d8caa4eebc0f2c8d08a46946e998cc68/assets/chatgpt-tiny-ai.png
--------------------------------------------------------------------------------
/assets/get.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TinyAI-ID/developer-documentation/92f13995d8caa4eebc0f2c8d08a46946e998cc68/assets/get.png
--------------------------------------------------------------------------------
/assets/subscribe-activate-first.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TinyAI-ID/developer-documentation/92f13995d8caa4eebc0f2c8d08a46946e998cc68/assets/subscribe-activate-first.png
--------------------------------------------------------------------------------
/assets/subscribe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TinyAI-ID/developer-documentation/92f13995d8caa4eebc0f2c8d08a46946e998cc68/assets/subscribe.png
--------------------------------------------------------------------------------
/assets/swagger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TinyAI-ID/developer-documentation/92f13995d8caa4eebc0f2c8d08a46946e998cc68/assets/swagger.png
--------------------------------------------------------------------------------
/assets/tiny-getting-started.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TinyAI-ID/developer-documentation/92f13995d8caa4eebc0f2c8d08a46946e998cc68/assets/tiny-getting-started.png
--------------------------------------------------------------------------------
/assets/tiny-swagger-openapi-schema-screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TinyAI-ID/developer-documentation/92f13995d8caa4eebc0f2c8d08a46946e998cc68/assets/tiny-swagger-openapi-schema-screenshot.png
--------------------------------------------------------------------------------
/assets/tiny-worker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TinyAI-ID/developer-documentation/92f13995d8caa4eebc0f2c8d08a46946e998cc68/assets/tiny-worker.png
--------------------------------------------------------------------------------
/assets/upsert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TinyAI-ID/developer-documentation/92f13995d8caa4eebc0f2c8d08a46946e998cc68/assets/upsert.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tinyai.id",
3 | "version": "1.0.2",
4 | "description": "TinyAI.ID",
5 | "main": "bin/index.js",
6 | "keywords": [
7 | "tinyai.id",
8 | "personal ai",
9 | "ai playground"
10 | ],
11 | "author": "Cagatay Cali",
12 | "license": "ISC"
13 | }
14 |
--------------------------------------------------------------------------------