Skip to content

Instantly share code, notes, and snippets.

View omt66's full-sized avatar
🙂

Ogun omt66

🙂
View GitHub Profile
@omt66
omt66 / chatgpt-demo.ts
Created March 2, 2023 02:07
Using ChatGPT API gets the response from OpenAPI's gpt-3.5-turbo model.
import fetch from 'node-fetch'
import keys from "./api-keys.json"
const OPENAI_API_KEY = keys["openai_key"]
const OPENAI_CHATGPTAPI_URL = "https://api.openai.com/v1/chat/completions"
async function getChatGPTResponse(systemPrompt: string, userPrompt: string) {
let requestBody = {
model: 'gpt-3.5-turbo',
messages: [
@omt66
omt66 / Demo1.tsx
Last active January 22, 2020 06:52
export interface IPanelProps {
txt?: string
}
export class PanelDemo1 extends Component<IPanelDemoProps, {}> {
  render() {
    const { panelName } = this.props
    const selectedPanel = panelName === "panel1" ? <Panel1 /> : <Panel2 />
    return selectedPanel
  }
@omt66
omt66 / 0_reuse_code.js
Last active September 17, 2015 08:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@omt66
omt66 / tst123
Created February 9, 2013 19:53
Just a Gist test by O.
// Just a test
Log.Write("Just a test ;)");