Skip to content

Instantly share code, notes, and snippets.

View drifterz13's full-sized avatar

Totsawat.M drifterz13

  • Bangkok, TH
View GitHub Profile
@drifterz13
drifterz13 / openai-assistant-node.ts
Last active April 15, 2024 13:09
Node.js + OpenAI assistant example
require('dotenv').config()
import OpenAI from 'openai'
import fs from 'fs'
import path from 'path'
import { MessageContentText } from 'openai/resources/beta/threads/messages/messages'
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
})
<html>
<head></head>
<body>
<title></title>
<style type="text/css">
#outlook a {
padding: 0;
}
body {
margin: 0;