Back to APIs list

ChatGPT API examples & templates

Use these vals as a playground to view and fork ChatGPT API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
weaverwhale avatar
GistGPT
@weaverwhale
HTTP
GistGPT A helpful assistant who provides the gist of a gist How to use / and /gist - Default response is to explain this file. I believe this is effectively real-time recursion ? /gist?url={URL} - Provide a RAW file URL from Github, BitBucket, GitLab, Val Town, etc. and GistGPT will provide you the gist of the code. /about - "Tell me a little bit about yourself"
stevekrouse avatar
gpt3Unsafe
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
ktodaz avatar
gpt3Example
@ktodaz
Script
Forked from isfeng/gpt3Example
isfeng avatar
gpt3
@isfeng
Script
An interactive, runnable TypeScript val by isfeng
treb0r avatar
weatherGPT
@treb0r
Cron
Forked from ellenchisa/weatherGPT
ljus avatar
weatherGPT
@ljus
HTTP
WeatherGPT Using OpenAI chat completion (GPT3) with function calls to SMHI api The API is instructed to use the current time in Europe/Stockholm timezone. If the message can not be handled with the weather API endpoint, the Open AI assistant will reply instead. Relevant API documentation SMHI, forecast documentation OPEN AI, GPT function calling documentation How to use this endpoint GET: RUN_ENDPOINT?args=["A weather question"] Response { answer?: string // If the message could not be answered with the SMHI API error?:string // data?: unknown // the actual data returned from SMHI, if the API is called summary?: string // a summary of the data, by GPT API } Examples How is the weather in the Capital of Sweden tomorrow. How is the weather at Liseberg on Friday. Packages used zod: for describing the SMHI API response and function API input zod-to-json-schema: Transform the zod schema to json schema (readable by the GPT API) gpt3-tokenizer: count the number of tokens date-fns-tz: To handle dates in a specific timezone (Europe/Stockholm)
abar04 avatar
weatherGPT
@abar04
Cron
Forked from sarfrazkhan18/weatherGPT
jcoleman avatar
weatherGPT
@jcoleman
Cron
Forked from stevekrouse/weatherGPT
varun_balani avatar
weatherGPT
@varun_balani
Cron
Forked from stevekrouse/weatherGPT
webup avatar
chatSampleFunctionSingle
@webup
Script
An interactive, runnable TypeScript val by webup
stevekrouse avatar
gpt4vDemo
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
mebmeb avatar
weatherGPT
@mebmeb
Cron
Forked from stevekrouse/weatherGPT
mgsers avatar
gtp3
@mgsers
Cron
An interactive, runnable TypeScript val by mgsers
stevekrouse avatar
gpt3Example
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
snm avatar
gpt3
@snm
Script
* OpenAI text completion. https://platform.openai.com/docs/api-reference/completions * * val.town has generously provided a free daily quota. Until the quota is met, no need to provide an API key. * To see if the quota has been met, you can run @patrickjm.openAiFreeQuotaExceeded() * * For full REST API access, see @patrickjm.openAiTextCompletion
mgsers avatar
gpt3Example
@mgsers
Script
An interactive, runnable TypeScript val by mgsers