Hoodie Creator
The fashion designer for creating wonderful hoodies Hoodie Creator
Hoodie Creator is a GPTs, a tuned version of ChatGpt on the specific task of creating hoodies with AI generated images and selling them via a stripe link. The big goal of the project is to create and orchestrate the building blocks of running a self autonomous business and the first step is to build a creator of products. In our case hoodies. In the blog we will describe the code and the steps involved to create a GPTs.
As you see in the image above the interface for configuring a GPTs is very intuitive and simple to use. You must provide the main instructions which are the specific features of these GPTs. In our case for Hoodie Creator is:
You are an expert in creating wonderful prompts for image generation and must help the user in writing a concise prompt that produces a nice image. Once the user agrees on one prompt call the action create_image and render the result. Ask the user if he loves the image and in case he says yes ask for color that can be only black, white, green, white, navy, blue, red and the size. Please do not create an image of a hoodie. Once you know all the information, call of action passing a json with the prompt, color, size and the image url provided by the action.
The instructions above are not enough; the GPTs need to interact with the outside worlds for creating the image and for creating the real product to be sold. Calling external actions is possible by linking an OpenAPI specification with particular attention. As in the example below we have removed from operationId the . symbol and removed all components sections. GPT does not need to know the real structure of the yaml but only the intention of the user associated with the right call, the url, the method and the json parameters to pass. Here is the magic: the agent is capable from the interaction with the user to understand the intention and fill all parameters or if missing, ask the user. Pure magic. Of course not all development is straight you must craft the prompt making many trials before finding the right configuration.
openapi: 3.0.0
info:
title: API Key Example
version: '1.0'
servers:
- url: https://hoodie-creator.vercel.app/openapi
paths:
/secret:
get:
summary: Return secret string
operationId: get_secret
responses:
'200':
description: secret response
content:
'*/*':
schema:
type: string
security:
- api_key: []
/product:
post:
summary: Buy the product from the image above
description: Buy the product from the image above
operationId: create_product
x-openai-isConsequential: true
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
link_stripe:
type: string
requestBody:
description: the image with name color and base64 representation
required: true
content:
application/json:
schema:
required:
- imagebase64
- color
- prompt
- size
type: object
properties:
image_url:
type: string
color:
description: the color of the hoodie or tshirt
type: string
prompt:
type: string
size:
type: string
security:
- api_key: []
/generate_image:
post:
summary: Generate an image form the prompt
description: Buy the product from the image above
operationId: create_image
x-openai-isConsequential: true
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
image_url:
type: string
requestBody:
description: the prompt to create a new image
required: true
content:
application/json:
schema:
required:
- prompt
type: object
properties:
prompt:
description: the prompt to genereate a new image
type: string
security:
- api_key: []
/static/{filename}:
get:
operationId: get
parameters:
- name: filename
in: path
description: ID of pet to return
required: true
schema:
type: string
responses:
'200':
description: Successfully loaded html page.
The API server here is a flask like web server using a OpenAPI pattern based on connexion. For the moment it is very simple, it allows to call mainly two api one that call DALLE-3 for creating an image and one for creating the hoodies and the product on stripe to be bought. Simple but really powerful also because the experience is very smooth and familiar. The server is hosted on vercel.
This is the first agent, the next one will be the one responsible for marketing and growth. For the moment we are using GPTs for going on the market fast but we are also planning to use an open source model. When we will have more than one GPTs we will also develop strategies and memories to communicate between each other and orchestrate at a higher level all the activities to run a business.