This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Anthropic = require('@anthropic-ai/sdk'); | |
const path = require('path'); | |
const YAML = require('yaml'); | |
const fs = require('fs'); | |
// Initialize Anthropic SDK | |
const anthropic = new Anthropic({ | |
apiKey: process.env.ANTHROPIC_API_KEY, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Stream a response from the OpenAI completion API.""" | |
import os | |
import re | |
import sys | |
import time | |
import random | |
import openai | |
openai.api_key = open(os.path.expanduser("~/.openai")).read().strip() |