Integrating the OpenAI API
in Your ColdFusion Applications
Brian Klaas
@brian_klaas
brianklaas.net
H E L LO G P T S !
H E L LO G P T S !
https://venturebeat.com/ai/a-chevy-for-1-car-dealer-chatbots-show-perils-of-ai-for-customer-service/
H E L LO G P T S !
https://x.com/chrisjbakke/status/1736533308849443121?s=61
H E L LO G P T S !
Now?Soon?Never?
H E L LO G P T S !
H E L LO G P T S !
GPT-4o Prompt: “Create an image of a large pile of cash being set on
fi
re, and the software developer setting the cash on
fi
re is very, very, very happy about it.”
H E L LO G P T S !
GPT-4o Prompt: “Create an image of three business people abusing a sweet, innocent generative AI model.”
!
H E L LO G P T S !
Don't allow free-range access
to large language models.
H E L LO G P T S !
Use an API instead.
H E L LO G P T S !
The OpenAI API
T H E O P E N A I A P I
Image generation
Text to speech
Speech to text
File search (RAG)
Web search
Computer use
Moderations
Realtime API
Agents API
Async Batch API
Evaluations
Structured outputs from
JSON schema
Fine tuning
Embeddings generation
Model distillation
T H E O P E N A I A P I
platform.openai.com
T H E O P E N A I A P I
Completions
T H E O P E N A I A P I
{
"model": "gpt-4o-mini",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Who won the world series in 2020?"
},
}
Chat Completions
T H E O P E N A I A P I
Chat Completions
Legacy Completions Modern Completions
Access to GPT 3.5 and lower only Access to latest models
Can use
fi
le attachments Cannot use
fi
le attachments
T H E O P E N A I A P I
Assistants
Responses
R E S P O N S E S A P I
Chat Completions API Responses API
Text generation ✓ ✓
Audio ✓ Soon
Vision ✓ ✓
Structured Outputs ✓ ✓
Function calling ✓ ✓
Web search ✓ ✓
File search X ✓
Computer use X ✓
Code Interpreter X Soon
R E S P O N S E S A P I
Augments a basic chat completion with:
Code Interpreter
Function Calling
File Search (RAG)
R E S P O N S E S A P I
Allow for more complex processes
Responses > Completions
R E S P O N S E S A P I
Have conversations, just like in ChatGPT
Responses > Completions
R E S P O N S E S A P I
Persistent conversation management
Responses > Completions
A S S I S TA N T S
Responses are the future of OpenAI’s API offerings
Responses > Completions
Retrieval Augmented Generation
R E T R I E VA L A U G M E N T E D G E N E R AT I O N
Got documents or data?
You’re going to need some RAG.
T H E A P I W O R K F LO W
R E T R I E VA L A U G M E N T E D G E N E R AT I O N
How does RAG work?
R E T R I E VA L A U G M E N T E D G E N E R AT I O N
Prompt
LLM
Query
Processor
Similarity
Search
Augmented
Prompt
Response
External
Data
Embeddings Vector
Database
Handled
automatically
by OpenAI
!
R E T R I E VA L A U G M E N T E D G E N E R AT I O N
No support for parsing images in documents.
The API Workflow
T H E A P I W O R K F LO W
Steps in the Responses + RAG Work
fl
ow
1 Upload
fi
les
Create vector store
Add
fi
les to vector store
Call the Responses API, referencing the vector store
Get the generated content from the response
2
3
4
5
T H E A P I W O R K F LO W
!
Things will go wrong
T H E A P I W O R K F LO W
Design for resilience.
P R O M P T T E S T I N G I N T H E P L AY G R O U N D
A Short Detour into
Prompt Testing
and the Playground
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
The key to building good generative AI tools:
The quality of your prompt.
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
Iterate early and often.
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
Seek domain expert feedback.
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
Use Evaluations to test model changes.
P R O M P T T E S T I N G A N D T H E P L AY G R O U N D
Test your prompts in the Playground.
Lots and lots and LOTS of tests.
T H E A P I W O R K F LO W
Steps in the Responses + RAG Work
fl
ow
1 Upload
fi
les
Create vector store
Add
fi
les to vector store
Call the Responses API, referencing the vector store
Get the generated content from the response
2
3
4
5
T H E A P I W O R K F LO W
Two prerequisites
T H E A P I W O R K F LO W
Two Prerequisites
You need a service account.
(One service account per project is safer.)
T H E A P I W O R K F LO W
Two Prerequisites
You need headers.
cfhttpparam(name="Authorization", type="header", value=“Bearer YOUR TOKEN”);
T H E A P I W O R K F LO W
1 Upload
fi
les
POST https://api.openai.com/v1/
fi
les
T H E A P I W O R K F LO W
?
T H E A P I W O R K F LO W
openAI-coldfusion-utils
https://github.com/brianklaas/openAI-coldfusion-utils
T H E A P I W O R K F LO W
1 Upload
fi
les
cfhttp(method=“POST”, charset="utf-8", url=“https://api.openai.com/v1/
fi
les", result=“result")
cfhttpparam(name="Authorization", type="header", value=“Bearer YOUR TOKEN”);
cfhttpparam(name="purpose", type="form
fi
eld", value="assistants");
cfhttpparam(type="
fi
le",
fi
le=“PATH TO FILE”, name=“
fi
le");
}
T H E A P I W O R K F LO W
1 Upload
fi
les
uploadFile(string pathToFile)
openAI-coldfusion-utils
T H E A P I W O R K F LO W
1 Upload
fi
les
{
"id": "
fi
le-abc123",
"object": "
fi
le",
"bytes": 120000,
"created_at": 1677610602,
"
fi
lename": “myDocument.pdf"
}
T H E A P I W O R K F LO W
!
Make sure you stay within the context window
T H E A P I W O R K F LO W
2 Create vector store
POST https://api.openai.com/v1/vector_stores
T H E A P I W O R K F LO W
External
Data
Embeddings Vector
Database
Vector Stores
OpenAI Vector Store
T H E A P I W O R K F LO W
2 Create vector store
cfhttp(method=“POST”, charset="utf-8", url=“https://api.openai.com/v1/vector_store”, result=“result")
cfhttpparam(name="Authorization", type="header", value=“Bearer YOUR TOKEN”);
cfhttpparam(name="content-type", type="header", value="application/json");
cfhttpparam(type="body", value=“#requestBodyAsJSON#");
}
T H E A P I W O R K F LO W
2 Create vector store
createVectorStore()
openAI-coldfusion-utils
T H E A P I W O R K F LO W
2 Create vector store
{
"id": "vs_abc123",
"object": "vector_store",
"created_at": 1699061776,
"name": "Support FAQ",
"bytes": 139920,
"
fi
le_counts": {
"in_progress": 0,
"completed": 3,
"failed": 0,
"cancelled": 0,
"total": 3
}
}
T H E A P I W O R K F LO W
3 Add
fi
les to vector store
POST https://api.openai.com/v1/{vector_store_id}/
fi
les
T H E A P I W O R K F LO W
3 Add
fi
les to vector store
for (
fi
leID in
fi
lesArray) {
addFileToVectorStore(
fi
leID, vectorStoreID);
}
openAI-coldfusion-utils
T H E A P I W O R K F LO W
3 Add
fi
les to vector store
{
"id": "
fi
le-abc123",
"object": "vector_store.
fi
le",
"created_at": 1699061776,
"usage_bytes": 1234,
"vector_store_id": "vs_abcd",
"status": "completed",
"last_error": null
}
T H E A P I W O R K F LO W
How do you know if it’s done?
T H E A P I W O R K F LO W
hasFileBeenProcessed(
fi
leID, vectorStoreID)
openAI-coldfusion-utils
Checking for Completion
GET https://api.openai.com/v1/vector_stores/{vector_store_id}/
fi
les/{
fi
le_id}
T H E A P I W O R K F LO W
while() loop
Strategies for Waiting
T H E A P I W O R K F LO W
Database rows + scheduled task
Strategies for Waiting
T H E A P I W O R K F LO W
Use SQS
Strategies for Waiting
T H E A P I W O R K F LO W
Why SQS
SQS Provides:
Message ordering
Fault-tolerant resilience
Easy retries in case of API failure
T H E A P I W O R K F LO W
Why SQS
You’ll need SQS queues for:
Checking
fi
le processing completion
Checking output generation completion
T H E A P I W O R K F LO W
Why SQS
You’ll need SQS queues for:
Uploading
fi
les
Checking
fi
le processing completion
Checking output generation completion
File and vector store cleanup
T H E A P I W O R K F LO W
4 Call the Responses API, referencing the vector store
POST https://api.openai.com/v1/responses
T H E A P I W O R K F LO W
4 Call the Responses API, referencing the vector store
{
“model": “gpt-4.1”,
"tools": [ {
"type": "
fi
le_search",
"vector_store_ids": ["#thisVectorStoreID#"]
} ],
"instructions": "#promptInstructions#",
"input": "#promptInput#"
};
T H E A P I W O R K F LO W
4 Call the Responses API, referencing the vector store
{
“model": “gpt-4.1”,
"tools": [ {
"type": "
fi
le_search",
"vector_store_ids": ["#thisVectorStoreID#"]
} ],
"instructions": "#promptInstructions#",
"input": "#promptInput#"
};
T H E A P I W O R K F LO W
4 Call the Responses API, referencing the vector store
{
“model": “gpt-4.1”,
"tools": [ {
"type": "
fi
le_search",
"vector_store_ids": ["#thisVectorStoreID#"]
} ],
"instructions": "#promptInstructions#",
"input": "#promptInput#"
};
T H E A P I W O R K F LO W
Conversing with GPT4.1
Prompt Instructions + Input = “Prompt”
T H E A P I W O R K F LO W
Conversing with GPT4.1
Main prompt → instructions
Custom content/context → input
T H E A P I W O R K F LO W
Conversing with GPT4.1
include() instructions
T H E A P I W O R K F LO W
Conversing with GPT4.1
Instructions Input
Files in
Vector Store
LLM
T H E A P I W O R K F LO W
4* Check for completion
Content generation can take a while
T H E A P I W O R K F LO W
Fully asynchronous work
fl
ow
Handling Waiting for Completion
T H E A P I W O R K F LO W
Progress bars
Handling Waiting for Completion
T H E A P I W O R K F LO W
Handling Waiting for Completion
T H E A P I W O R K F LO W
Streaming responses
Handling Waiting for Completion
T H E A P I W O R K F LO W
5 Get the generated content from the response
cfhttp requests are synchronous
T H E A P I W O R K F LO W
5 Get the generated content from the response
GET https://api.openai.com/v1/responses/{response_id}
T H E A P I W O R K F LO W
5 Get the generated content from the response
In the cfhttp call response:
deserializeJSON(response.
fi
leContent).callResult.output
T H E A P I W O R K F LO W
5 Get the generated content from the response
Check that the response is useful!
T H E A P I W O R K F LO W
Steps in the Responses + RAG Work
fl
ow
1 Upload
fi
les
Create vector store
Add
fi
les to vector store
Call the Responses API, referencing the vector store
Get the generated content from the response
2
3
4
5
T H E A P I W O R K F LO W
Don’t forget to clean up the
fi
les!
Painful Lessons
PA I N F U L L E S S O N S
Re
fi
ne your prompt in the Playground
before building anything.
PA I N F U L L E S S O N S
Don't ask for references.
PA I N F U L L E S S O N S
Really structured output?
Use Structured Outputs (JSON Schema).
PA I N F U L L E S S O N S
Requests fail.
Build for retries.
PA I N F U L L E S S O N S
Multi-step prompts?
Write options into your app.
PA I N F U L L E S S O N S
Friends don’t let friends
build open-ended chatbots.
Go Do!
brian.klaas@gmail.com
brianklaas.net
CFML Slack
https://github.com/brianklaas/openAI-coldfusion-utils

Integrating the OpenAI API in Your Coldfusion Apps.pdf

  • 1.
    Integrating the OpenAIAPI in Your ColdFusion Applications Brian Klaas @brian_klaas brianklaas.net
  • 2.
    H E LLO G P T S !
  • 3.
    H E LLO G P T S ! https://venturebeat.com/ai/a-chevy-for-1-car-dealer-chatbots-show-perils-of-ai-for-customer-service/
  • 4.
    H E LLO G P T S ! https://x.com/chrisjbakke/status/1736533308849443121?s=61
  • 5.
    H E LLO G P T S ! Now?Soon?Never?
  • 6.
    H E LLO G P T S !
  • 7.
    H E LLO G P T S ! GPT-4o Prompt: “Create an image of a large pile of cash being set on fi re, and the software developer setting the cash on fi re is very, very, very happy about it.”
  • 8.
    H E LLO G P T S ! GPT-4o Prompt: “Create an image of three business people abusing a sweet, innocent generative AI model.”
  • 9.
    ! H E LLO G P T S ! Don't allow free-range access to large language models.
  • 10.
    H E LLO G P T S ! Use an API instead.
  • 11.
    H E LLO G P T S !
  • 12.
  • 13.
    T H EO P E N A I A P I Image generation Text to speech Speech to text File search (RAG) Web search Computer use Moderations Realtime API Agents API Async Batch API Evaluations Structured outputs from JSON schema Fine tuning Embeddings generation Model distillation
  • 14.
    T H EO P E N A I A P I platform.openai.com
  • 15.
    T H EO P E N A I A P I Completions
  • 16.
    T H EO P E N A I A P I { "model": "gpt-4o-mini", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Who won the world series in 2020?" }, } Chat Completions
  • 17.
    T H EO P E N A I A P I Chat Completions Legacy Completions Modern Completions Access to GPT 3.5 and lower only Access to latest models Can use fi le attachments Cannot use fi le attachments
  • 18.
    T H EO P E N A I A P I Assistants
  • 19.
  • 20.
    R E SP O N S E S A P I Chat Completions API Responses API Text generation ✓ ✓ Audio ✓ Soon Vision ✓ ✓ Structured Outputs ✓ ✓ Function calling ✓ ✓ Web search ✓ ✓ File search X ✓ Computer use X ✓ Code Interpreter X Soon
  • 21.
    R E SP O N S E S A P I Augments a basic chat completion with: Code Interpreter Function Calling File Search (RAG)
  • 22.
    R E SP O N S E S A P I Allow for more complex processes Responses > Completions
  • 23.
    R E SP O N S E S A P I Have conversations, just like in ChatGPT Responses > Completions
  • 24.
    R E SP O N S E S A P I Persistent conversation management Responses > Completions
  • 25.
    A S SI S TA N T S Responses are the future of OpenAI’s API offerings Responses > Completions
  • 26.
  • 27.
    R E TR I E VA L A U G M E N T E D G E N E R AT I O N Got documents or data? You’re going to need some RAG.
  • 28.
    T H EA P I W O R K F LO W
  • 29.
    R E TR I E VA L A U G M E N T E D G E N E R AT I O N How does RAG work?
  • 30.
    R E TR I E VA L A U G M E N T E D G E N E R AT I O N Prompt LLM Query Processor Similarity Search Augmented Prompt Response External Data Embeddings Vector Database Handled automatically by OpenAI
  • 31.
    ! R E TR I E VA L A U G M E N T E D G E N E R AT I O N No support for parsing images in documents.
  • 32.
  • 33.
    T H EA P I W O R K F LO W Steps in the Responses + RAG Work fl ow 1 Upload fi les Create vector store Add fi les to vector store Call the Responses API, referencing the vector store Get the generated content from the response 2 3 4 5
  • 34.
    T H EA P I W O R K F LO W ! Things will go wrong
  • 35.
    T H EA P I W O R K F LO W Design for resilience.
  • 36.
    P R OM P T T E S T I N G I N T H E P L AY G R O U N D A Short Detour into Prompt Testing and the Playground
  • 37.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D
  • 38.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D
  • 39.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D
  • 40.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D
  • 41.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D
  • 42.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D
  • 43.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D The key to building good generative AI tools: The quality of your prompt.
  • 44.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D Iterate early and often.
  • 45.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D Seek domain expert feedback.
  • 46.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D Use Evaluations to test model changes.
  • 47.
    P R OM P T T E S T I N G A N D T H E P L AY G R O U N D Test your prompts in the Playground. Lots and lots and LOTS of tests.
  • 48.
    T H EA P I W O R K F LO W Steps in the Responses + RAG Work fl ow 1 Upload fi les Create vector store Add fi les to vector store Call the Responses API, referencing the vector store Get the generated content from the response 2 3 4 5
  • 49.
    T H EA P I W O R K F LO W Two prerequisites
  • 50.
    T H EA P I W O R K F LO W Two Prerequisites You need a service account. (One service account per project is safer.)
  • 51.
    T H EA P I W O R K F LO W Two Prerequisites You need headers. cfhttpparam(name="Authorization", type="header", value=“Bearer YOUR TOKEN”);
  • 52.
    T H EA P I W O R K F LO W 1 Upload fi les POST https://api.openai.com/v1/ fi les
  • 53.
    T H EA P I W O R K F LO W ?
  • 54.
    T H EA P I W O R K F LO W openAI-coldfusion-utils https://github.com/brianklaas/openAI-coldfusion-utils
  • 55.
    T H EA P I W O R K F LO W 1 Upload fi les cfhttp(method=“POST”, charset="utf-8", url=“https://api.openai.com/v1/ fi les", result=“result") cfhttpparam(name="Authorization", type="header", value=“Bearer YOUR TOKEN”); cfhttpparam(name="purpose", type="form fi eld", value="assistants"); cfhttpparam(type=" fi le", fi le=“PATH TO FILE”, name=“ fi le"); }
  • 56.
    T H EA P I W O R K F LO W 1 Upload fi les uploadFile(string pathToFile) openAI-coldfusion-utils
  • 57.
    T H EA P I W O R K F LO W 1 Upload fi les { "id": " fi le-abc123", "object": " fi le", "bytes": 120000, "created_at": 1677610602, " fi lename": “myDocument.pdf" }
  • 58.
    T H EA P I W O R K F LO W ! Make sure you stay within the context window
  • 59.
    T H EA P I W O R K F LO W 2 Create vector store POST https://api.openai.com/v1/vector_stores
  • 60.
    T H EA P I W O R K F LO W External Data Embeddings Vector Database Vector Stores OpenAI Vector Store
  • 61.
    T H EA P I W O R K F LO W 2 Create vector store cfhttp(method=“POST”, charset="utf-8", url=“https://api.openai.com/v1/vector_store”, result=“result") cfhttpparam(name="Authorization", type="header", value=“Bearer YOUR TOKEN”); cfhttpparam(name="content-type", type="header", value="application/json"); cfhttpparam(type="body", value=“#requestBodyAsJSON#"); }
  • 62.
    T H EA P I W O R K F LO W 2 Create vector store createVectorStore() openAI-coldfusion-utils
  • 63.
    T H EA P I W O R K F LO W 2 Create vector store { "id": "vs_abc123", "object": "vector_store", "created_at": 1699061776, "name": "Support FAQ", "bytes": 139920, " fi le_counts": { "in_progress": 0, "completed": 3, "failed": 0, "cancelled": 0, "total": 3 } }
  • 64.
    T H EA P I W O R K F LO W 3 Add fi les to vector store POST https://api.openai.com/v1/{vector_store_id}/ fi les
  • 65.
    T H EA P I W O R K F LO W 3 Add fi les to vector store for ( fi leID in fi lesArray) { addFileToVectorStore( fi leID, vectorStoreID); } openAI-coldfusion-utils
  • 66.
    T H EA P I W O R K F LO W 3 Add fi les to vector store { "id": " fi le-abc123", "object": "vector_store. fi le", "created_at": 1699061776, "usage_bytes": 1234, "vector_store_id": "vs_abcd", "status": "completed", "last_error": null }
  • 67.
    T H EA P I W O R K F LO W How do you know if it’s done?
  • 68.
    T H EA P I W O R K F LO W hasFileBeenProcessed( fi leID, vectorStoreID) openAI-coldfusion-utils Checking for Completion GET https://api.openai.com/v1/vector_stores/{vector_store_id}/ fi les/{ fi le_id}
  • 69.
    T H EA P I W O R K F LO W while() loop Strategies for Waiting
  • 70.
    T H EA P I W O R K F LO W Database rows + scheduled task Strategies for Waiting
  • 71.
    T H EA P I W O R K F LO W Use SQS Strategies for Waiting
  • 72.
    T H EA P I W O R K F LO W Why SQS SQS Provides: Message ordering Fault-tolerant resilience Easy retries in case of API failure
  • 73.
    T H EA P I W O R K F LO W Why SQS You’ll need SQS queues for: Checking fi le processing completion Checking output generation completion
  • 74.
    T H EA P I W O R K F LO W Why SQS You’ll need SQS queues for: Uploading fi les Checking fi le processing completion Checking output generation completion File and vector store cleanup
  • 75.
    T H EA P I W O R K F LO W 4 Call the Responses API, referencing the vector store POST https://api.openai.com/v1/responses
  • 76.
    T H EA P I W O R K F LO W 4 Call the Responses API, referencing the vector store { “model": “gpt-4.1”, "tools": [ { "type": " fi le_search", "vector_store_ids": ["#thisVectorStoreID#"] } ], "instructions": "#promptInstructions#", "input": "#promptInput#" };
  • 77.
    T H EA P I W O R K F LO W 4 Call the Responses API, referencing the vector store { “model": “gpt-4.1”, "tools": [ { "type": " fi le_search", "vector_store_ids": ["#thisVectorStoreID#"] } ], "instructions": "#promptInstructions#", "input": "#promptInput#" };
  • 78.
    T H EA P I W O R K F LO W 4 Call the Responses API, referencing the vector store { “model": “gpt-4.1”, "tools": [ { "type": " fi le_search", "vector_store_ids": ["#thisVectorStoreID#"] } ], "instructions": "#promptInstructions#", "input": "#promptInput#" };
  • 79.
    T H EA P I W O R K F LO W Conversing with GPT4.1 Prompt Instructions + Input = “Prompt”
  • 80.
    T H EA P I W O R K F LO W Conversing with GPT4.1 Main prompt → instructions Custom content/context → input
  • 81.
    T H EA P I W O R K F LO W Conversing with GPT4.1 include() instructions
  • 82.
    T H EA P I W O R K F LO W Conversing with GPT4.1 Instructions Input Files in Vector Store LLM
  • 83.
    T H EA P I W O R K F LO W 4* Check for completion Content generation can take a while
  • 84.
    T H EA P I W O R K F LO W Fully asynchronous work fl ow Handling Waiting for Completion
  • 85.
    T H EA P I W O R K F LO W Progress bars Handling Waiting for Completion
  • 86.
    T H EA P I W O R K F LO W Handling Waiting for Completion
  • 87.
    T H EA P I W O R K F LO W Streaming responses Handling Waiting for Completion
  • 88.
    T H EA P I W O R K F LO W 5 Get the generated content from the response cfhttp requests are synchronous
  • 89.
    T H EA P I W O R K F LO W 5 Get the generated content from the response GET https://api.openai.com/v1/responses/{response_id}
  • 90.
    T H EA P I W O R K F LO W 5 Get the generated content from the response In the cfhttp call response: deserializeJSON(response. fi leContent).callResult.output
  • 91.
    T H EA P I W O R K F LO W 5 Get the generated content from the response Check that the response is useful!
  • 92.
    T H EA P I W O R K F LO W Steps in the Responses + RAG Work fl ow 1 Upload fi les Create vector store Add fi les to vector store Call the Responses API, referencing the vector store Get the generated content from the response 2 3 4 5
  • 93.
    T H EA P I W O R K F LO W Don’t forget to clean up the fi les!
  • 94.
  • 95.
    PA I NF U L L E S S O N S Re fi ne your prompt in the Playground before building anything.
  • 96.
    PA I NF U L L E S S O N S Don't ask for references.
  • 97.
    PA I NF U L L E S S O N S Really structured output? Use Structured Outputs (JSON Schema).
  • 98.
    PA I NF U L L E S S O N S Requests fail. Build for retries.
  • 99.
    PA I NF U L L E S S O N S Multi-step prompts? Write options into your app.
  • 100.
    PA I NF U L L E S S O N S Friends don’t let friends build open-ended chatbots.
  • 101.
  • 102.